- Joined
- Jun 30, 2006
- Messages
- 230
This is declared in my map header:
Then I call it with a trigger(with other things as well):
What am I doing wrong?
Note: The Regions() never worked, so I can't tell if it is init, but I know that CreepSpawnPreload() is working.
JASS:
globals
integer array udg_ResearchId
integer array udg_CreepId
integer array udg_Interval
real array udg_SpawnX
real array udg_SpawnY
integer udg_CurrentInterval = 0
force udg_Alliance
force udg_Horde
region array udg_Region
endglobals
function Forces takes nothing returns nothing
local integer c = 0
set udg_Alliance = CreateForce()
set udg_Horde = CreateForce()
loop
exitwhen c > 4
if ( GetPlayerSlotState(Player(c)) == PLAYER_SLOT_STATE_PLAYING ) then
call ForceAddPlayer( udg_Alliance, Player(c) )
endif
if ( GetPlayerSlotState(Player(c + 5)) == PLAYER_SLOT_STATE_PLAYING ) then
call ForceAddPlayer( udg_Horde, Player(c + 5) )
endif
set c = c + 1
endloop
endfunction
Then I call it with a trigger(with other things as well):
-
Init
-
Events
- Map initialization
- Conditions
-
Actions
- Custom script: call Forces()
- Custom script: call CreepSpawnPreload()
- Custom script: call Regions()
-
Events
What am I doing wrong?
Note: The Regions() never worked, so I can't tell if it is init, but I know that CreepSpawnPreload() is working.