HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Random Stuff

07-06-2004, 05:41 PM#1
duckduck
How do you make a trigger that creates random units? Like you either get a Rifleman or a Footman? Please help!!!!
07-06-2004, 05:57 PM#2
Milkman
Variables:
Randomizer, Integer
Triggers:
Events: Whatever you Choose
Conditions: Whatever you Choose
Actions: Set Randomizer= Math - Random number between 1 and 3
If Randomizer =1 Then create 1 footman
If Randomizer =2 Then create 1 rifleman
If Randomizer =3 Then create 1 peasant.

Get it?
07-06-2004, 06:37 PM#3
duckduck
Quote:
Originally Posted by Milkman
Actions: Set Randomizer= Math - Random number between 1 and 3
If Randomizer =1 Then create 1 footman
If Randomizer =2 Then create 1 rifleman
If Randomizer =3 Then create 1 peasant.

I get it and did that... but it only creates peasents...
07-06-2004, 06:38 PM#4
duckduck
Quote:
Originally Posted by Milkman
Actions: Set Randomizer= Math - Random number between 1 and 3
If Randomizer =1 Then create 1 footman
If Randomizer =2 Then create 1 rifleman
If Randomizer =3 Then create 1 peasant.

I get it and did that... but it only creates peasents. Do i have to do:

Action:
If Randomizer = 1, then create 1 footman, else do nothing
07-06-2004, 06:45 PM#5
Vexorian
Test map is buggy with random numbers, they are always the same.

And you can have a unit type array:


at map initialization:
set units[0]=footman
set units[1]=rifleman
set units[2]=peasant


At the trigger:

Create one units[Random Number between 0 and 2] for player at ...
07-06-2004, 07:02 PM#6
duckduck
Quote:
Originally Posted by Lord Vexorian
Create one units[Random Number between 0 and 2] for player at ...

I dont get that?
07-06-2004, 07:03 PM#7
duckduck
Quote:
Originally Posted by Lord Vexorian
Create one units[Random Number between 0 and 2] for player at ...

I dont get how to do [Random Number between 0 and 2].
07-06-2004, 07:05 PM#8
Vexorian
Math - Random Number

Use an array, Variables dialog - create a new variable , mark it as an array.

What Is an array?
An array is a group of variables that have all the same name but a different index that can be a number between 0 and 8191
07-06-2004, 07:15 PM#9
duckduck
Can you be specific because I'm lost...