Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: heavygunner on November 02, 2018, 03: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 ?
-
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.
-
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 :)