• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • ✅ HD Level Design Contest #1 POLL is now OPEN! Check out the stunning visuals of the final entries. 🔗Click here to cast your vote!

[Trigger] Attacked setting

Status
Not open for further replies.
Level 3
Joined
Mar 28, 2010
Messages
42
  • Frostmourne Attacked
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Level of Frostmourne for (Attacking unit)) Greater than or equal to 1
      • ((Owner of (Attacked unit)) is an enemy of (Owner of (Attacking unit))) Equal to True
    • Actions
      • Set FrostSwordAttacking = (Attacking unit)
      • Wait 0.20 seconds
      • Unit - Remove FrostSwordAbility[FrostSwordCount] from FrostSwordAttacking
      • Set FrostSwordCount = (Level of Frostmourne for FrostSwordAttacking)
      • Trigger - Turn off (This trigger)
      • Wait (14.00 - (2.00 x (Real((Level of Frostmourne for FrostSwordAttacking))))) seconds
      • Trigger - Turn on (This trigger)
      • Unit - Add FrostSwordAbility[FrostSwordCount] to FrostSwordAttacking
i wan make it after attack not before attack><
this trigger will run when that unit haven't take damages...==
how to solve???
sorry for my english...i'm from malaysia
 
Level 8
Joined
Apr 23, 2010
Messages
312
You can't turn off and then try to turn it back on in the same trigger. Make another trigger and have that turn on after you turn this one off, then in the new trigger make it do everything after Trigger - Turn off (This Trigger), then turn the new trigger off after it does all it's actions.
 
Level 3
Joined
Mar 28, 2010
Messages
42
You can't turn off and then try to turn it back on in the same trigger. Make another trigger and have that turn on after you turn this one off, then in the new trigger make it do everything after Trigger - Turn off (This Trigger), then turn the new trigger off after it does all it's actions.

but it work...><
it can be turn on after the trigger is turn off....
 
Level 3
Joined
Mar 28, 2010
Messages
42
Why are you turning it off in the first place? You have a wait there, so the trigger won't do anything until that waiting period is over.

oo...that mean i remove the turn off trigger still can work???coz i wanna make like dota kunkka tidebringer...><
and the problem is...this trigger will run before the unit take damages...i wan make it work after the unit take damages...
 
Level 13
Joined
Mar 16, 2008
Messages
941
1) 13oot-me, triggers can be turned on and off in a single trigger. Turning on and off only disabled and enables the trigger from triggering AGAIN, the current evaluation will not be affected. This means that turning off, waiting and turning on again is a sort of cooldown (not to mention the MUI stuff, but it works).
2) mckill is right. There would be another possibility. There is a system out there that registers attack events and calculates the missile/animation speed for each model individual. Afterwards you get a new attack event that triggers nearly correct. However, I don't know where it was :x
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,448
It's easy to use it, it's GUI.

  • Frostmourne Attacked
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • (Level of Frostmourne for DamageEventSource) Greater than or equal to 1
      • ((Owner of DamageEventTarget) is an enemy of (Owner of DamageEventSource)) Equal to True
    • Actions
      • Set FrostSwordAttacking = DamageEventSource
      • Wait 0.20 seconds
      • Unit - Remove FrostSwordAbility[FrostSwordCount] from FrostSwordAttacking
      • Set FrostSwordCount = (Level of Frostmourne for FrostSwordAttacking)
      • Trigger - Turn off (This trigger)
      • Wait (14.00 - (2.00 x (Real((Level of Frostmourne for FrostSwordAttacking))))) seconds
      • Trigger - Turn on (This trigger)
      • Unit - Add FrostSwordAbility[FrostSwordCount] to FrostSwordAttacking
Just copy & paste the Unit Indexer trigger and the Damage Event trigger from the demo map here: http://www.hiveworkshop.com/forums/spells-569/damage-event-1-0-0-0-a-201016/
 
Level 3
Joined
Mar 28, 2010
Messages
42
It's easy to use it, it's GUI.

  • Frostmourne Attacked
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • (Level of Frostmourne for DamageEventSource) Greater than or equal to 1
      • ((Owner of DamageEventTarget) is an enemy of (Owner of DamageEventSource)) Equal to True
    • Actions
      • Set FrostSwordAttacking = DamageEventSource
      • Wait 0.20 seconds
      • Unit - Remove FrostSwordAbility[FrostSwordCount] from FrostSwordAttacking
      • Set FrostSwordCount = (Level of Frostmourne for FrostSwordAttacking)
      • Trigger - Turn off (This trigger)
      • Wait (14.00 - (2.00 x (Real((Level of Frostmourne for FrostSwordAttacking))))) seconds
      • Trigger - Turn on (This trigger)
      • Unit - Add FrostSwordAbility[FrostSwordCount] to FrostSwordAttacking
Just copy & paste the Unit Indexer trigger and the Damage Event trigger from the demo map here: http://www.hiveworkshop.com/forums/spells-569/damage-event-1-0-0-0-a-201016/

ermmm ~i try it now~thx for help><

