Beetlebomb
New Member
- Reaction score
- 43
Hey guys, did a quick forum search, but couldn't find an answer to this problem.
I'm trying to make a unit be selected in the beginning of the game(A Hero(if that matters)), but for some strange reason it's not going through.
Here's my code--I'm sure there's a simple explanation to this:
And of course, +rep to the kind souls-- as usual ^^
I'm trying to make a unit be selected in the beginning of the game(A Hero(if that matters)), but for some strange reason it's not going through.
Here's my code--I'm sure there's a simple explanation to this:
JASS:
scope SetupGame initializer Setup
private function Remove_Them takes nothing returns nothing
call RemoveUnit(GetEnumUnit())
endfunction
private function Activate_ManaBubble takes nothing returns nothing
local real x = GetUnitX(GetEnumUnit())
local real y = GetUnitY(GetEnumUnit())
call IssueImmediateOrder( GetEnumUnit(), "manashieldon" )
call SelectUnitForPlayerSingle(GetEnumUnit(), GetEnumPlayer()) //not working <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite3" alt=":(" title="Frown :(" loading="lazy" data-shortname=":(" />
call SetCameraPosition(x, y)
endfunction
private function Actions takes nothing returns nothing
local group g = CreateGroup()
local integer i = 0
call Cheat("iseedeadpeople")
call SuspendTimeOfDay(true)
loop
exitwhen i == bj_MAX_PLAYER_SLOTS
set g = GetUnitsOfPlayerAll(Player(i))
if GetPlayerSlotState(Player(i)) == PLAYER_SLOT_STATE_EMPTY then
call ForGroup(g, function Remove_Them)
else
call ForGroup(g, function Activate_ManaBubble)
endif
call GroupClear(g)
set g = null
set i = i+1
endloop
call DestroyGroup(g)
endfunction
//===========================================================================
private function Setup takes nothing returns nothing
local trigger t = CreateTrigger()
call TriggerRegisterTimerEventSingle(t, 0.00 )
call TriggerAddAction(t, function Actions )
endfunction
endscope
And of course, +rep to the kind souls-- as usual ^^