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

Can this trigger crash the game?

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

Can this trigger crash the game?

  • Heavens Bless I Heal Ability
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Heaven's Bless (Heal Spell)
    • Actions
      • Trigger - Turn off (This trigger)
      • Set TempLoc = (Position of (Casting unit))
      • Set TempLoc2 = (Position of (Target unit of ability being cast))
      • Set Heavens_Bless_Unit = (Target unit of ability being cast)
      • Unit - Create 1 Ability Dummy Unit for Player 1 (Red) at TempLoc facing TempLoc2
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Unit - Order (Last created unit) to Orc Shaman - Lightning Shield Heavens_Bless_Unit
      • Special Effect - Create a special effect attached to the origin of Heavens_Bless_Unit using Abilities\Spells\Human\Resurrect\ResurrectCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect attached to the origin of Heavens_Bless_Unit using Abilities\Spells\Human\Resurrect\ResurrectTarget.mdl
      • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation(udg_TempLoc)
      • Custom script: call RemoveLocation(udg_TempLoc2)
      • For each (Integer Fire_Shield_Integer) from 1 to 10, do (Actions)
        • Loop - Actions
          • Unit - Set life of Heavens_Bless_Unit to ((Life of Heavens_Bless_Unit) + (Real(YMultiboard__WARMLIGHT)))
          • Wait 1.00 seconds
      • Set Heavens_Bless_Unit = No unit
      • Trigger - Turn on (This trigger)

  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • Heavens_Bless_Unit Equal to AAAPhodom
    • Then - Actions
      • Wait 3.00 seconds
      • Set TempLoc = (Position of AAAPhodom)
      • Hero - Instantly revive AAAPhodom at TempLoc, Show revival graphics
      • Set TempReal = (50.00 + ((Real((Level of Heaven's Bless (Heal Spell) for AAAPhodom))) x 2.50))
      • Unit - Set life of AAAPhodom to TempReal%
      • Set TempReal = ((Real((Level of Heaven's Bless (Heal Spell) for AAAPhodom))) x 5.00)
      • Unit - Set mana of AAAPhodom to TempReal%
      • Custom script: call RemoveLocation(udg_TempLoc)
      • Skip remaining actions
    • Else - Actions
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
Set TempLoc = (Position of AAAPhodom)
Hero - Instantly revive AAAPhodom at TempLoc, Show revival graphics

Dead heroes get hidden and moved to a distant edge of the map. Thus you are reviving the hero in a very obscure place (maybe not even on the play field itself). This is very well capable of causing a crash.
 
Level 37
Joined
Aug 14, 2006
Messages
7,601
Yeh, well. I know this is very badly coded, but I just don't see this crashing the game.

And what about this? Can something in here crash the game?

  • Game Over Phodom
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Dying unit) Equal to AAAPhodom
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Resource__DIFFICULTY Equal to 0
        • Then - Actions
          • Wait 3.00 seconds
          • Set TempLoc = (Position of AAAPhodom)
          • Hero - Instantly revive AAAPhodom at TempLoc, Show revival graphics
          • Unit - Set life of AAAPhodom to 100.00%
          • Unit - Set mana of AAAPhodom to 100.00%
          • Custom script: call RemoveLocation(udg_TempLoc)
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Heavens_Bless_Unit Equal to AAAPhodom
        • Then - Actions
          • Wait 3.00 seconds
          • Set TempLoc = (Position of AAAPhodom)
          • Hero - Instantly revive AAAPhodom at TempLoc, Show revival graphics
          • Set TempReal = (50.00 + ((Real((Level of Heaven's Bless (Heal Spell) for AAAPhodom))) x 2.50))
          • Unit - Set life of AAAPhodom to TempReal%
          • Set TempReal = ((Real((Level of Heaven's Bless (Heal Spell) for AAAPhodom))) x 5.00)
          • Unit - Set mana of AAAPhodom to TempReal%
          • Custom script: call RemoveLocation(udg_TempLoc)
          • Skip remaining actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Combat King - Resurrection for AAAPhodom) Greater than or equal to 1
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Remaining time for Revive_Timer_1) Less than or equal to 0.00
            • Then - Actions
              • Countdown Timer - Start Revive_Timer_1 as a One-shot timer that will expire in (333.00 - ((Real((Level of Combat King - Resurrection for AAAPhodom))) x 30.00)) seconds
              • Wait 3.00 seconds
              • Set TempLoc = (Position of AAAPhodom)
              • Hero - Instantly revive AAAPhodom at TempLoc, Show revival graphics
              • Unit - Set life of AAAPhodom to 100.00%
              • Set TempReal = ((Real((Level of Combat King - Resurrection for AAAPhodom))) x 10.00)
              • Unit - Set mana of AAAPhodom to TempReal%
              • Custom script: call RemoveLocation(udg_TempLoc)
              • Skip remaining actions
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (AAAPhodom has an item of type Holy Seal) 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_4) Less than or equal to 0.00
            • Then - Actions
              • Countdown Timer - Start Revive_Timer_4 as a One-shot timer that will expire in 303.00 seconds
              • Wait 3.00 seconds
              • Set TempLoc = (Position of AAAPhodom)
              • Hero - Instantly revive AAAPhodom at TempLoc, Show revival graphics
              • Unit - Set life of AAAPhodom to 100.00%
              • Unit - Set mana of AAAPhodom to 100.00%
              • Custom script: call RemoveLocation(udg_TempLoc)
              • Skip remaining actions
            • Else - Actions
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • AngelsPrayer_Integer Greater than 0
        • Then - Actions
          • Set TempGroup = (Units owned by Player 1 (Red))
          • Unit Group - Pick every unit in TempGroup and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) has an item of type Angel's Prayer) Equal to True
                • Then - Actions
                  • Set AngelsPrayer_Integer = (AngelsPrayer_Integer - 1)
                  • Wait 3.00 seconds
                  • Set TempLoc = (Position of AAAPhodom)
                  • Hero - Instantly revive AAAPhodom at TempLoc, Show revival graphics
                  • Unit - Set life of AAAPhodom to 100.00%
                  • Unit - Set mana of AAAPhodom to 100.00%
                  • Custom script: call RemoveLocation(udg_TempLoc)
                  • Skip remaining actions
                • Else - Actions
          • Custom script: call DestroyGroup(udg_TempGroup)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • AngelsGift_Integer Greater than 0
        • Then - Actions
          • Set TempGroup = (Units owned by Player 1 (Red))
          • Unit Group - Pick every unit in TempGroup and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • ((Picked unit) has an item of type Angel's Gift) Equal to True
                • Then - Actions
                  • Set AngelsGift_Integer = (AngelsGift_Integer - 1)
                  • Wait 3.00 seconds
                  • Set TempLoc = (Position of AAAPhodom)
                  • Hero - Instantly revive AAAPhodom at TempLoc, Show revival graphics
                  • Unit - Set life of AAAPhodom to 100.00%
                  • Unit - Set mana of AAAPhodom to 100.00%
                  • Custom script: call RemoveLocation(udg_TempLoc)
                  • Skip remaining actions
                • Else - Actions
          • Custom script: call DestroyGroup(udg_TempGroup)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Resource__DIFFICULTY Less than 5
          • (Player 1 (Red) Current lumber) Greater than or equal to 1
        • Then - Actions
          • Player - Add -1 to Player 1 (Red) Current lumber
          • Wait 3.00 seconds
          • Set TempLoc = (Position of AAAPhodom)
          • Hero - Instantly revive AAAPhodom at TempLoc, Show revival graphics
          • Unit - Set life of AAAPhodom to 100.00%
          • Unit - Set mana of AAAPhodom to 100.00%
          • Custom script: call RemoveLocation(udg_TempLoc)
          • Skip remaining actions
        • Else - Actions
      • Unit - Pause all units
      • Animation - Change AAAPhodom's animation speed to 20.00% of its original speed
      • Camera - Lock camera target for Player 1 (Red) to AAAPhodom, offset by (0.00, 0.00) using Default rotation
      • Camera - Set Player 1 (Red)'s camera Distance to target to ((Distance to target of the current camera view) - 500.00) over 5.00 seconds
      • Cinematic - Fade out over 5.00 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • Sound - Set music volume to 90.00%
      • Wait 0.50 seconds
      • Sound - Set music volume to 80.00%
      • Wait 0.50 seconds
      • Sound - Set music volume to 70.00%
      • Wait 0.50 seconds
      • Sound - Set music volume to 60.00%
      • Wait 0.50 seconds
      • Sound - Set music volume to 50.00%
      • Wait 0.50 seconds
      • Sound - Set music volume to 40.00%
      • Wait 0.50 seconds
      • Sound - Set music volume to 30.00%
      • Wait 0.50 seconds
      • Sound - Set music volume to 20.00%
      • Wait 0.50 seconds
      • Sound - Set music volume to 10.00%
      • Wait 0.50 seconds
      • Sound - Stop music Immediately
      • Sound - Clear the music list
      • Wait 4.00 seconds
      • Cinematic - Apply a filter over 2.00 seconds using No blending on texture war3campImported\Game Over512x512.blp, starting with color (0.00%, 0.00%, 0.00%) and 0.00% transparency and ending with color (100.00%, 100.00%, 100.00%) and 100.00% transparency
      • Wait 2.00 seconds
      • Cinematic - Apply a filter over 9999.00 seconds using No blending on texture war3campImported\Game Over512x512.blp, starting with color (100.00%, 100.00%, 100.00%) and 100.00% transparency and ending with color (100.00%, 100.00%, 100.00%) and 100.00% transparency
      • Wait 5.00 seconds
      • Game - Defeat Player 1 (Red) with the message: <Empty String>
 
Same problem as I described. You could be reviving a unit off map (where dead heroes are moved to). You need to specify a position for the unit to revive that is valid.

In those triggers the location is set 3 seconds after death.
Considering how death animation itself takes about 2 seconds and dissipate animation another 3 seconds, the location must still be valid.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
Wait won't work in group loop functions.

For example here:
  • Untitled Trigger 037
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Game - Display to Player Group - Player 1 (Red) the text: Not skip
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • True Equal to True
        • Then - Actions
          • Set group = (Units owned by Player 1 (Red) matching (((Matching unit) is A structure) Equal to False))
          • Unit Group - Pick every unit in group and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • True Equal to True
                • Then - Actions
                  • Game - Display to Player Group - Player 1 (Red) the text: Enum1
                  • Wait 1.00 seconds
                  • Game - Display to Player Group - Player 1 (Red) the text: Enum2
                  • Skip remaining actions
                • Else - Actions
        • Else - Actions
      • Game - Display to Player Group - Player 1 (Red) the text: Not skip 2
*There will be no wait, it instantly displays Enum1 for each unit
*It won't display the Enum2 text
*It will loop through all units
*It won't skip remaining actions
*Not skip 2 will be displayed

Therefore in your trigger, the actions after waits in unit group loops do not take place, and Phodom will not get revived. That's what I'm thinking.
 
Status
Not open for further replies.
Top