playMaker

Author Topic: Trigger Event: every frame option  (Read 7816 times)

doppelmonster

  • Full Member
  • ***
  • Posts: 157
    • Grinder Games
Trigger Event: every frame option
« on: April 17, 2013, 02:33:00 AM »
Hello,

I need the "Trigger Event" Action to test only one time and then leave the action, even when there is no collision. In the moment you are stuck in the action until a collision happened. So a "every frame" option would be nice.

My scenario:
in a Pool Billard like game the user should be able to place a ball after a foul (ball in hand). So i switch the collider to trigger and let the  ser place the ball. if he is ready i want to do a one time check if the user placed the ball intersecting another one on the table.

escpodgames

  • Hero Member
  • *****
  • Posts: 687
    • Assets
Re: Trigger Event: every frame option
« Reply #1 on: April 17, 2013, 02:38:07 AM »
Have you tried using On Collison Stay? its an option on the Collison event. This should check if the collider is inside a trigger.

doppelmonster

  • Full Member
  • ***
  • Posts: 157
    • Grinder Games
Re: Trigger Event: every frame option
« Reply #2 on: April 17, 2013, 02:50:13 AM »
Detecting a collision is not the problem. I would need a "no collision" event or just check once for collisions and if no collision happened,it should just go on in the state (like most of the actions by default do). I need the "every frame" option to be able to turn it OFF. Right now "every frame" is always turned on for "Trigger Event"....
« Last Edit: April 17, 2013, 02:52:04 AM by doppelmonster »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Trigger Event: every frame option
« Reply #3 on: April 17, 2013, 02:59:20 AM »
Hi,

 on the state where you use that action, have a "next frame event" action after it firing "FINISH" and you'll be set.

bye,

 Jean

doppelmonster

  • Full Member
  • ***
  • Posts: 157
    • Grinder Games
Re: Trigger Event: every frame option
« Reply #4 on: April 17, 2013, 03:43:37 AM »
Hi Jean,
sounds good, that would be exactly what i need.

But unfortunately it dont work for me. Now the Trigger is not catching the collision anymore.
I attached a screenshot with my setup. Now even when there is a collision the "Nofoul!" event is triggered. Turning the "Next Frame" action off will catch the collision.

What i am doing wrong?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Trigger Event: every frame option
« Reply #5 on: April 18, 2013, 02:10:28 AM »
Hi,

 well, it's likely ( if your set up is correct) that indeed it doesn't collide on that frame...

mybe in your case you need to split your fsm into two, one that listen always to collisions and dispatch a custom global event when it does detect the collision you expect and another fsm only implement that custom event and perform a task.

 I never had any cases in my projects where I needed to check for a collision one frame only... I don't really see any use case, what happens generally is that I maintain a boolean variable that I raise to true and false manually based on the TRIGGER ENTER and TRIGGER EXIT, or with the trigger event custom action, that that feature is one fsm doing just that and nothing else, and other fsm simply check for that boolean flag when they need too. It's a lot cleaner I feel.

 does that make sense?

 bye,

 Jean

doppelmonster

  • Full Member
  • ***
  • Posts: 157
    • Grinder Games
Re: Trigger Event: every frame option
« Reply #6 on: April 18, 2013, 03:45:55 AM »
Hi Jean,
my FSM are already split like you said (Trigger Test, Gameplay Manager). But i have to put a "wait" action in my Gameplay Manager because i will get no event on "No Collision". In some cases this makes it unrelyable (is there some explanation, how much can be done (actions, States) in a frame cycle?).

I find one shot Trigger action (or "no collision" events) very usefull for things that should happen when you are outside the triggerzone.

For customizing the action you would only have to add an execution end to it, or? I already tried it myself but with no luck. Either the action is not executed at all(passes on but dont detect anything) or the action dont pass to the next action in the state.


The other Thing with the Trigger Event action is, that it should have a multiple tag  option (one guy (Maddox?) provided a custom action for Collision Event which has this feature).

Playmaker is already very great and i can do 99 percent with what is already there (including your support and custom stuff i find in the forum).
« Last Edit: April 18, 2013, 03:47:44 AM by doppelmonster »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Trigger Event: every frame option
« Reply #7 on: April 22, 2013, 01:30:09 AM »
Hi,

 do you have a ref to that action maddox did, I'll see what can be done then, cause I am not sure I understand where is the issue now.

bye,

 Jean

doppelmonster

  • Full Member
  • ***
  • Posts: 157
    • Grinder Games
Re: Trigger Event: every frame option
« Reply #8 on: April 22, 2013, 05:21:37 AM »

MAX_POWER

  • Playmaker Newbie
  • *
  • Posts: 40
Re: Trigger Event: every frame option
« Reply #9 on: January 19, 2016, 03:27:41 PM »
Repeat interval could be added to the trigger event for optimization reasons. Basically similar which raycast has so that you could set a every nth frame value.