playMaker

Author Topic: Trigger calculation[SOLVED]  (Read 1715 times)

hellzer

  • Playmaker Newbie
  • *
  • Posts: 28
Trigger calculation[SOLVED]
« on: October 26, 2016, 01:22:57 PM »
(excuse me for my poor English in advance)

So what I'm trying to do is. I have an object with a trigger and when an enemy enter, the object start to glow. But when the enemy is dead or out of range the object stop glowing.

what I would like to do is keeping track of the enemies coming inside the trigger and leaving so when one enemy die, my tower does not trigger exit because there is still other enemies inside.

I would like to have something that counts the leaving and entering enemies in the the trigger of my object,which will not be the only one to have a trigger.

Thx
« Last Edit: November 01, 2016, 03:42:04 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Trigger calculation
« Reply #1 on: October 27, 2016, 02:50:04 AM »
Hi,

 two solutions:

-- you turn this in its head and have your ennemies know about this trigger, and so each enemy is responsible for that management. It's more object oriented and more flexible in the long run.

-- you use an FsmArray of type GameObject, and everytime ou have a trigger Enter, you add that GameObject to the list, everytime you get a trigger Exit you remove it from the list. This should be on each triggers.

 Does that make sense?

Bye,

 Jean

hellzer

  • Playmaker Newbie
  • *
  • Posts: 28
Re: Trigger calculation
« Reply #2 on: October 27, 2016, 10:30:18 PM »
ohhh merci!

I did not know about FsmArray!!!
I will try and post the result.

thank you

hellzer

  • Playmaker Newbie
  • *
  • Posts: 28
Re: Trigger calculation[SOLVED]
« Reply #3 on: November 06, 2016, 01:34:35 PM »
ok so now I tryed arraymaker, but the problem is I had an older version of playmaker 1.8.1 I think then I update it and now my project is destroy,, because some fsm does not work and some object in the scene disappear....

My last back up was long ago and ya nothing work......... >_<
I would like to know if it possible to rollback playmaker version?

hellzer

  • Playmaker Newbie
  • *
  • Posts: 28
Re: Trigger calculation[SOLVED]
« Reply #4 on: November 06, 2016, 02:09:12 PM »
Nvm I forget to put back my plaumakerGlobals back to the folder >_<

Thread close