• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] A Trigger Revive Problem

Status
Not open for further replies.
Level 37
Joined
Aug 14, 2006
Messages
7,601
Hello there.

I have little problem with my hero revive trigger. The problem is that when I have an item that resurrects the carrier, but the item has a cooldown nothing will happen. I can't put there "run game over"(because the trigger should check if the dying hero has other items...), and if I put there run this trigger again the same will happen and it's endless loop. So how I can fix this problem?

Rep will be given, thanks.


  • Fradz Dies
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Dying unit) Equal to AAAFradz
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Dying unit) has an item of type Wings Of An Angel) Equal to True
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Resource__LUCK Greater than 9
            • Then - Actions
              • Set Integer = (90 + (Resource__LUCK - 9))
            • Else - Actions
              • Set Integer = (Resource__LUCK x 10)
              • Set Random = (Random integer number between 1 and 100)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Random Less than or equal to Integer
                • Then - Actions
                  • Wait 3.00 seconds
                  • Hero - Instantly revive (Dying unit) at (Position of (Dying unit)), Show revival graphics
                  • Unit - Set life of (Dying unit) to 100.00%
                  • Unit - Set mana of (Dying unit) to 100.00%
                • Else - Actions (HERE IS THE PROBLEM!!!)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Dying unit) has an item of type Angel's Prayer) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Remaining time for Revive_Timer[1]) Greater than or equal to 1.00
                • Then - Actions (HERE IS THE PROBLEM!!!)
                • Else - Actions
                  • Wait 3.00 seconds
                  • Hero - Instantly revive (Dying unit) at (Position of (Dying unit)), Show revival graphics
                  • Unit - Set life of (Dying unit) to 100.00%
                  • Unit - Set mana of (Dying unit) to 100.00%
                  • Countdown Timer - Start Revive_Timer[1] as a One-shot timer that will expire in 300.00 seconds
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Dying unit) has an item of type Angel's Gift) Equal to True
                • Then - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Remaining time for Revive_Timer[2]) Greater than or equal to 1.00
                    • Then - Actions (HERE IS THE PROBLEM!!!)
                    • Else - Actions
                      • Wait 3.00 seconds
                      • Hero - Instantly revive (Dying unit) at (Position of (Dying unit)), Show revival graphics
                      • Unit - Set life of (Dying unit) to 100.00%
                      • Unit - Set mana of (Dying unit) to 100.00%
                      • Countdown Timer - Start Revive_Timer[2] as a One-shot timer that will expire in 300.00 seconds
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • ((Dying unit) has an item of type Belt Of Sunrise) Equal to True
                    • Then - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Remaining time for Revive_Timer[3]) Greater than or equal to 1.00
                        • Then - Actions (HERE IS THE PROBLEM!!!)
                        • Else - Actions
                          • Wait 3.00 seconds
                          • Hero - Instantly revive (Dying unit) at (Position of (Dying unit)), Show revival graphics
                          • Unit - Set life of (Dying unit) to 100.00%
                          • Unit - Set mana of (Dying unit) to 100.00%
                          • Countdown Timer - Start Revive_Timer[3] as a One-shot timer that will expire in 300.00 seconds
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • ((Dying unit) has an item of type Resurrection Phial) Equal to True
                        • Then - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Charges remaining in (Item carried by (Dying unit) of type Resurrection Phial)) Less than or equal to 1
                            • Then - Actions
                              • Item - Remove (Item carried by (Dying unit) of type Resurrection Phial)
                              • Wait 3.00 seconds
                              • Hero - Instantly revive (Dying unit) at (Position of (Dying unit)), Show revival graphics
                              • Unit - Set life of (Dying unit) to 50.00%
                              • Unit - Set mana of (Dying unit) to 50.00%
                            • Else - Actions
                              • Item - Set charges remaining in (Item carried by (Dying unit) of type Resurrection Phial) to ((Charges remaining in (Item carried by (Dying unit) of type Resurrection Phial)) - 1)
                              • Wait 3.00 seconds
                              • Hero - Instantly revive (Dying unit) at (Position of (Dying unit)), Show revival graphics
                              • Unit - Set life of (Dying unit) to 50.00%
                              • Unit - Set mana of (Dying unit) to 50.00%
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • ((Dying unit) has an item of type Strong Resurrection Phial) Equal to True
                            • Then - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Charges remaining in (Item carried by (Dying unit) of type Strong Resurrection Phial)) Less than or equal to 1
                                • Then - Actions
                                  • Item - Remove (Item carried by (Dying unit) of type Strong Resurrection Phial)
                                  • Wait 3.00 seconds
                                  • Hero - Instantly revive (Dying unit) at (Position of (Dying unit)), Show revival graphics
                                  • Unit - Set life of (Dying unit) to 100.00%
                                  • Unit - Set mana of (Dying unit) to 100.00%
                                • Else - Actions
                                  • Item - Set charges remaining in (Item carried by (Dying unit) of type Strong Resurrection Phial) to ((Charges remaining in (Item carried by (Dying unit) of type Strong Resurrection Phial)) - 1)
                                  • Wait 3.00 seconds
                                  • Hero - Instantly revive (Dying unit) at (Position of (Dying unit)), Show revival graphics
                                  • Unit - Set life of (Dying unit) to 100.00%
                                  • Unit - Set mana of (Dying unit) to 100.00%
                            • Else - Actions
 
Last edited:
Level 2
Joined
Mar 30, 2009
Messages
30
(Charges remaining in (Item carried by (Dying unit) of type Resurrection Phial)) Less than or equal to 1

Should be equal to 0 unless you want to remove item when it has 1 charge remaining

What is the problem actually ?

If you want to end game when hero dies without any item to resurrect him you just chain if/then/else and at end of chain
put end game

It means

IF
-cond
THEN
-ACTION
ELSE
-If/then/else
IF
-cond
THEN
-action
ELSE
-If/Then/Else
IF

Et cetera

And you should use different conditions because now you are using ELSE slot for true condition actions when for chaining you
must use THEN slot

The Sorrow
 
This is what your conditions look like..

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • Then - Actions
    • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • Then - Actions
        • Else - Actions
Make them like this.

  • Untitled Trigger 001
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • Then - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
        • Then - Actions
        • Else - Actions
 
Status
Not open for further replies.
Top