So im having this problem in my trigger for respawning a hero which includes a Wait action, you can view the trigger below.
The problem is that after the wait action, the trigger simply doesnt continue -.- . So is there something in the that stop the trigger from continuing after
the wait action? If anyone knows a better way to do this or an alternative pls tell, i need to have a 10 secs waiting period after the hero of a specific player has dies before it respawns.
o yeh, if i remove the wait action from the trigger, it works as intended.
thnx for your time!
RespawnEventsUnit-AnyUnitdiesConditionsOrConditions(Unittypeof(Triggeringunit))==Spaceknight(Commando)(Unittypeof(Triggeringunit))==SarahKerrigan(Char)(Unittypeof(Triggeringunit))==ZeratulActionsUI-Display"10 seconds til respawn!"for(Playergroup((Ownerof(Triggeringunit))))toErrorareaGeneral-Wait10.0GameTimesecondsGeneral-If(Conditions)thendo(Actions)elsedo(Actions)If((Ownerof(Triggeringunit))isin(Playersonteam1))==TrueThenUnit-Create1(Unittypeof(Triggeringunit))forplayer(Ownerof(Triggeringunit))atStartLocation001facingTower5(NoOptions)General-If(Conditions)thendo(Actions)elsedo(Actions)If(Ownerof(Triggeringunit))==(Player1from(Playersonteam1))ThenUnitGroup-Pickeachunitin(Anyunitsin(Entiremap)ownedbyplayer(Ownerof(Triggeringunit))matchingRequired:Heroic;Excluded:Missile,Dead,Hidden,withatmostAnyAmount)anddo(Actions)ActionsCamera-StopFollowingforplayer(Ownerof(Triggeringunit))(Unitgroup(Player1))withthecameraandClearCurrentTargetCamera-Panthecameraforplayer(Ownerof(Triggeringunit))toStartLocation001over1.0secondswithExistingVelocity%initialvelocity,10%deceleration,andDoNotusesmartpanningVariable-SetPlayer1=(Pickedunit)ElseUnitGroup-Pickeachunitin(Anyunitsin(Entiremap)ownedbyplayer(Ownerof(Triggeringunit))matchingRequired:Heroic;Excluded:Missile,Dead,Hidden,withatmostAnyAmount)anddo(Actions)ActionsCamera-StopFollowingforplayer(Ownerof(Triggeringunit))(Unitgroup(Player2))withthecameraandClearCurrentTargetCamera-Panthecameraforplayer(Ownerof(Triggeringunit))toStartLocation001over1.0secondswithExistingVelocity%initialvelocity,10%deceleration,andDoNotusesmartpanningVariable-SetPlayer2=(Pickedunit)
thnx for your awnser man, but i don't understand what you mean, and if i did understand what you mean you want me to save the owner of the unit that died in a local variable and then have it check that ? also if thise is what you mean i dont know how this would help :(
Save every "triggering something" used in a local variable and use that instead.
What he said.
After 10 seconds, the triggering unit does not exist anymore, the game cleared every reference to it. So stuff like Owner of (Triggering Unit) or Unit Type of (Triggering Unit) will return undefined results, so the trigger will just do nothing.
Alternatively, you can raise the unit's Death Time field in data to > 10 seconds, so the dead unit does still exist after 10 seconds, however saving the required data in local variables wold be the recommended course of action.
thnx for your awnser man, but i don't understand what you mean, and if i did understand what you mean you want me to save the owner of the unit that died in a local variable and then have it check that ?
Exactly, you create a new local variable of type Integer, lets call it TempPlayer and set it to the Owner of (Triggering Unit) before the wait. Then, after the wait, you use this variable, instead of the Owner of (Triggering Unit), somewhat like that:
Your anwser was very clear, It took me a few tries to set it up right and i thought i did everything but its not working yet :( heres what i got now:
RespawnEventsUnit-AnyUnitdiesLocalVariablesDiedUnit=NoUnit<Unit>TempOwner=0<Integer>ConditionsOrConditions(Unittypeof(Triggeringunit))==Spaceknight(Commando)(Unittypeof(Triggeringunit))==SarahKerrigan(Char)(Unittypeof(Triggeringunit))==ZeratulActionsVariable-SetDiedUnit=(Triggeringunit)Variable-SetTempOwner=(Ownerof(Triggeringunit))UI-Display"10 seconds til respawn!"for(Playergroup((Ownerof(Triggeringunit))))toErrorareaGeneral-Wait10.0GameTimesecondsGeneral-If(Conditions)thendo(Actions)elsedo(Actions)If(TempOwnerisin(Playersonteam1))==TrueThenUnit-Create1(UnittypeofDiedUnit)forplayerTempOwneratStartLocation001facingTower5(NoOptions)General-If(Conditions)thendo(Actions)elsedo(Actions)IfTempOwner==(Player1from(Playersonteam1))ThenUnitGroup-Pickeachunitin(Anyunitsin(Entiremap)ownedbyplayerTempOwnermatchingRequired:Heroic;Excluded:Missile,Dead,Hidden,withatmostAnyAmount)anddo(Actions)ActionsCamera-StopFollowingforplayerTempOwner(Unitgroup(Player1))withthecameraandClearCurrentTargetCamera-PanthecameraforplayerTempOwnertoStartLocation001over1.0secondswithExistingVelocity%initialvelocity,10%deceleration,andDoNotusesmartpanningVariable-SetPlayer1=(Pickedunit)ElseUnitGroup-Pickeachunitin(Anyunitsin(Entiremap)ownedbyplayer(OwnerofDiedUnit)matchingRequired:Heroic;Excluded:Missile,Dead,Hidden,withatmostAnyAmount)anddo(Actions)ActionsCamera-StopFollowingforplayerTempOwner(Unitgroup(Player2))withthecameraandClearCurrentTargetCamera-PanthecameraforplayerTempOwnertoStartLocation001over1.0secondswithExistingVelocity%initialvelocity,10%deceleration,andDoNotusesmartpanningVariable-SetPlayer2=(Pickedunit)
Your local variable "DiedUnit" refers to a unit that doesn't exist anymore (If the unit is dead, its removed from the game unless it has a death time (After the wait, that is)). Just make the variable type be "Game Link" and then "Unit Type" in the second drop down, and set it to the unit type of the triggering unit at the start.
Man this took me a pretty awful longtime to fix but its done now :p once i had changed the unit to game link i started getting error messages in my pick each unit action. Then i found out that the error occured cause i had nomore unit to refer to in locals only the "type" en eventually it became this:
Thnx for all the nice help!
on to the next problem!
RespawnEventsUnit-AnyUnitdiesLocalVariablesDiedunit=(Triggeringunit)<Unit>TypeDiedUnit=(Unittypeof(Triggeringunit))<GameLink-Unit>TempOwner=0<Integer>ConditionsOrConditions(Unittypeof(Triggeringunit))==Spaceknight(Commando)(Unittypeof(Triggeringunit))==SarahKerrigan(Char)(Unittypeof(Triggeringunit))==ZeratulActionsVariable-SetTempOwner=(OwnerofDiedunit)UI-Display"10 seconds til respawn!"for(Playergroup((Ownerof(Triggeringunit))))toErrorareaGeneral-Wait10.0GameTimesecondsGeneral-If(Conditions)thendo(Actions)elsedo(Actions)If(TempOwnerisin(Playersonteam1))==TrueThenUnit-Create1TypeDiedUnitforplayerTempOwneratStartLocation001facingTower5(NoOptions)General-If(Conditions)thendo(Actions)elsedo(Actions)IfTempOwner==(Player1from(Playersonteam1))ThenUnitGroup-Pickeachunitin(Anyunitsin(Entiremap)ownedbyplayerTempOwnermatchingRequired:Heroic;Excluded:Missile,Dead,Hidden,withatmostAnyAmount)anddo(Actions)Camera-StopFollowingforplayerTempOwner(Unitgroup(Player1))withthecameraandClearCurrentTargetCamera-PanthecameraforplayerTempOwnertoStartLocation001over1.0secondswithExistingVelocity%initialvelocity,10%deceleration,andDoNotusesmartpanningVariable-SetPlayer1=(Pickedunit)
Hey ppl.
So im having this problem in my trigger for respawning a hero which includes a Wait action, you can view the trigger below. The problem is that after the wait action, the trigger simply doesnt continue -.- . So is there something in the that stop the trigger from continuing after the wait action? If anyone knows a better way to do this or an alternative pls tell, i need to have a 10 secs waiting period after the hero of a specific player has dies before it respawns.
o yeh, if i remove the wait action from the trigger, it works as intended.
thnx for your time!
Save every "triggering something" used in a local variable and use that instead.
@Ahli634: Go
thnx for your awnser man, but i don't understand what you mean, and if i did understand what you mean you want me to save the owner of the unit that died in a local variable and then have it check that ? also if thise is what you mean i dont know how this would help :(
What he said.
After 10 seconds, the triggering unit does not exist anymore, the game cleared every reference to it. So stuff like Owner of (Triggering Unit) or Unit Type of (Triggering Unit) will return undefined results, so the trigger will just do nothing.
Alternatively, you can raise the unit's Death Time field in data to > 10 seconds, so the dead unit does still exist after 10 seconds, however saving the required data in local variables wold be the recommended course of action.
Exactly, you create a new local variable of type Integer, lets call it TempPlayer and set it to the Owner of (Triggering Unit) before the wait. Then, after the wait, you use this variable, instead of the Owner of (Triggering Unit), somewhat like that:
@Rice87: Go
Every "Triggering (something)" is reset after a wait action. You need to save those into a local variable if you want to use them after a wait.
EDIT: Küken beat me to it...
@TheAlmaity: Go
ah thnx this clears things up! im going to try it and post the results :]
@Kueken531: Go
Your anwser was very clear, It took me a few tries to set it up right and i thought i did everything but its not working yet :( heres what i got now:
@Rice87: Go
Your local variable "DiedUnit" refers to a unit that doesn't exist anymore (If the unit is dead, its removed from the game unless it has a death time (After the wait, that is)). Just make the variable type be "Game Link" and then "Unit Type" in the second drop down, and set it to the unit type of the triggering unit at the start.
@TheAlmaity: Go
Man this took me a pretty awful longtime to fix but its done now :p once i had changed the unit to game link i started getting error messages in my pick each unit action. Then i found out that the error occured cause i had nomore unit to refer to in locals only the "type" en eventually it became this:
Thnx for all the nice help!
on to the next problem!