playMaker

Author Topic: (Solved) Send event on every 3 kills  (Read 342 times)

heavygunner

  • Full Member
  • ***
  • Posts: 148
    • View Profile
(Solved) Send event on every 3 kills
« on: November 02, 2018, 12:54:05 PM »
Hello !

I wanna sent an event on every 3 kills. Kill Count will be stored in a global variable.

Currently I added many float compare in single state and firing event.

If current kill count equals to 3 , fire event
If current kill count equals to 6 , fire event
If current kill count equals to 9 , fire event
If current kill count equals to 12 , fire event
If current kill count equals to 15 , fire event
If current kill count equals to 18 , fire event   :-\

Is there any way to do it easily ?
« Last Edit: November 03, 2018, 08:27:43 AM by heavygunner »

GonerGames

  • Junior Playmaker
  • **
  • Posts: 51
    • View Profile
Re: Send event on every 3 kills
« Reply #1 on: November 02, 2018, 01:50:06 PM »
In your state you can use the float/int compare with 2 variables:
1st Kill Count - Global Variable - Actual Kill count
2nd "Compare Value" - Local variable - Inital is 3

When the compare statement fires, in the next state do your action(s) and then add 3 to the "Compare Value" variable. This way the compare value will "auto increment" as you move up in kills.

Just remeber to reset "Compare value" back to 3 when applicable.

Hope this helps.


heavygunner

  • Full Member
  • ***
  • Posts: 148
    • View Profile
Re: Send event on every 3 kills
« Reply #2 on: November 03, 2018, 08:27:25 AM »
In your state you can use the float/int compare with 2 variables:
1st Kill Count - Global Variable - Actual Kill count
2nd "Compare Value" - Local variable - Inital is 3

When the compare statement fires, in the next state do your action(s) and then add 3 to the "Compare Value" variable. This way the compare value will "auto increment" as you move up in kills.

Just remeber to reset "Compare value" back to 3 when applicable.

Hope this helps.
Thank you. It worked :)