Kill unit trigger.

Kiddo

New Member
Reaction score
12
The basic idea of my map is that you use a kind of "Wisp" to select your Hero from the Tavern. Now, what I'm trying to do is kill the wisp when this Hero is selected/bought.

The trigger I tried is :
Code:
Player 1 Kill
    Events
        Unit - A unit enters Hero Start Point <gen>
    Conditions
        ((Triggering unit) is A Hero) Equal to True
    Actions
        Unit - Kill (Buying unit)

And I made it for each of the 5 players. But it doesn't work.

Another trigger I tried was to select the individual units ... and it was something like :

Code:
Player 1 Kill
    Events
        Unit - A unit enters Hero Start Point <gen>
    Conditions
        ((Triggering unit) is A Hero) Equal to True
    Actions
        Unit - Kill Lost Soul 0007 <gen>

This killed the unit ... but not only mine, but all of them. What can I do to actually kill only the Soul that was used to buy a Hero? Any ideas? Maybe to change something in the first trigger or something?

Thanks in advance,
Kiddo.
 

Tyman2007

Ya Rly >.
Reaction score
74
EDIT: Sorry, i need to re-do the triggers..

EDIT2:

Here's what i got, i didn't put much effort into it but it's as simple as it gets.

Code:
Untitled Trigger 001
    Events
        Unit - A unit Sells a unit
    Conditions
        ((Sold unit) is A Hero) Equal to (==) True
    Actions
        Unit - Kill Wisp 0001 <gen>
 

YourFace

<span style="color:#9C9C9C;"><strong>Runner Up - T
Reaction score
91
Code:
Untitled Trigger 001
    Events
        Unit - A unit enters (Playable map area)
    Conditions
        ((Triggering unit) is A Hero) Equal to True
    Actions
        Unit Group - Pick every unit in (Units owned by (Owner of (Triggering unit)) matching ((Unit-type of (Matching unit)) Equal to wisp)) and do (Actions)
            Loop - Actions
                Unit - Kill (Picked unit)
that should work if you have only 1 wisp in the entire game for every player
hope you'll clean up the leaks lol
shouldn't be a prob if you dont since this only happens once
if you'd like to learn about leaks go here
http://www.thehelper.net/forums/showthread.php?t=27219
 

Epicgamers

New Member
Reaction score
5
JASS:
Player 1 Kill
    Events
        Unit - A unit enters Hero Start Point &lt;gen&gt;
    Conditions
        ((Entering) is A Hero) Equal to True
    Actions
        Unit - Kill (Entering Unit)


Should work
 

Tyman2007

Ya Rly >.
Reaction score
74
Code:
Untitled Trigger 001
    Events
        Unit - A unit enters (Playable map area)
    Conditions
        ((Triggering unit) is A Hero) Equal to True
    Actions
        Unit Group - Pick every unit in (Units owned by (Owner of (Triggering unit)) matching ((Unit-type of (Matching unit)) Equal to wisp)) and do (Actions)
            Loop - Actions
                Unit - Kill (Picked unit)
that should work if you have only 1 wisp in the entire game for every player
hope you'll clean up the leaks lol
shouldn't be a prob if you dont since this only happens once
if you'd like to learn about leaks go here

what i think he's asking is that when you buy a hero from like a tavern it kills the wisp so you can't buy another one.
 

YourFace

<span style="color:#9C9C9C;"><strong>Runner Up - T
Reaction score
91
what i think he's asking is that when you buy a hero from like a tavern it kills the wisp so you can't buy another one.

thats what my trigger does doesn't it? it picked the unit when the hero enters the map, the picked unit is the wisp
 

Tyman2007

Ya Rly >.
Reaction score
74
umm... both of our triggers work, but a leakless one that would work in a different way would be this one
Code:
KillWisp
    Events
        Unit - A unit Sells a unit
    Conditions
        ((Sold unit) is A Hero) Equal to (==) True
    Actions
        Set UnitGroup = (Units owned by (Owner of (Sold unit)) of type Wisp)
        Unit Group - Pick every unit in UnitGroup and do (Actions)
            Loop - Actions
                Unit - Kill (Picked unit)
        Custom script:   call DestroyGroup(udg_UnitGroup)
 

AoW_Hun7312

I'm a magic man, I've got magic hands.
Reaction score
76
Code:
Test
    Events
        Unit - A unit Sells a unit
    Conditions
        ((Sold unit) is A Hero) Equal to True
    Actions
        Unit - Kill (Buying unit)

That should work. :)
 

Kiddo

New Member
Reaction score
12
Hehe, thanks for the fast responses guys! It looks like the problem is solved ... for now. :)

+rep for y'all!

Code:
Test
    Events
        Unit - A unit Sells a unit
    Conditions
        ((Sold unit) is A Hero) Equal to True
    Actions
        Unit - Kill (Buying unit)

That should work. :)

Well, it doesn't, I tried it. Coult be some WE bug. But anyhow ...

Used:
Code:
Player 1 Kill
    Events
        Unit - Graveyard of Fallen Heroes 0050 <gen> Sells a unit
    Conditions
        ((Sold unit) is A Hero) Equal to True
    Actions
        Unit - Kill Lost Soul 0007 <gen>

And so on for each Lost Soul. And it seems to work, so it's alright.

Kiddo.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top