- Joined
- Nov 4, 2006
- Messages
- 1,239
Hi everyone,
1)
i'm looking for a good way to create a random unit spawn trigger.
Setup is as follows:
i have 5 levels and 3 different unit types (A B C)
now obviously 2 of the units will spawn twice within the 5 waves, but they should not be allowed to spawn three times, back to back is allowed, so e.g.
AABCB
ABCAB
ACCBA
...
the way i thought of doing it is creating an integer array for the three starting at "2" and decreasing it by 1 every time they spawn and then loop through the options until i hit one that's not 0, but that seems somewhat inefficient (or maybe i'm doing it wrong). Is there a better way to do that? GUI is strongly preferred unless it's a full system i can copy.
2)
to avoid having to create 3x5 units, i just create 1 of each type and adjust their HP by modifying the player handicap each level. any other ideas on that or is this the best way to do that?
1)
i'm looking for a good way to create a random unit spawn trigger.
Setup is as follows:
i have 5 levels and 3 different unit types (A B C)
now obviously 2 of the units will spawn twice within the 5 waves, but they should not be allowed to spawn three times, back to back is allowed, so e.g.
AABCB
ABCAB
ACCBA
...
the way i thought of doing it is creating an integer array for the three starting at "2" and decreasing it by 1 every time they spawn and then loop through the options until i hit one that's not 0, but that seems somewhat inefficient (or maybe i'm doing it wrong). Is there a better way to do that? GUI is strongly preferred unless it's a full system i can copy.
2)
to avoid having to create 3x5 units, i just create 1 of each type and adjust their HP by modifying the player handicap each level. any other ideas on that or is this the best way to do that?