- Joined
- Jul 14, 2011
- Messages
- 3,213
Hi
I was wondering how to modify Wc3 default functions used on GUI and else. Example:
This GUI:
Which means:
So, that GUI action is related to this function CreateNUnitsAtLoc and does all that stuff. What I if want the same GUI action to do this:
I was wondering how to modify Wc3 default functions used on GUI and else. Example:
This GUI:
-
Actions
- Unit - Create 1 Footman for Player 1 (Red) at (Center of (Playable map area)) facing Default building facing degrees
JASS:
call CreateNUnitsAtLoc( 1, 'hfoo', Player(0), GetRectCenter(GetPlayableMapRect()), bj_UNIT_FACING )
Which means:
JASS:
function CreateNUnitsAtLoc takes integer count, integer unitId, player whichPlayer, location loc, real face returns group
call GroupClear(bj_lastCreatedGroup)
loop
set count = count - 1
exitwhen count < 0
call CreateUnitAtLocSaveLast(whichPlayer, unitId, loc, face)
call GroupAddUnit(bj_lastCreatedGroup, bj_lastCreatedUnit)
endloop
return bj_lastCreatedGroup
endfunction
So, that GUI action is related to this function CreateNUnitsAtLoc and does all that stuff. What I if want the same GUI action to do this:
JASS:
function CreateUnits takes integer count, integer unitId, player unitOwner, location loc, real face, returns nothing.
loop
set count = count - 1
exitwhen count < 0
set bj_lastCreatedUnit = CreateUnit(unitOwner, unitId, GetLocationX(loc), GetLocationY(loc), face)
endloop
call RemoveLocation(loc)
endfunction