- Joined
- Jul 16, 2012
- Messages
- 679
Hello felas
This is my code that I written
btw, udg_Human, udg_Orc, udg_Undead, udg_NightElf are unittype
How to solve this problem?
This is my code that I written
-
Runner Spawn
- Events
- Conditions
-
Actions
- -------- ------------------------------------------- --------
- -------- Local Vars --------
- Custom script: local unit RandomUnit
- Custom script: local unittype Race
- Custom script: local location Start
- Custom script: local location End
- -------- ------------------------------------------- --------
- -------- Check Player Race --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Race of Player 1 (Red)) Equal to Human
-
Then - Actions
- -------- Human Race --------
- Custom script: set Race = udg_Human[ GetRandomInt( 1, udg_Human_Count)]
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Race of Player 1 (Red)) Equal to Orc
-
Then - Actions
- -------- Orc Race --------
- Custom script: set Race = udg_Orc[ GetRandomInt( 1, udg_Orc_Count)]
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Race of Player 1 (Red)) Equal to Undead
-
Then - Actions
- -------- Undead Race --------
- Custom script: set Race = udg_Undead[ GetRandomInt( 1, udg_Undead_Count)]
-
Else - Actions
- -------- Night Elf Race --------
- Custom script: set Race = udg_NightElf[ GetRandomInt( 1, udg_NightElf_Count)]
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- -------- ------------------------------------------- --------
- -------- Spawn Random Unit in Random Point and move in Random Point --------
- Custom script: set Start = GetRandomLocInRect( gg_rct_Region_003)
- Custom script: set End = GetRandomLocInRect( gg_rct_Region_003_Copy)
- Custom script: call CreateNUnitsAtLoc( 1, Race, Player( 11), Start, 270.00)
- Custom script: set RandomUnit = GetLastCreatedUnit()
- Custom script: call IssuePointOrderLocBJ( RandomUnit, "move", End)
- Custom script: call UnitAddAbilityBJ( 'Aloc', udg_TempUnit )
- -------- ------------------------------------------- --------
- -------- Remove memory leaks --------
- Custom script: call RemoveLocation( udg_TempPoint)
- Custom script: call RemoveLocation( udg_TempPoint1)
- -------- ------------------------------------------- --------
- -------- Looping --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Game_SpawnSpeed Less than or equal to 0.00
-
Then - Actions
- -------- Avoid 0 speed --------
- Set Game_SpawnSpeed = 3.00
- Wait Game_SpawnSpeed seconds
-
Else - Actions
- Wait Game_SpawnSpeed seconds
-
If - Conditions
- Trigger - Run (This trigger) (ignoring conditions)
- Custom script: set Race = udg_Human[GetRandomInt(1, udg_Human_Count)]
- Custom script: set Race = udg_Orc[ GetRandomInt( 1, udg_Orc_Count)]
- Custom script: set Race = udg_Undead[ GetRandomInt( 1, udg_Undead_Count)]
- Custom script: set Race = udg_NightElf[ GetRandomInt( 1, udg_NightElf_Count)]
btw, udg_Human, udg_Orc, udg_Undead, udg_NightElf are unittype
How to solve this problem?
Last edited: