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

Instant game crash (no crash report)

Status
Not open for further replies.
Level 6
Joined
Jul 25, 2019
Messages
93
Hey dudes, so, im making a couple heroes for a map, and, i have this 1 hero who when his hp is 5% of lees, detonates himself for dmg based on his str + int, as you can see in the trigger. Now, when this happens, the game crashes. But not just crashes, it eliminates itself from existence. No crash report, no crash file, not even the window with CDkey thing, just vanish. I tried to replace the AOE dmg trigger with an automated message and it didnt crash so... does anyone have any clue why this 1 single trigger makes warcraft3 game literally purge itself from Process List. I dont really need help with this one im just curious about why it happens

  • EverlastingFireOnDeath
    • Events
      • Unit - Takes damage
    • Conditions
      • (Triggering unit) Equal to Hero_CorruptedLord
      • (Life of Hero_CorruptedLord) Less than or equal to ((Max life of Hero_CorruptedLord) x 0.05)
    • Actions
      • Set VariableSet Strength = (Strength of Hero_CorruptedLord (Include bonuses))
      • Set VariableSet Inteligence = (Intelligence of Hero_CorruptedLord (Include bonuses))
      • Set VariableSet RealAttribute = (((Real(Inteligence)) x 0.50) + (Real(Strength)))
      • Unit - Cause Hero_CorruptedLord to damage circular area after 0.00 seconds of radius 500.00 at (Position of Hero_CorruptedLord), dealing (RealAttribute x 4.00) damage of attack type Spells and damage type Fire
      • Unit - Kill Hero_CorruptedLord
      • Trigger - Turn off (This trigger)
      • Wait 1500.00 seconds
      • Trigger - Turn on (This trigger)
 
Level 20
Joined
May 16, 2012
Messages
635
Your problem is the Damage Area. Dont use this function, use a unit group - pick every unit in range and filter units you dont want to be damaged. Your game is crashing because of a infinite loop caused be the damage area call. Damage Area, damages all units in range, incluing your own hero, and since this is inside a Unit takes damage trigger, its runnig in a loop.
 
Level 6
Joined
Jul 25, 2019
Messages
93
Your problem is the Damage Area. Dont use this function, use a unit group - pick every unit in range and filter units you dont want to be damaged. Your game is crashing because of a infinite loop caused be the damage area call. Damage Area, damages all units in range, incluing your own hero, and since this is inside a Unit takes damage trigger, its runnig in a loop.

yeah but there is Turn off this trigger at the end so why doesnt it turn off the trigger and thus prevent a loop?
 
Level 20
Joined
May 16, 2012
Messages
635
yeah but there is Turn off this trigger at the end so why doesnt it turn off the trigger and thus prevent a loop?

Because the damage occurs before the trigger gets disabled. When it damages your unit, it call itself again, and then damage the area and then call itself again, see the process here? Try putting the turn off this trigger before the damage area call and see what happens. I could be wrong tough, i just gave i fast look.
 
Level 12
Joined
Feb 5, 2018
Messages
521
(Life of Hero_CorruptedLord) Less than or equal to ((Max life of Hero_CorruptedLord) x 0.05)

Also in this you can just simply use Percent life of triggering unit.

Here is one example trigger how to use Unit Groups and how to damage units in them.

  • Melee Initialization
    • Events
    • Conditions
    • Actions
      • -------- This is just a quick example of how you could do this --------
      • -------- --->You should also store the triggering unit<--- Unit Variable --------
      • Set VariableSet YourCaster = (Triggering unit)
      • -------- --->Storing the owner<--- Player Variable --------
      • Set VariableSet YourPlayer = (Owner of YourCaster)
      • -------- ------------ --------
      • -------- -->Storing the Location<-- --------
      • Set VariableSet Temp_Location = (Position of YourCaster)
      • -------- -------- --------
      • -------- --->Set up damage here<---- --------
      • Set VariableSet Damage1 = (Strength of YourCaster (Include bonuses))
      • Set VariableSet Damage2 = ((Intelligence of YourCaster (Exclude bonuses)) x 3)
      • -------- -------- --------
      • -------- --->Setting up Unit Group<--- Unit Group Variable --------
      • Set VariableSet Unit_Group = (Units within 500.00 of Temp_Location matching ((((Matching unit) belongs to an enemy of (Owner of (Triggering unit)).) Equal to True) and (((Matching unit) is alive) Equal to True)).)
      • -------- Above I used an _AND_ condition with two different _BOOLEANS_ --------
      • -------- For UnitGroup I used: Units in range matching condition --------
      • -------- -------- --------
      • Unit Group - Pick every unit in Unit_Group and do (Actions)
        • Loop - Actions
          • Set VariableSet TempTarget = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (TempTarget is Mechanical) Equal to False
              • (TempTarget is A structure) Equal to False
              • (TempTarget is Magic Immune) Equal to False
            • Then - Actions
              • Unit - Cause (Triggering unit) to damage TempTarget, dealing 500.00 damage of attack type Spells and damage type Magic
            • Else - Actions
      • -------- ---REMOVE LEAKS--- --------
      • Custom script: call RemoveLocation (udg_Temp_Location)
      • Custom script: call DestroyGroup (udg_Unit_Group)
