• 🏆 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!

Perfect Trigger but Problems..

Status
Not open for further replies.
Level 5
Joined
Mar 24, 2008
Messages
98
Trigger 1
  • Exp System
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Dying unit) is A Hero) Equal to True
    • Actions
      • Set Revive_Value[(Player number of (Owner of (Dying unit)))] = 0
      • Unit Group - Add (Dying unit) to Reviving_Group
      • Trigger - Turn on Revive System <gen>
      • Set TriggeringUnits[2] = (Dying unit)
      • Set TriggeringUnits[3] = (Killing unit)
      • Set Integers[1] = (250 x (Integer((Real((Hero level of TriggeringUnits[2]))))))
      • Set Integers[2] = (100 x (Integer((Real((Hero level of TriggeringUnits[2]))))))
      • Set TriggeringPoints[2] = (Center of Revive Point Cosmos <gen>)
      • Hero - Add Integers[1] experience to TriggeringUnits[3], Show level-up graphics
      • Player - Add Integers[2] to (Owner of TriggeringUnits[3]) Current gold
      • Game - Display to (All players) for 15.00 seconds the text: ((Name of (Owner of TriggeringUnits[3])) + ( Has |cFF0000C0Delivered his Final Blow on|r + ((Name of (Owner of TriggeringUnits[2])) + (|cFF0000C0!!|r + (For + ((String(Integers[2])) + |cFF00C0C0 GOLD!!|r))))))
      • Floating Text - Create floating text that reads ((String(Integers[1])) + EXP RECEIVED!!!) above TriggeringUnits[3] with Z offset 0.00, using font size 10.00, color (85.00%, 85.00%, 0.00%), and 0.00% transparency
      • Set FloatingTexts[1] = (Last created floating text)
      • Floating Text - Change the fading age of FloatingTexts[1] to 2.50 seconds
      • Floating Text - Change the lifespan of FloatingTexts[1] to 3.00 seconds
      • Floating Text - Change FloatingTexts[1]: Disable permanence
      • Floating Text - Set the velocity of FloatingTexts[1] to 64.00 towards 90.00 degrees
      • Set TriggeringUnits[2] = No unit
      • Set TriggeringUnits[3] = No unit
      • Set Integers[1] = 0
      • Set Integers[2] = 0
Trigger 2
  • Revive System
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Reviving_Group and do (Actions)
        • Loop - Actions
          • Game - Display to (All players) the text: Trigger Action - Pi...
          • Set Revive_Value[(Player number of (Owner of (Picked unit)))] = (Revive_Value[(Player number of (Owner of (Picked unit)))] + 1)
          • Game - Display to (All players) the text: Trigger Action - Ch...
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Revive_Value[(Player number of (Owner of (Picked unit)))] Equal to ReviveTimer_Wait
            • Then - Actions
              • Game - Display to (All players) the text: Trigger Action - Re...
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) belongs to an ally of Player 1 (Red)) Equal to True
                • Then - Actions
                  • Set Temp_Point = (Center of Revive Point Cosmos <gen>)
                • Else - Actions
                  • Set Temp_Point = (Center of Revive Point Chaos <gen>)
              • Unit - Move (Picked unit) instantly to Temp_Point
              • Hero - Instantly revive (Picked unit) at Temp_Point, Show revival graphics
              • Camera - Pan camera for (Owner of (Picked unit)) to Temp_Point over 0.00 seconds
              • Custom script: call RemoveLocation( udg_Temp_Point )
              • Set Temp_Point = (Position of (Picked unit))
              • Cinematic - Ping minimap for (All allies of (Owner of (Picked unit))) at Temp_Point for 1.00 seconds, using a Simple ping of color (100.00%, 100.00%, 0.00%)
              • Custom script: call RemoveLocation( udg_Temp_Point )
              • Unit Group - Remove (Picked unit) from Reviving_Group
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in Reviving_Group) Equal to 0
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                  • Game - Display to (All players) the text: Trigger Action - Tu...
                • Else - Actions
            • Else - Actions
      • Custom script: call DestroyGroup( GetLastCreatedGroup() )
      • Game - Display to (All players) the text: Trigger Action - Gr...
This is the Trigger.. I know this one's a flawless Revive System..
Yet I dunno why the Supposed to be revived heroes in my map doesnt revive.. I suppose the Map is the problem.. Not the Trigger..
But I dunno if I am right or wrong..
Anyone please help?

EDIT: I forgot to add the first trigger that activates the second trigger..
My bad XD
 
Last edited:
Level 7
Joined
Nov 4, 2006
Messages
153

  • Custom script: call RemoveLocation( udg_Temp_Point )
  • Set Temp_Point = (Position of (Picked unit))
What is the point of this, you recreate the point at the same location.

and at the very end:
  • Custom script: call DestroyGroup( GetLastCreatedGroup() )
You never create a group in this trigger.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
Debug your trigger to find what is wrong. Programmers do it all the time.

Basically add code that you know works to the trigger and see where it does not work. Then you will know what part of the trigger is broken for you to work on.

I say the problem is your globals do not contain the right values needed to revive the heroes if the rest of the code is "flawless" as you boast.
 
Level 1
Joined
Apr 19, 2010
Messages
4
  • Init
    • Events
      • Map Initialization
    • Conditions
    • Actions
      • locCosmos = (Center of Revive Point Cosmos <gen>)
      • locChaos = (Center of Revive Point Chaos <gen>)
  • A Revive Trigger
    • Events
      • Unit - A Unit Dies
    • Conditions
      • Boolean - (Triggering Unit) is a Hero == True
    • Actions
      • Game - Display to (All players) the text: Trigger Action - Pi...
      • Game - Display to (All players) the text: Trigger Action - Ch...
      • Wait - ReviveTimer_Wait seconds
      • Set xl = locCosmos
      • Set xu = (Triggering Unit)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Player Number of (Owner of xu)) > 6
          • Comment - Edit according to the size of red's team, assuming players are not mixed
        • Then - Actions
          • Set xl = locChaos
      • Game - Display to (All players) the text: Trigger Action - Re...
      • Unit - Move xu instantly to xl
      • Hero - Instantly revive xu at xl, Show revival graphics
      • Camera - Pan camera for (Owner of xu) to xl over 0.00 seconds
      • Cinematic - Ping minimap for (All allies of (Owner of xu)) at xl for 1.00 seconds, using a Simple ping of color (100.00%, 100.00%, 0.00%)
      • Comment - player group may leak, setup two forces at init
      • Game - Display to (All players) the text: Trigger Action - Gr...
 

Bribe

Code Moderator
Level 50
Joined
Sep 26, 2009
Messages
9,464
Dude, the hero isn't being revived because of a weird bug that slates that the dying hero MUST be revived in the same trigger it died in. You can't have it die in one trigger and then have a hero - revive instantly in another trigger. I DON'T KNOW WHY. I think that's one of the stupidest flaws in the code, even stupider than the one-second delays it takes to register a selection event.
 
Status
Not open for further replies.
Top