• 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.

[Trigger] Is this Trigger Wrong?

Status
Not open for further replies.
Level 9
Joined
May 22, 2009
Messages
491
OK this is my trigger and it worked until I tried to make it where when the unit transforms he gets the item he picked up the game freezes then crashes.

Unit - A unit owned by Player 1 (Red) Acquires an item
(Item-type of (Item being manipulated)) Equal to Dark Robes
Unit - Remove (Triggering unit) from the game
Unit - Create 1 Dark Priest for (Triggering player) at (Position of (Triggering unit)) facing Default building facing degrees
Hero - Create Dark Robes and give it to (Last created unit)

This script isn't for a certain map so I don't care if its buggy/leaks I'm just doing this for fun.
 
Level 5
Joined
Apr 21, 2006
Messages
82
your trigger seems to do an infinite loop;
when you create the Dark Robes to the hero it launches the trigger again (creating the item for hero -> hero Acquires an item).

I think it could work this way:
  • Events
    • Unit - A unit owned by Player 1 (Red) Acquires an item
  • Conditions
    • (Item-type of (Item being manipulated)) Equal to Dark Robes
  • Actions
    • Trigger - Turn off (this trigger)
    • Set DarkPriestPoint = (Position of (Triggering unit))
    • Unit - Remove (Triggering unit) from the game
    • Unit - Create 1 Dark Priest for (Triggering player) at DarkPriestPoint facing Default building facing degrees
    • Hero - Create Dark Robes and give it to (Last created unit)
    • Trigger - Turn on (this trigger)
    • Custom script: call RemoveLocation(udg_DarkPriestPoint)
 
Status
Not open for further replies.
Top