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

Triggered Spell causing crash

Status
Not open for further replies.
Level 12
Joined
Sep 11, 2011
Messages
1,176
hello everyone, i have a problem when casting a spell, it crashed the map.

this problem always occurred on the second time i cast this spell.

let me show you the triggers.

  • LA Loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in LA_Group and do (Actions)
        • Loop - Actions
          • Set LA_Caster = (Picked unit)
          • Set cv = (Custom value of (Picked unit))
          • Set LA_Point = (Position of (Picked unit))
          • Set LA_Duration[cv] = (LA_Duration[cv] - 0.03)
          • Game - Display to (All players) the text: (String(LA_Duration[cv]))
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units within LA_AOE[cv] of LA_Point matching (((Owner of (Matching unit)) is an enemy of (Owner of (Picked unit))) Equal to True)) and do (Actions)
            • Loop - Actions
              • Set LA_Point2 = (Position of (Picked unit))
              • Set LA_Angle[cv] = (Angle from LA_Point2 to LA_Point)
              • Set LA_Point3 = (LA_Point2 offset by 3.00 towards LA_Angle[cv] degrees)
              • Unit - Move (Picked unit) instantly to LA_Point3
              • Unit - Cause LA_Caster to damage (Picked unit), dealing (LA_Damages[cv] x 0.03) damage of attack type Spells and damage type Normal
              • Unit - Cause LA_Caster to damage LA_Caster, dealing (-1.00 x (((Life of LA_Caster) x 0.01) x 0.03)) damage of attack type Spells and damage type Normal
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • LA_NoDummy[cv] Equal to True
                • Then - Actions
                  • Set LA_NoDummy[cv] = False
                  • Custom script: set bj_wantDestroyGroup = true
                  • Unit Group - Pick every unit in (Units within LA_AOE[cv] of LA_Point matching (((Owner of (Matching unit)) is an enemy of (Owner of LA_Caster)) Equal to True)) and do (Actions)
                    • Loop - Actions
                      • Set LA_Point2 = (Position of (Picked unit))
                      • Unit - Create 1 Dummy (1) for (Owner of LA_Caster) at LA_Point facing Default building facing degrees
                      • Unit Group - Add (Last created unit) to LA_DummyGroup
                      • Unit - Add Dummy Siphon to (Last created unit)
                      • Unit - Set level of Dummy Siphon for (Last created unit) to (Level of Liquid Absoprtion for LA_Caster)
                      • Unit - Order (Last created unit) to Human Blood Mage - Siphon Mana (Picked unit)
                      • Unit - Add a LA_Duration[cv] second Generic expiration timer to (Last created unit)
                • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • LA_Duration[cv] Less than or equal to 0.00
            • Then - Actions
              • Unit Group - Remove (Picked unit) from LA_Group
              • Set LA_Count = (LA_Count - 1)
              • Custom script: call RemoveLocation(udg_LA_Point)
              • Custom script: call RemoveLocation(udg_LA_Point2)
              • Custom script: call RemoveLocation(udg_LA_Point3)
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • LA_Count Equal to 0
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
anyone know what can cause crash from the trigger i have ?

EDIT : now it's randomly crashing (not only for the second time).
 
Last edited:
Level 12
Joined
Sep 11, 2011
Messages
1,176
I could crash if leaving map bounds.

Also, you should never have a "pick every unit" inside another "pick every unit".

fixed, and it seems that the crash didn't occur anymore. but the siphon is now only cast to one unit (so the lightning only goes to one unit).

i will try to reproduce the crash.

EDIT : don't answer to my thread ever again ! just kidding :p
most helpful person ever :p

I have created many spells with "pick every unit" inside another "pick every unit", (Collision missle AOE damage), and it never crashed or not working. So I dont think that's the problem.

maybe the difference from mine and yours is that mine use 3 times picking (unit pick every unit, then pick every unit, then pick every unit again).
 

Kusanagi Kuro

Hosted Project: SC
Level 10
Joined
Mar 11, 2012
Messages
708
^ Haha. No. I used Unit Indexer to handle that. Like this:
  • Unit Group - Pick every unit in DummyGroup and do Actions
    • Set CV = (Custom value of Picked Unit)
    • Set Dummy[CV] = (Picked Unit)
Doing that will prevent any kind of overwritten to the Picked Unit (I think so).
 
Status
Not open for further replies.
Top