Trigger crashes game

kingkwong92

Well-Known Member
Reaction score
25
Hi hi
I needed more room for spells so I turned my move to trigger an ability since M-click move is different from the mouse right-click move. I made one of my spell which originally triggered via an point ability not trigger when I click the move button or hotkey (I changed the position and hotkey using the CommandFunc.txt file).
A few triggers and my map just crashes. The base order ID for the M-click move is (851986) but I just checked it with issued order = move. It works but then crashes my game ans I have no idea why.
Please help.

Ive already used patrol and hold for other spells too and they work fine so it's something specific to the move order.


Trigger:
  • Boost Start
    • Events
    • Unit - A unit Is issued an order targeting a point
    • Conditions
    • (Issued order) Equal to (Order(move))
    • ((Triggering unit) is A Hero) Equal to True
    • Actions
    • Set Player_Number = (Player number of (Owner of (Triggering unit)))
    • Set Temp_Loc_1 = (Position of (Triggering unit))
    • Set Temp_Loc_2 = (Target point of issued order)
    • Set angle = (Angle from Temp_Loc_1 to Temp_Loc_2)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • (Mana of (Triggering unit)) Greater than or equal to 25.00
    • Then - Actions
    • Unit - Set mana of (Triggering unit) to ((Mana of (Triggering unit)) - 25.00)
    • For each (Integer A) from 1 to 6, do (Actions)
    • Loop - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • (Item-type of (Item carried by Hero[Player_Number] in slot (Integer A))) Equal to Jet Pack
    • Then - Actions
    • Set item_slot = (Integer A)
    • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • (Charges remaining in (Item carried by Hero[Player_Number] in slot item_slot)) Greater than or equal to 1
    • Then - Actions
    • Item - Set charges remaining in (Item carried by Hero[Player_Number] in slot item_slot) to ((Charges remaining in (Item carried by Hero[Player_Number] in slot item_slot)) - 1)
    • Sound - Stop sound[Player_Number] Immediately
    • Sound - Play JetPack <gen> at 75.00% volume, located at Temp_Loc_1 with Z offset 100.00
    • Set sound[Player_Number] = (Last played sound)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • (Distance between Temp_Loc_1 and Temp_Loc_2) Greater than or equal to (250.00 + (50.00 x (Real((Current research level of Jet blades for (Player(Player_Number)))))))
    • Then - Actions
    • Set distance = (250.00 + (50.00 x (Real((Current research level of Jet blades for (Player(Player_Number)))))))
    • Else - Actions
    • Set distance = (Distance between Temp_Loc_1 and Temp_Loc_2)
    • Hashtable - Save angle as (Key angle) of (Key (Triggering unit)) in hash
    • Hashtable - Save distance as (Key distance) of (Key (Triggering unit)) in hash
    • Unit Group - Add (Triggering unit) to boost_group
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • (Remaining time for boost_timer[Player_Number]) Equal to 0.00
    • Then - Actions
    • Countdown Timer - Start boost_timer[Player_Number] as a One-shot timer that will expire in 2.00 seconds
    • Else - Actions
    • Trigger - Turn on Boost loop <gen>
    • Else - Actions
    • Unit - Order (Triggering unit) to Move To Temp_Loc_2
    • Custom script: call RemoveLocation(udg_Temp_Loc_1)
    • Custom script: call RemoveLocation(udg_Temp_Loc_2)
    • Else - Actions
    • Unit - Order (Triggering unit) to Move To Temp_Loc_2

