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.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      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