Playmaker Forum
PlayMaker Help & Tips => PlayMaker Help => Topic started by: Fat Pug Studio on May 13, 2017, 05:29:39 PM
-
Hello,
i'm making a wave spawn system that should operate the following way:
1.) First spawned wave is by default a small wave category
2.) Spawned ships are added to the array
3.) After a predetermined amount of time, an action gets the number of array items (destroyed and ship that left the screen are removed from the array)
4.) It the number of array items left is 0-5, big wave category is spawned, if the number is 5-10, medium wave category is spawned, if the number 11+, small wave category is spawned.
Using the int switch is a bad idea due to a large number of array items, and conditional expression should have two states (check if it's over 5, if it's false, check if it's over 10). Doesn't sound like much, but this is a simplified example, it will have probably much more to compare.
Any ideas on how i could handle it in one state? Maybe some custom int range switch action?
-
Yeah I think a modified Int Switch would be the way to go
-
I'll try making an action, should be more od less simple, i'm just not sure how to handle overlapping ranges.
-
So basically you need events to fire depending on the range of ints?
Between
1 - 5, - send event
6 - 10 - send event
11 - 20 - send event
21 - 30 send event
more than 30 - sent event.
Like this?
Ideally, you could add your own numbers for each range?
-
So I wrote an int range switch. Unfortunately you cannot really handle overlapping logic in that sense. Or I wouldnt recommend it.
You can download it here: https://github.com/dumbgamedev/general-playmaker/blob/master/Logic/IntRangeSwitch.cs
I also made a quick youtube video of instructions, which is uploading now.
-
Video here:
-
Great, thanks, i PM'd you. Jean, would you be kind enough to put this to the ecosystem so everyone has it? :)
-
Here is an updated version with a debug log, out of range event, and everyframe changed to a FSMbool.
- Eric
-
Awesome man ;D