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

A little help with a trigger please

Status
Not open for further replies.
Level 5
Joined
Sep 15, 2009
Messages
186
Hi can I get some help with this trigger it keeps crashing right after the Unit spawns

  • Start chance
    • Events
      • Unit - A unit Is issued an order targeting an object
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Issued order) Equal to (Order(attack))
          • (Issued order) Equal to (Order(smart))
      • (Destructible-type of (Target destructible of issued order)) Equal to Target
    • Actions
      • Set tempinteger = (Random integer number between 1 and 10)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • tempinteger Equal to 1
        • Then - Actions
          • Set TempDest = (Target destructible of issued order)
          • Set Tempunit = (Triggering unit)
          • Set TempReal = (Current life of TempDest)
          • Set temppoint = (Position of TempDest)
          • Wait until (TempReal Greater than (Current life of TempDest)), checking every 0.10 seconds
          • Destructible - Remove TempDest
          • Unit - Create 1 Rock Monster for Neutral Hostile at temppoint facing Default building facing degrees
        • Else - Actions
Yes, I know it leaks, im having trouble using the custom script to patch right now so im going to deleak it later
 
Level 5
Joined
Sep 15, 2009
Messages
186
The wait function is so that it doesnt spawn the unit when its given the order, only when it attacks
 
Why not just use "Unit - A unit is attacked" (or just use a damage detection system, actually, try Weep's) as your event? Then you can just directly spawn the rock thing or whatever.

The reason why your thing is crashing is probably because it is doing some infinite loop (when you use the wait). That wait function loops a wait until the condition is satisfied, so if it isn't satisfied, it will probably just loop and crash eventually. That's why you should just use a separate trigger.
 
Status
Not open for further replies.
Top