- Joined
- Aug 21, 2005
- Messages
- 3,699
I have no idea why, but RemoveUnit(unit) is not removing the unit. I'm using a dummy unit with lightning shield model (but I've tried other models too) because I'm attempting to make a light system where lights can be turned on and off.
The original idea was to simply hide the light unit when the lights are turned off, but the actual light doesn't disappear, so I couldn't use that.
So I'm trying to use RemoveUnit() now to remove the light unit. But... the light unit dummy is still there. The actual light effect is lowered but not completely removed upon using the RemoveUnit function, and the actual dummy unit is still there (drag-select over the area and you'll see a "frog" unit with a lightning shield model).
This is the jasscode where stuff goes wrong:
this.light does exist.
I honestly don't know what's wrong. Expiration timer, SetUnitState, KillUnit, nothing seems to work...
I've attached the map so you can test it in-game. The lever you see contains an icon to turn the lights on/off.
EDIT: I've found the problem.
The original idea was to simply hide the light unit when the lights are turned off, but the actual light doesn't disappear, so I couldn't use that.
So I'm trying to use RemoveUnit() now to remove the light unit. But... the light unit dummy is still there. The actual light effect is lowered but not completely removed upon using the RemoveUnit function, and the actual dummy unit is still there (drag-select over the area and you'll see a "frog" unit with a lightning shield model).
This is the jasscode where stuff goes wrong:
JASS:
method TurnOff takes nothing returns nothing
call RemoveUnit(this.light)
endmethod
I honestly don't know what's wrong. Expiration timer, SetUnitState, KillUnit, nothing seems to work...
I've attached the map so you can test it in-game. The lever you see contains an icon to turn the lights on/off.
EDIT: I've found the problem.