- Joined
- Mar 10, 2009
- Messages
- 5,016
SOLVED!
Why the unit is not created in RANDOM locations in this setup?...
While this is OK...
Why the unit is not created in RANDOM locations in this setup?...
JASS:
local integer lev = GetRandomInt(1, 10)
local rect r = bj_mapInitialPlayableArea
local location l = Location(GetRandomReal(GetRectMinX(r), GetRectMaxX(r)), GetRandomReal(GetRectMinY(r), GetRectMaxY(r)))
local unit u = CreateUnitAtLoc(Player(14), ChooseRandomCreep(lev), l, bj_UNIT_FACING)
call RemoveRect(r)
call RemoveLocation(l)
set u = null
set l = null
set r = null
While this is OK...
JASS:
local integer lev = GetRandomInt(1, 10)
local location l = Location(GetRandomReal(GetRectMinX(bj_mapInitialPlayableArea), GetRectMaxX(bj_mapInitialPlayableArea)), GetRandomReal(GetRectMinY(bj_mapInitialPlayableArea), GetRectMaxY(bj_mapInitialPlayableArea)))
local unit u = CreateUnitAtLoc(Player(14), ChooseRandomCreep(lev), l, bj_UNIT_FACING)
call RemoveLocation(l)
set u = null
set l = null
Last edited: