No you can't remove an event from a trigger. Why do you want to do that?
No local variables are locals. They exist only in the function where they are declared. To pass variables between functions without using globals, you have to use handle variables.
This is the bug heache (spelled correctly?)for all spell makers. There is no good 100% chance method to detect damage dealed to any unit. You know the damage taken response only works for Event - Unit takes damage. Any you must choose a specific unit for that event. Did you read my comment to your Damage Check spell?
But in your trigger 2, you add the event after you removed it, why???
try this way Trigger1 event-unit enter playable map actions- custom script: local trigger trig=CreateTrigger() custom script: call TriggerRegisterUnitEvent(trig,GetEnteringUnit(),EVENT_UNIT_DAMAGED) custom script: call TriggerAddAction(trig,function DisplayDamage)
paste the following function to your map's custom script section function DisplayDamage takes nothing returns nothing local unit u=GetTriggerUnit() if GetUnitState(u,UNIT_STATE_LIFE)<=0 then call DestroyTrigger(GetTriggeringTrigger()) endif call DisplayTextToPlayer(GetLocalPlayer(),0,0,R2S(GetEventDamage())) endfunction
@cdp726 This thing is only usefull if you want to have all damage dealed shown in the game. I don't that is what Emergenzy truly want. I suppose he want to have the damage vaule in some ability.
No i dont want to show all units damage in the game.. It was only an example.. I want to add another action.. Like floating text that display the damaged taken by any unit.. Could use it for my rpg.