How can I destroy a unit after it summons a building? (like in the builder maps)

Astal

New Member
Reaction score
1
I have whisps and theyre only purpose is to summon the first building then they are useless. How can I destroy them after the building is summoned?
 

Squishy

You can change this now in User CP.
Reaction score
127
Code:
Trigger
    Events
        Unit - A unit Finishes construction
    Conditions
        (Unit-type of (Triggering unit)) Equal to Wisp
    Actions
        Unit - Kill (Triggering unit)
 

Artificial

Without Intelligence
Reaction score
326
I don't know these "builder maps", but if each player only has one wisp, you could save it into a variable array and when the building finishes construction, remove Wisp[(Player number of (Owner of (Triggering unit)))]. :)
 

Astal

New Member
Reaction score
1
For some reason this event isnt creating whisps, I copied it right off of another map I had and just modified it a little bit. Some reason Its not working lol. Do you think one of you guys could check it out and lemme know if you see a problem with it?

Code:
Create Whisps
    Events
        Map initialization
    Conditions
    Actions
        Player Group - Pick every player in Citizen_Group and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked player) controller) Equal to User
                        ((Picked player) slot status) Equal to Is playing
                    Then - Actions
                        Unit - Create 1 Citizen for (Picked player) at ((Picked player) start location) facing Default building facing degrees
                    Else - Actions
                        Do nothing
        Player Group - Pick every player in Umbrella_Group and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Picked player) controller) Equal to User
                        ((Picked player) slot status) Equal to Is playing
                    Then - Actions
                        Unit - Create 1 Umbrella for (Picked player) at ((Picked player) start location) facing Default building facing degrees
                    Else - Actions
                        Do nothing
 

Squishy

You can change this now in User CP.
Reaction score
127
Are there any players in the Player Groups? Are you sure that Citizens and Umbrellas are the right units?
 

DiDdY

New Member
Reaction score
14
Technically, you'd have to set them variables to the players at Map Int as well, therefore there might be the case that the players aren't actually set in them groups when this trigger runs. ;)
 

Tiber

Member
Reaction score
4
IIRC when wisps build things which have Stats - Unit Classification set to Ancient they are destroyed, assuming you want them to work like NE wisps.
 

Astal

New Member
Reaction score
1
Ok they spawn when I make it

Code:
Player Group - Pick every player in (All players) and do (Actions)

How can I make sure the player groups are setup before the whisps try to spawn?
 

Artificial

Without Intelligence
Reaction score
326
How can I make sure the player groups are setup before the whisps try to spawn?
How about just setting the player groups in the same trigger the wisps are spawned in...
 

Astal

New Member
Reaction score
1
Code:
Trigger
    Events
        Unit - A unit Finishes construction
    Conditions
        (Unit-type of (Triggering unit)) Equal to Wisp
    Actions
        Unit - Kill (Triggering unit)

btw that doesnt work either :\


here is my actual code for that

Code:
Destroy Whisps
    Events
        Unit - A unit Finishes construction
    Conditions
        ((Unit-type of (Triggering unit)) Equal to Citizen) or ((Unit-type of (Triggering unit)) Equal to Umbrella)
    Actions
        Unit - Kill (Triggering unit)
 

Astal

New Member
Reaction score
1
How about just setting the player groups in the same trigger the wisps are spawned in...

yeah i guess thats a bit easier. It worked also, sorry bout being a noob guise XD

Still trying to figure out how to kill this whisp hehehe


Edit: If anyone can lemme know how to destroy a unit after it finishes construction, id be very grateful, I tried all the ways mentioned here but had no success
 

Astal

New Member
Reaction score
1
IIRC when wisps build things which have Stats - Unit Classification set to Ancient they are destroyed, assuming you want them to work like NE wisps.

yeah changing that makes it a hell of a lot easier. It works now, thanks guys
 

Oninuva

You can change this now in User CP.
Reaction score
221
Stop talking to yourself. You can edit your psots you know.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top