• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Custom Script Crash

Status
Not open for further replies.
Okay,I was doing something with Custom Scripts to make a custom build system.However,it crashes without any fatal error report.Here are the triggers that causes the crash:
  • Triggers
    • Events
      • Unit - A unit Is issued an order targeting a point
    • Conditions
    • Actions
      • Custom script: if (GetIssuedOrderId() == 1747988529) then
      • Unit - Order BuildSys_Builder(Don't mind this variable.It works in real) to build a building at BuildSys_TempLoc[2](this as well)
      • Custom script: elseif (GetIssuedOrderId() == 1747988533) then
      • Set BuildingID = (Integer(h005))
      • Custom script: endif
Any help would be greatly appreciated.Thanks in advanced.
 
I don't know what order 1747988529 is, but chances are that you are producing an infinite loop. The trigger responds to the event "a unit is issued an order targeting a point", and you order him to do something targeting a point. If that order ID is equal to 1747988529, then it will just cycle infinitely.

The solution is to disable the trigger before the order and enable it after the order:
  • Trigger - Disable Triggers <gen>
  • Unit - Order BuildSys_Builder to build a building at BuildSys_TempLoc[2]
  • Trigger - Enable Triggers <gen>
If it still crashes, then try to look at any other triggers that respond to order events (using the same logic as above).
 
Level 14
Joined
Nov 30, 2013
Messages
926
Okay,another question.How do I make an or condition GUI custom script?

  • Actions
    • Custom script: if (boolean) then
    • Custom script: return true
    • Custom script: endif
    • Custom script: if (boolean2) then
    • Custom script: return true
    • Custom script: endif
You can make "And" conditions in "Or" condition with the use of "Elseif"

Meatmuffin said:
Why do you specifically want it to be done in custom script?
He's probably isn't familiar with actual coding so he use the custom script if he wants to use something that cannot be done through "BJ_Actions"
 
Status
Not open for further replies.
Top