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

[Trigger] Why isn't this trigger working?

Status
Not open for further replies.
Hello, i'm trying to create a trigger that when a unit enters a region it'll get hit by the spell Entangling Roots.

  • Trap1
    • Events
      • Unit - A unit enters Region 378 <gen>
    • Conditions
      • (Owner of (Triggering unit)) Equal to Player 4 (Purple)
    • Actions
      • Set TempPointTrap = (Position of (Triggering unit))
      • Unit - Create 1 Dummy (Trap) for Player 9 (Gray) at TempPointTrap facing Default building facing degrees
      • Set Trap_Dummy = (Last created unit)
      • Unit - Add Trap to Trap_Dummy
      • Unit - Order Trap_Dummy to Night Elf Keeper Of The Grove - Entangling Roots (Triggering unit)
      • Unit - Add a 1.00 second Generic expiration timer to Trap_Dummy
      • Custom script: call RemoveLocation (udg_TempPointTrap)
In this case Trap equals to Entangling Roots with 0 mana cost and 99999 range.
I don't know what the problem is! The game freezes every time this trigger gets launched.
 
Level 11
Joined
Nov 23, 2013
Messages
665
At the beginning of your trigger, use the action:
  • Trigger - Turn off This trigger
If you don't, i think this trigger will be fired every time the dummy unit is created, because it means a unit enters region 378, which means infinite loop, hence the freeze.
You may want to turn the trigger on again after the dummy was created, if you want more units to be affected by the spell (beware of the expiration timer though, it may be problematic if several units enters that region within less than 1 second, because the variable Trap_Dummy may refer to another dummy.)
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
The game freezes every time this trigger gets launched.
Please elaborate. If you mean that the Warcraft III client drops a few frames that would be because you did not preload the dummy unit and ability and are creating the dummy on top of another unit resulting in costly pathing displacement. Place the dummy somewhere on the map at map initialization to force it to preload and create it some distance away, or preferably recycle the dummy unit.

If you mean the Warcraft III client permanently stops updating the game and has to be forcefully closed that would be because of an infinite loop. Can happen with some object editor abilities that have periodic effects when the period is set to 0 (infinite occurrences per unit time).
 
Status
Not open for further replies.
Top