- Joined
- Feb 22, 2013
- Messages
- 161
Is there something wrong with this? The five peasants spawn at the middle of the map which is no where near where they're supposed to spawn
JASS:
function GetMidPointX takes real Px, real Qx returns real
return (1/2)*(Px + Qx)
endfunction
function GetMidPointY takes real Py, real Qy returns real
return (1/2)*(Py + Qy)
endfunction
function Melee_Init_Actions takes nothing returns nothing
local real humanMidPointX = GetMidPointX(GetUnitX(gg_unit_ngol_0006), GetStartLocationX(GetPlayerStartLocation(Player(1))))
local real humanMidPointY = GetMidPointY(GetUnitY(gg_unit_ngol_0006), GetStartLocationY(GetPlayerStartLocation(Player(1))))
call CreateUnit(Player(1), 'hpea', humanMidPointX, humanMidPointY + 64.00, 270.00)
call CreateUnit(Player(1), 'hpea', humanMidPointX - 64.00, humanMidPointY, 270.00)
call CreateUnit(Player(1), 'hpea', humanMidPointX - 32.00, humanMidPointY - 64.00, 270.00)
call CreateUnit(Player(1), 'hpea', humanMidPointX + 32.00, humanMidPointY + 64.00, 270.00)
call CreateUnit(Player(1), 'hpea', humanMidPointX + 64.00, humanMidPointY, 270.00)
endfunction
//===========================================================================
function InitTrig_Melee_Init takes nothing returns nothing
set gg_trg_Melee_Init = CreateTrigger( )
call TriggerAddAction( gg_trg_Melee_Init, function Melee_Init_Actions )
endfunction