• 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] Need Item Trigger Help...

Status
Not open for further replies.
Level 5
Joined
Dec 15, 2010
Messages
115
I am a sucker for WC3 maps based off ones from other games, and I have been working on one for the Legend of Zelda from the NES. There is an aspect I am trying to add based off of Ring Heroes from Lord of the Rings Battle for Middle Earth II.

What happens in the game is if you discover the ring and bring it back to your base you can summon a super powerful hero to fight for you. I want that on the map I am making (With the Triforce instead of the Ring obviously). And I mostly got it, but I don't know how to trigger the item to be removed when the hero reaches the summon place and add and lock the item to the "Super" hero once it spawns. So far I got...

  • Player 1 Human
    • Events
      • Unit - A unit enters Triforce Summon 1 <gen>
    • Conditions
      • ((Triggering unit) has an item of type Triforce) Equal to True
      • (Race of Player 1 (Red)) Equal to Human
    • Actions
      • Wait 5.00 seconds
      • Unit - Create 1 Medivh for Player 1 (Red) at (Center of Triforce Summon 1 <gen>) facing 90.00 degrees
      • Trigger - Turn off (This trigger)
But obviously I need to fit in the add/remove item thing. What I am looking for is...

Player 1's <Hero> gets the Triforce, once the hero returns to base they can bring the item to the summoning circle and they will lose it, but in X amount of time (5 seconds in the trigger for testing purposes) the new super hero will be spawned. The item will also be in the new hero's inventory and be locked to them until death (Item is set to drop upon death in the item data).
 
Level 5
Joined
Dec 15, 2010
Messages
115
Sorry for the super late response (And thanks for what's answered). What exactly causes the leak? I didn't quite get what you said.
 
Level 20
Joined
Apr 14, 2012
Messages
2,901
I believe so it's this one:

(Center of Triforce Summon 1 <gen>)

As deathismyfriend said you leak a location. Store this into a variable and use that variable instead.

Before you turn off your trigger use this line in the custom script:
  • Custom Script: call RemoveLocation(udg_YourPointVariable)
Just replace YourPointVariable with the name of the point variable you created to store the location earlier mentioned.
 
Status
Not open for further replies.
Top