HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

"Preloading" setup

07-19-2007, 05:00 AM#1
darkwulfv
I've got a stack of the following:

Collapse JASS:
call UnitApplyTimedLife(CreateUnit(Player(12), 'H001', x, y, 270.), 'BTLF', 1.)
Is something like that going to work for "preloading" a unit at map init? Even if it's inneficient, the effects will go unnoticed since it happens at map initialization, which is before the map is actually finished loading.
07-19-2007, 06:36 AM#2
Naakaloh
Yes, that will preload the unit if run at map initialization, however, unless I'm mistaken it's more efficient to have the unit preplaced and remove it at start.
07-19-2007, 06:45 AM#3
blu_da_noob
call RemoveUnit(CreateUnit(...)) ?
07-19-2007, 07:03 AM#4
darkwulfv
Oops. Forgot about that native. Fixing.
07-19-2007, 07:31 AM#5
PipeDream
Someone else will have to confirm, but I seem to recall that preplaced units are run through CreateUnit. War3-the-game doesn't look at war3mapUnits.doo.
07-19-2007, 07:38 AM#6
Chocobo
Quote:
Originally Posted by PipeDream
Someone else will have to confirm, but I seem to recall that preplaced units are run through CreateUnit. War3-the-game doesn't look at war3mapUnits.doo.

Each unit pre-placed is a global unit, ...
Each pre-placed unit is created though CreatePlayerUnits()..
and CreatePlayerUnits() calls for CreateUnitsForPlayer0(), CreateUnitsForPlayer1(), CreateUnitsForPlayer2(), .... CreateUnitsForPlayer15().
And CreatePlayerUnits() is ran from CreateAllUnits(), which also runs CreatePlayerBuildings()..
And CreateAllUnits() is ran from main(), that function is ran in MapInit..
07-19-2007, 09:42 AM#7
DioD
editor cannot run map script soo it uses war3mapUnits.doo if you corrupt or delete it map will no longer work in editor.