• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Trigger] Infinite Loop

Status
Not open for further replies.
Level 4
Joined
Oct 11, 2008
Messages
90
I have a hero named worker and an item nearby named building hammer. When the hero picks the item, he turns into a hero named builder and when he drops the item he turns into worker again. For this i have 2 triggers:

  • Pick Hammer
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-Type of (Item being manipulated)) Equal to Building Hammer
      • (Unit-Type of (Hero manipulating item)) Equal to Worker
    • Actions
      • Unit - Replace (Hero manipulating item) with a Builder using The old unit's relative life and mana
  • Drop Hammer
    • Events
      • Unit - A unit Looses an item
    • Conditions
      • (Item-Type of (Item being manipulated)) Equal to Building Hammer
      • (Unit-Type of (Hero manipulating item)) Equal to Builder
    • Actions
      • Unit - Replace (Hero manipulating item) with a Worker using The old unit's relative life and mana
When the unit picks the hammer, the trigger works and he turns into a builder, but when he drops the hammer, the game freezes for a second, then wc3 crashes; my guess in that it entered an infinite loop.
How to make this work?
 
base.gif
Drop Hammer
joinminus.gif
events.gif
Events
line.gif
joinbottom.gif
unit.gif
Unit - A unit Looses an item

joinminus.gif
cond.gif
Conditions
line.gif
join.gif
if.gif
(Item-Type of (Item being manipulated)) Equal to Building Hammer
line.gif
joinbottom.gif
if.gif
(Unit-Type of (Hero manipulating item)) Equal to Builder

joinbottomminus.gif
actions.gif
Actions
empty.gif
joinbottom.gif
unit.gif
Unit - Replace (Hero manipulating item) with a Worker using The old unit's relative life and mana

try to replace it with

  • Actions
    • Unit - Remove (Hero manipulating item) from the game
    • Set Temp_Point = (Position of (Hero manipulating item))
    • Unit - Create 1 Worker for (Owner of (Hero manipulating item)) at Temp_Point facing Default building facing degrees
 
@Maker
I did, but surprisingly, it still looped.

@Mooglefrooglian
I can't use chaos, because there will appear some complications later in my game.

Never mind, i found a way to evade this situation. Thx for the posts anyway.
 
Status
Not open for further replies.
Back
Top