it is work!!!
thx Bribe...love u so much><''''
muacks~~~
thanks you><

erm...i use this code on another skill too...when attacking a unit...war3 will auto closed--...what happen on it???><
 
Last edited by a moderator:

Bannar

Code Reviewer
Level 26
Joined
Mar 19, 2008
Messages
3,140
War3 closes because you create infinite loop (trigger that reacts on event DamageEvent deals other damage).
Use simple action what Bribe has shwon to prevent that issue from happening.

Do like written above, change nothing, and yes 'Turn on the DamageEvent' (DamageEvent is the trigger) - meaby Bribe did small mistake writing additional word 'Trigger'.
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,448
I made no mistake there is a trigger variable called DamageEventTrigger ;)

@nightwalkerg yes on the second trigger you made that causes the game to crash, you are probably doing a "Unit - Damage Target" thing from that trigger. Just enable/disable the trigger (like I showed you) so that it doesn't detect that extra damage and cause an infinite loop.
 
Level 3
Joined
Mar 28, 2010
Messages
42
War3 closes because you create infinite loop (trigger that reacts on event DamageEvent deals other damage).
Use simple action what Bribe has shwon to prevent that issue from happening.

Do like written above, change nothing, and yes 'Turn on the DamageEvent' (DamageEvent is the trigger) - meaby Bribe did small mistake writing additional word 'Trigger'.

  • Frostmourne Attacked
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • (Level of Frostmourne for DamageEventSource) Greater than or equal to 1
      • ((Owner of DamageEventTarget) is an enemy of (Owner of DamageEventSource)) Equal to True
    • Actions
      • Trigger - Turn Off DamageEventTrigger
      • Set FrostSwordAttacking = DamageEventSource
      • Wait 0.20 seconds
      • Unit - Remove FrostSwordAbility[FrostSwordCount] from FrostSwordAttacking
      • Set FrostSwordCount = (Level of Frostmourne for FrostSwordAttacking)
      • Trigger - Turn off (This trigger)
      • Wait (14.00 - (2.00 x (Real((Level of Frostmourne for FrostSwordAttacking))))) seconds
      • Trigger - Turn on (This trigger)
      • Unit - Add FrostSwordAbility[FrostSwordCount] to FrostSwordAttacking
      • Trigger - Turn On DamageEventTrigger
like this for each trigger i wan to add this code???
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,448
@nightwalkerg:

I made no mistake there is a trigger variable called DamageEventTrigger ;)

@nightwalkerg yes on the second trigger you made that causes the game to crash, you are probably doing a "Unit - Damage Target" thing from that trigger. Just enable/disable the trigger (like I showed you) so that it doesn't detect that extra damage and cause an infinite loop.

Don't change the first trigger, it's the second trigger where you have the problem. Please post the trigger here so I can show you exactly what I meant.
 
Level 3
Joined
Mar 28, 2010
Messages
42
  • StrikeBlade
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Level of StrikeBlade for (Attacking unit)) Greater than or equal to 1
      • ((Owner of (Attacked unit)) is an enemy of (Owner of (Attacking unit))) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Attacked unit) is A structure) Equal to True
        • Then - Actions
        • Else - Actions
          • Unit - Cause (Attacking unit) to damage (Attacked unit), dealing ((Max life of (Attacked unit)) x ((Real((Level of StrikeBlade for (Attacking unit)))) x 0.01)) damage of attack type Spells and damage type Normal
          • Special Effect - Create a special effect attached to the chest of (Attacked unit) using Objects\Spawnmodels\Critters\Albatross\CritterBloodAlbatross.mdl
  • SavageStrike
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Level of SavageStrike for (Attacking unit)) Greater than or equal to 1
      • ((Owner of (Attacked unit)) is an enemy of (Owner of (Attacking unit))) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Attacked unit) is A structure) Equal to True
        • Then - Actions
        • Else - Actions
          • Unit - Cause (Attacking unit) to damage (Attacked unit), dealing ((Real((Strength of (Attacking unit) (Include bonuses)))) x ((Real((Level of SavageStrike for (Attacking unit)))) x 0.10)) damage of attack type Normal and damage type Normal
Except frostmourne's trigger, i wanna use on this two trigger and more....
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,448
You'd want to change those as follows:

  • StrikeBlade
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • (Level of StrikeBlade for DamageEventSource) Greater than or equal to 1
      • ((Owner of DamageEventTarget) is an enemy of (Owner of DamageEventSource)) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (DamageEventTarget is A structure) Equal to True
        • Then - Actions
        • Else - Actions
          • Trigger - Turn Off DamageEventTrigger
          • Unit - Cause DamageEventSource to damage DamageEventTarget, dealing ((Max life of DamageEventTarget) x ((Real((Level of StrikeBlade for DamageEventSource))) x 0.01)) damage of attack type Spells and damage type Normal
          • Trigger - Turn On DamageEventTrigger
          • Special Effect - Create a special effect attached to the chest of DamageEventTarget using Objects\Spawnmodels\Critters\Albatross\CritterBloodAlbatross.mdl
          • Special Effect - Destroy (Last created special effect)
  • SavageStrike
    • Events
      • Game - DamageEvent becomes Equal to 1.00
    • Conditions
      • (Level of SavageStrike for DamageEventSource) Greater than or equal to 1
      • ((Owner of DamageEventTarget) is an enemy of (Owner of DamageEventSource)) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (DamageEventTarget is A structure) Equal to True
        • Then - Actions
        • Else - Actions
          • Trigger - Turn Off DamageEventTrigger
          • Unit - Cause DamageEventSource to damage DamageEventTarget, dealing ((Real((Strength of DamageEventSource (Include bonuses)))) x ((Real((Level of SavageStrike for DamageEventSource))) x 0.10)) damage of attack type Normal and damage type Normal
          • Trigger - Turn On DamageEventTrigger
 
Status
Not open for further replies.
Top