Trigger:
  • Boost loop
    • Events
    • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • (Number of units in boost_group) Greater than or equal to 1
    • Then - Actions
    • Unit Group - Pick every unit in boost_group and do (Actions)
    • Loop - Actions
    • Set Player_Number = (Player number of (Owner of (Picked unit)))
    • Set boost_unit = (Picked unit)
    • Set angle = (Load (Key angle) of (Key (Picked unit)) from hash)
    • Set distance = (Load (Key distance) of (Key (Picked unit)) from hash)
    • Set speed = (40.00 + (4.00 x (Real((Current research level of Jet blades for (Player(Player_Number)))))))
    • Set Temp_Loc_1 = (Position of boost_unit)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • distance Greater than 0.00
    • Then - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • distance Less than or equal to speed
    • Then - Actions
    • Set Temp_Loc_2 = (Temp_Loc_1 offset by distance towards angle degrees)
    • Set distance = 0.00
    • Else - Actions
    • Set Temp_Loc_2 = (Temp_Loc_1 offset by speed towards angle degrees)
    • Set distance = (distance - speed)
    • Set x = (X of Temp_Loc_2)
    • Set y = (Y of Temp_Loc_2)
    • Set boost_crash_group = (Units within 50.00 of Temp_Loc_2 matching ((((Matching unit) belongs to an enemy of (Player(Player_Number))) Equal to True) and ((((Matching unit) is alive) Equal to True) and (((Triggering unit) is Magic Immune) Equal to False))))
    • Custom script: set udg_z1 = GetLocationZ (udg_Temp_Loc_1)
    • Custom script: set udg_z2 = GetLocationZ (udg_Temp_Loc_2)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • (Terrain pathing at Temp_Loc_2 of type Flyability is off) Equal to False
    • (Number of units in boost_crash_group) Equal to 0
    • z2 Less than or equal to 130.00
    • Then - Actions
    • Custom script: call SetUnitX(udg_boost_unit,udg_x)
    • Custom script: call SetUnitY(udg_boost_unit,udg_y)
    • Else - Actions
    • Set distance = 0.00
    • Custom script: call DestroyGroup(udg_boost_crash_group)
    • Hashtable - Save distance as (Key distance) of (Key (Picked unit)) in hash
    • Unit - Create 1 Image for (Player(Player_Number)) at Temp_Loc_1 facing (Facing of boost_unit) degrees
    • Unit - Add a 0.20 second Generic expiration timer to (Last created unit)
    • Unit - Add Crow Form to (Last created unit)
    • Unit - Remove Crow Form from (Last created unit)
    • Animation - Change (Last created unit) flying height to 50.00 at 100.00
    • Animation - Change (Last created unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with 75.00% transparency
    • Custom script: call RemoveLocation(udg_Temp_Loc_1)
    • Custom script: call RemoveLocation(udg_Temp_Loc_2)
    • Else - Actions
    • Unit Group - Remove boost_unit from boost_group
    • Else - Actions
    • Trigger - Turn off (This trigger)

Trigger:
  • Boost replenish
    • Events
    • Time - boost_timer[1] expires
    • Time - boost_timer[2] expires
    • Time - boost_timer[3] expires
    • Time - boost_timer[4] expires
    • Time - boost_timer[5] expires
    • Time - boost_timer[6] expires
    • Time - boost_timer[7] expires
    • Time - boost_timer[8] expires
    • Time - boost_timer[9] expires
    • Time - boost_timer[10] expires
    • Time - boost_timer[11] expires
    • Time - boost_timer[12] expires
    • Conditions
    • Actions
    • For each (Integer A) from 1 to 12, do (Actions)
    • Loop - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • (Remaining time for boost_timer[(Integer A)]) Equal to 0.00
    • Then - Actions
    • Set Player_Number = (Integer A)
    • For each (Integer B) from 1 to 6, do (Actions)
    • Loop - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • (Item-type of (Item carried by Hero[Player_Number] in slot (Integer B))) Equal to Jet Pack
    • Then - Actions
    • Set item_slot = (Integer B)
    • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • (Charges remaining in (Item carried by Hero[Player_Number] in slot item_slot)) Less than (1 + (Current research level of Jetpack fuel capacity for (Player(Player_Number))))
    • Then - Actions
    • Item - Set charges remaining in (Item carried by Hero[Player_Number] in slot item_slot) to ((Charges remaining in (Item carried by Hero[Player_Number] in slot item_slot)) + 1)
    • Else - Actions
    • Item - Set charges remaining in (Item carried by Hero[Player_Number] in slot item_slot) to (1 + (Current research level of Jetpack fuel capacity for (Player(Player_Number))))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • (Charges remaining in (Item carried by Hero[Player_Number] in slot item_slot)) Less than (1 + (Current research level of Jetpack fuel capacity for (Player(Player_Number))))
    • Then - Actions
    • Countdown Timer - Start boost_timer[Player_Number] as a One-shot timer that will expire in 2.00 seconds
    • Else - Actions
    • Else - Actions
 

jonas

You can change this now in User CP.
Reaction score
67
do manual delta debugging to find the part of the code that causes the crash.
I.e.: delete half of the code, see if it crashes, repeat until you isolate the part that causes the crash.
 

kingkwong92

Well-Known Member
Reaction score
25
Everything works fine when I used the ability to trigger it. So its just the order a unit part. Is there a condition that lets me check the order ID?

EDIT
Realised it was because I had an action that issued a move order. This caused an infinite loop which crashed the game. Thanks tho
 
Last edited:
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top