If there is something wrong with this I will edit it, can you check this out real quick @chopinski
 
Level 20
Joined
May 16, 2012
Messages
635
Also in this you can just simply use Percent life of triggering unit.

Here is one example trigger how to use Unit Groups and how to damage units in them.

  • Melee Initialization
    • Events
    • Conditions
    • Actions
      • -------- This is just a quick example of how you could do this --------
      • -------- --->You should also store the triggering unit<--- Unit Variable --------
      • Set VariableSet YourCaster = (Triggering unit)
      • -------- --->Storing the owner<--- Player Variable --------
      • Set VariableSet YourPlayer = (Owner of YourCaster)
      • -------- ------------ --------
      • -------- -->Storing the Location<-- --------
      • Set VariableSet Temp_Location = (Position of YourCaster)
      • -------- -------- --------
      • -------- --->Set up damage here<---- --------
      • Set VariableSet Damage1 = (Strength of YourCaster (Include bonuses))
      • Set VariableSet Damage2 = ((Intelligence of YourCaster (Exclude bonuses)) x 3)
      • -------- -------- --------
      • -------- --->Setting up Unit Group<--- Unit Group Variable --------
      • Set VariableSet Unit_Group = (Units within 500.00 of Temp_Location matching ((((Matching unit) belongs to an enemy of (Owner of (Triggering unit)).) Equal to True) and (((Matching unit) is alive) Equal to True)).)
      • -------- Above I used an _AND_ condition with two different _BOOLEANS_ --------
      • -------- For UnitGroup I used: Units in range matching condition --------
      • -------- -------- --------
      • Unit Group - Pick every unit in Unit_Group and do (Actions)
        • Loop - Actions
          • Set VariableSet TempTarget = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (TempTarget is Mechanical) Equal to False
              • (TempTarget is A structure) Equal to False
              • (TempTarget is Magic Immune) Equal to False
            • Then - Actions
              • Unit - Cause (Triggering unit) to damage TempTarget, dealing 500.00 damage of attack type Spells and damage type Magic
            • Else - Actions
      • -------- ---REMOVE LEAKS--- --------
      • Custom script: call RemoveLocation (udg_Temp_Location)
      • Custom script: call DestroyGroup (udg_Unit_Group)
If there is something wrong with this I will edit it, can you check this out real quick @chopinski

Looking good.
 
Level 6
Joined
Jul 25, 2019
Messages
93
Looking good.

i ended up going with this because i actually do want this thing to damage all units allies including. Makes u gotta play around this walking nuke carefully and watch his hp. But yeah i just tought the hilarious part was the game crashing in a way where it literally just purged itself from existence

  • EverlastingFireOnDeath
    • Events
      • Unit - Is attacked
    • Conditions
      • (Triggering unit) Equal to Hero_CorruptedLord
      • (Life of Hero_CorruptedLord) Less than ((Max life of Hero_CorruptedLord) x 0.06)
    • Actions
      • Set VariableSet Strength = (Strength of Hero_CorruptedLord (Include bonuses))
      • Set VariableSet Inteligence = (Intelligence of Hero_CorruptedLord (Include bonuses))
      • Set VariableSet RealAttribute = ((Real(Strength)) + ((Real(Inteligence)) x 0.50))
      • Unit - Kill Hero_CorruptedLord
      • Unit - Create 1 Dummy ST Spell for Player 1 (Red) at (Position of Hero_CorruptedLord) facing Default building facing degrees
      • Unit - Cause (Last created unit) to damage circular area after 0.00 seconds of radius 500.00 at (Position of (Last created unit)), dealing (RealAttribute x 4.00) damage of attack type Spells and damage type Normal
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Trigger - Turn off (This trigger)
      • Wait 1500.00 seconds
      • Trigger - Turn on (This trigger)
 
Level 6
Joined
Jul 25, 2019
Messages
93
Also in this you can just simply use Percent life of triggering unit.

