• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] A Trigger Revive Problem

Status
Not open for further replies.
Level 37
Joined
Aug 14, 2006
Messages
7,602
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