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

[General] Can game break from using bulding model as a Hero unit?

Status
Not open for further replies.
Level 5
Joined
Dec 25, 2018
Messages
110
I have stationary Hero that has Murloc Hut model, sometimes when players kill it game just crashes, could model be an issue or should I look somewhere else?
 
Level 39
Joined
Feb 27, 2007
Messages
5,013
Unlikely to be because you're using that model. To test, change the model and then kill a whole bunch of that unit to see if it crashes. If no then it might actually be a model problem.

Are there any triggers specifically related to the Hut hero?
 
Level 5
Joined
Dec 25, 2018
Messages
110
Unlikely to be because you're using that model. To test, change the model and then kill a whole bunch of that unit to see if it crashes. If no then it might actually be a model problem.

Are there any triggers specifically related to the Hut hero?
There are 2 spell related triggers, but game crashes only when it dies and it doesn't always trigger (maybe once in 12 games).
 
Level 5
Joined
Dec 25, 2018
Messages
110
  • Order Summon
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units of type Monster Nest) and do (Actions)
        • Loop - Actions
          • Unit - Order (Picked unit) to Special Rexxar - Battle Roar
  • Monster nest
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Summon Monsters
    • Actions
      • Custom script: local unit udg_LocalUnit
      • Set LocalUnit = (Triggering unit)
      • Set LocalPoint3 = (Position of LocalUnit)
      • Unit - Remove Spell Immunity (Neutral Hostile) from LocalUnit
      • For each (Integer B) from 1 to 8, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Mur'gul summon for (Owner of LocalUnit) at LocalPoint3 facing Default building facing degrees
          • Special Effect - Create a special effect attached to the origin of (Last created unit) using Abilities\Spells\Other\CrushingWave\CrushingWaveDamage.mdl
          • Special Effect - Destroy (Last created special effect)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Last created unit) belongs to an enemy of Player 1 (Red)) Equal to True
            • Then - Actions
              • Unit - Order (Last created unit) to Attack-Move To WaveLocation[7]
            • Else - Actions
              • Unit - Order (Last created unit) to Attack-Move To WaveLocation[17]
          • Wait 0.10 seconds
      • For each (Integer B) from 1 to 2, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Blood-Gill summon for (Owner of LocalUnit) at LocalPoint3 facing Default building facing degrees
          • Special Effect - Create a special effect attached to the origin of (Last created unit) using Abilities\Spells\Other\CrushingWave\CrushingWaveDamage.mdl
          • Special Effect - Destroy (Last created special effect)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Last created unit) belongs to an enemy of Player 1 (Red)) Equal to True
            • Then - Actions
              • Unit - Order (Last created unit) to Attack-Move To WaveLocation[7]
            • Else - Actions
              • Unit - Order (Last created unit) to Attack-Move To WaveLocation[17]
          • Wait 0.10 seconds
      • Custom script: set udg_LocalUnit = null
      • Custom script: call RemoveLocation(udg_LocalPoint3)
This one might be the cause?:
  • Wave
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Monster Nest Ult
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Mode_Teams Equal to 1
        • Then - Actions
          • For each (Integer NestWaves) from 1 to 8, do (Actions)
            • Loop - Actions
              • Set LocalUnit = (Triggering unit)
              • Set LocalPoint3 = (Position of LocalUnit)
              • Unit - Add Monster Nest wave to LocalUnit
              • Unit - Set level of Monster Nest wave for LocalUnit to RoundNumber
              • Set MonsterNestUltGroup = (Units within 600.00 of LocalPoint3 matching ((((Matching unit) belongs to an enemy of (Owner of LocalUnit)) Equal to True) and (((Matching unit) is A Hero) Equal to True)))
              • Set MonsterNestUltGroup_Random = (Random 1 units from MonsterNestUltGroup)
              • Unit Group - Pick every unit in MonsterNestUltGroup_Random and do (Actions)
                • Loop - Actions
                  • Set LocalPoint2 = (Position of (Picked unit))
                  • Unit - Order LocalUnit to Undead Dreadlord - Carrion Swarm LocalPoint2
                  • Custom script: call RemoveLocation(udg_LocalPoint2)
              • Unit - Remove Monster Nest wave from LocalUnit
              • Custom script: call RemoveLocation(udg_LocalPoint3)
              • Custom script: call DestroyGroup(udg_MonsterNestUltGroup)
              • Custom script: call DestroyGroup(udg_MonsterNestUltGroup_Random)
              • Wait 0.50 seconds
        • Else - Actions
          • For each (Integer NestWaves) from 1 to 16, do (Actions)
            • Loop - Actions
              • Set LocalUnit = (Triggering unit)
              • Set LocalPoint3 = (Position of LocalUnit)
              • Unit - Add Monster Nest wave to LocalUnit
              • Unit - Set level of Monster Nest wave for LocalUnit to RoundNumber
              • Set MonsterNestUltGroup = (Units within 600.00 of LocalPoint3 matching ((((Matching unit) belongs to an enemy of (Owner of LocalUnit)) Equal to True) and (((Matching unit) is A Hero) Equal to True)))
              • Set MonsterNestUltGroup_Random = (Random 1 units from MonsterNestUltGroup)
              • Unit Group - Pick every unit in MonsterNestUltGroup_Random and do (Actions)
                • Loop - Actions
                  • Set LocalPoint2 = (Position of (Picked unit))
                  • Unit - Order LocalUnit to Undead Dreadlord - Carrion Swarm LocalPoint2
                  • Custom script: call RemoveLocation(udg_LocalPoint2)
              • Unit - Remove Monster Nest wave from LocalUnit
              • Custom script: call RemoveLocation(udg_LocalPoint3)
              • Custom script: call DestroyGroup(udg_MonsterNestUltGroup)
              • Custom script: call DestroyGroup(udg_MonsterNestUltGroup_Random)
              • Wait 0.50 seconds
      • Unit - Remove Monster Nest Ult from LocalUnit
 
Level 39
Joined
Feb 27, 2007
Messages
5,013
  • Order summon leaks a group
  • Why does LocalUnit have to be local but LocalPoint3 doesn't? If one can get overwritten so could the other.
  • Absolutely do not ever put waits in an Integer A or Integer B loop. If you need a wait in a loop, create a new variable for just that loop and use the 'for each integer variable...' action. But in general waits in loops are bad for your map and bad programming practice.
  • Don't use "finishes casting", use "starts the effect of" unless you have a good reason not to.
  • Why add an ability, order unit to use it, then remove the ability 16 times in a row? You could just keep the ability on the unit the whole time or (better) use a dummy unit to cast it.
  • Both halves of your If-block in Wave are exactly the same code just with a different number of loop iterations. You can just set a variable = 8 or = 16 depending on the if-condition and then loop from 1 to THAT_VARIABLE to reduce the duplicate code you have there.
  • Minimum time for the Wait command is ~0.25s, you can't wait less time than that even if you type a smaller number.
I don't see anything that seems crashworthy in there, so if I had to guess it's something getting fucked up because you put waits in your loops and the A/B variables are getting changed by another trigger while one loop is already running. This could cause an error where the game tries to access/use a variable that's not set or does something else wonky that normally works fine. I have no idea what it could be because literally any trigger that uses A/B loops could be contributing.
 
Status
Not open for further replies.
Top