Here is one example trigger how to use Unit Groups and how to damage units in them.

  • Melee Initialization
    • Events
    • Conditions
    • Actions
      • -------- This is just a quick example of how you could do this --------
      • -------- --->You should also store the triggering unit<--- Unit Variable --------
      • Set VariableSet YourCaster = (Triggering unit)
      • -------- --->Storing the owner<--- Player Variable --------
      • Set VariableSet YourPlayer = (Owner of YourCaster)
      • -------- ------------ --------
      • -------- -->Storing the Location<-- --------
      • Set VariableSet Temp_Location = (Position of YourCaster)
      • -------- -------- --------
      • -------- --->Set up damage here<---- --------
      • Set VariableSet Damage1 = (Strength of YourCaster (Include bonuses))
      • Set VariableSet Damage2 = ((Intelligence of YourCaster (Exclude bonuses)) x 3)
      • -------- -------- --------
      • -------- --->Setting up Unit Group<--- Unit Group Variable --------
      • Set VariableSet Unit_Group = (Units within 500.00 of Temp_Location matching ((((Matching unit) belongs to an enemy of (Owner of (Triggering unit)).) Equal to True) and (((Matching unit) is alive) Equal to True)).)
      • -------- Above I used an _AND_ condition with two different _BOOLEANS_ --------
      • -------- For UnitGroup I used: Units in range matching condition --------
      • -------- -------- --------
      • Unit Group - Pick every unit in Unit_Group and do (Actions)
        • Loop - Actions
          • Set VariableSet TempTarget = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (TempTarget is Mechanical) Equal to False
              • (TempTarget is A structure) Equal to False
              • (TempTarget is Magic Immune) Equal to False
            • Then - Actions
              • Unit - Cause (Triggering unit) to damage TempTarget, dealing 500.00 damage of attack type Spells and damage type Magic
            • Else - Actions
      • -------- ---REMOVE LEAKS--- --------
      • Custom script: call RemoveLocation (udg_Temp_Location)
      • Custom script: call DestroyGroup (udg_Unit_Group)
If there is something wrong with this I will edit it, can you check this out real quick @chopinski


but thanks for this, i will surely use this as a know how on many other triggers
 
Level 6
Joined
Jul 25, 2019
Messages
93
Also in this you can just simply use Percent life of triggering unit.

Here is one example trigger how to use Unit Groups and how to damage units in them.

  • Melee Initialization
    • Events
    • Conditions
    • Actions
      • -------- This is just a quick example of how you could do this --------
      • -------- --->You should also store the triggering unit<--- Unit Variable --------
      • Set VariableSet YourCaster = (Triggering unit)
      • -------- --->Storing the owner<--- Player Variable --------
      • Set VariableSet YourPlayer = (Owner of YourCaster)
      • -------- ------------ --------
      • -------- -->Storing the Location<-- --------
      • Set VariableSet Temp_Location = (Position of YourCaster)
      • -------- -------- --------
      • -------- --->Set up damage here<---- --------
      • Set VariableSet Damage1 = (Strength of YourCaster (Include bonuses))
      • Set VariableSet Damage2 = ((Intelligence of YourCaster (Exclude bonuses)) x 3)
      • -------- -------- --------
      • -------- --->Setting up Unit Group<--- Unit Group Variable --------
      • Set VariableSet Unit_Group = (Units within 500.00 of Temp_Location matching ((((Matching unit) belongs to an enemy of (Owner of (Triggering unit)).) Equal to True) and (((Matching unit) is alive) Equal to True)).)
      • -------- Above I used an _AND_ condition with two different _BOOLEANS_ --------
      • -------- For UnitGroup I used: Units in range matching condition --------
      • -------- -------- --------
      • Unit Group - Pick every unit in Unit_Group and do (Actions)
        • Loop - Actions
          • Set VariableSet TempTarget = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (TempTarget is Mechanical) Equal to False
              • (TempTarget is A structure) Equal to False
              • (TempTarget is Magic Immune) Equal to False
            • Then - Actions
              • Unit - Cause (Triggering unit) to damage TempTarget, dealing 500.00 damage of attack type Spells and damage type Magic
            • Else - Actions
      • -------- ---REMOVE LEAKS--- --------
      • Custom script: call RemoveLocation (udg_Temp_Location)
      • Custom script: call DestroyGroup (udg_Unit_Group)
If there is something wrong with this I will edit it, can you check this out real quick @chopinski

actually i have 1 question, reading this for a diffirent spell im making, i see that you set the variable Your Player to store the owner, but you dont use that variable nowhere in this trigger, everytime you refer to a player you use "owner of Triggering Unit" so isnt it pointless? just store triggering unit as variable unit and use that no? or am i missing something?
 
Level 12
Joined
Feb 5, 2018
Messages
521
Well I guess you only need if you are creating units or doing something else that refers to a player.

Looks like I made a mistake the unit group should check the player Variable instead of owner of unit(triggering unit)

I've read some where that it is faster to store the player and use that instead of using owner of unit(triggering unit)

EDIT: Whenever you store anything into variable, use that as reference. I made this trigger for you in quick sketch, so I apologize for the small mistakes. :)
 
Last edited:
Status
Not open for further replies.
Top