- Joined
- Sep 13, 2008
- Messages
- 165
I'm making a short easy trigger that creates a random unit that then is assigned to a player through variables. I HAVE FIXED RANDOM SEED OFF.
UnitType[1] = Footman
UnitType[2] = Knight
UnitType[3] = Rifleman
UnitType[4] = Priest
However it isn't so random, the trigger always creates.
Player1 gets Rifleman
Player2 gets Priest
Player3 gets Rifleman
Player4 gets Priest
ALWAYS. So i them limited the range to random number between 1 and 2
and then all the players got Knights, not one footman.
Originally i had a trigger that created a unit one by one assigned to a player, but i decided i could create a loop to do that. So i did
So i want to make this random unit spawn more random.. and make the units for players 2,3 and 4 spawn.
UnitType[1] = Footman
UnitType[2] = Knight
UnitType[3] = Rifleman
UnitType[4] = Priest
However it isn't so random, the trigger always creates.
Player1 gets Rifleman
Player2 gets Priest
Player3 gets Rifleman
Player4 gets Priest
ALWAYS. So i them limited the range to random number between 1 and 2
and then all the players got Knights, not one footman.
Originally i had a trigger that created a unit one by one assigned to a player, but i decided i could create a loop to do that. So i did
-
For each (Integer A) from 1 to 4, do (Actions)
-
Loop - Actions
- Set Point = (Center of Player Spawn <gen>)
- Unit - Create 1 UnitType[(Random integer number between 1 and 4)] for (Player((Integer A))) at Point facing 90.00 degrees
- Set HeroID[(Integer A)] = (Last created unit)
- Set Point = (Center of CimMoveRegion[(Integer A)])
- Unit - Order (Last created unit) to Move To Point
- Wait 0.50 seconds
-
Loop - Actions
So i want to make this random unit spawn more random.. and make the units for players 2,3 and 4 spawn.