- Joined
- Apr 8, 2009
- Messages
- 21
Hey guys! I'm just beginning to move into JASS, and so far I've hit it off quite well, as I've managed to get some basic functions working. Anyway, I'm trying to create a little function that will move a unit/move camera/delete the "buying unit" when a unit is bought. I'm using a rect in an event (since when you buy the unit it enters the region) and I was going to make it check if it wasn't the wisp unit (which everyone gets on in the beginning), simply by checking if the ID for the unit wasn't the ID for the wisp and I've got this:
I don't know how to convert GetTriggerUnit() into a UnitId to compare with 'e000' since the functions in the function list that relate to UnitId only return integer or string. Does anyone have an suggestions?
-
SpawnSelectHero
-
Events
- Unit - A unit enters areaSpawnAreaHero <gen>
- Conditions
-
Actions
- Custom script: call SpawnSelectHero()
-
Events
JASS:
//e000 is the Wisp ID
function SpawnSelectHero takes nothing returns nothing
if UnitId2String(GetTriggerUnit()) != 'e000' then
call SetUnitPositionLoc(GetTriggerUnit(), Location(-2580.0, -17994.0))
endif
endfunction
I don't know how to convert GetTriggerUnit() into a UnitId to compare with 'e000' since the functions in the function list that relate to UnitId only return integer or string. Does anyone have an suggestions?