Spawned Units Death

Darkenneko

TH.net Regular
Reaction score
3
Hello everyone.
Its me again, as normal. -_-"
Requesting help from the awesome community. =]
Anyways down to the point, So, IF a players in game it creates a unit for them,
for now Lets say its a Peasant, okay, so the Peasant is a hero chooser, The Altars are Taverns that Sell Heroes and as soon as a hero is Sold, they are transported somewhere, SO there lies the problem, How do I Kill the little peasant? =D
Thanks for The Help. =]
-Calvin
 

ReVolver

Mega Super Ultra Cool Member
Reaction score
610
Add a region and when he enters it, kill the unit or remove it if that is like a hero chooser if a unit is sold just make a unit group to check if the player has a peasant unit type and remove it.
 

Darkenneko

TH.net Regular
Reaction score
3
Add a region and when he enters it, kill the unit or remove it if that is like a hero chooser if a unit is sold just make a unit group to check if the player has a peasant unit type and remove it.

That first one doesn't work,
Its a Tavern, not a Circle of power. The second one, I haven't tried to mess
with unit groups. >_< Might try it. Thanks. =]
Any other Suggestions?
 

ReVolver

Mega Super Ultra Cool Member
Reaction score
610
When one of the heroes enters the map (been created) just pick every unit type owned by the player of peasant or w/e and remove it.
 

Darkenneko

TH.net Regular
Reaction score
3
When one of the heroes enters the map (been created) just pick every unit type owned by the player of peasant or w/e and remove it.

Thanks =]
I havn't tried it yet, But I created a GUI Trigger that is somewhat like that.
Thanks for the Advice I'm off to Try it! =D
 

Darkenneko

TH.net Regular
Reaction score
3
Talked to Soon. =/
It didn't work, I'm probably doing it wrong?
So, if you could maybe give me the Exact Trigger names for it? Please? =]
That would help me a lot. ^^
Thank You For all the help so far! =D
-Calvin
 

cleeezzz

The Undead Ranger.
Reaction score
268
try

Code:
Untitled Trigger 001
    Events
        Unit - A unit Sells a unit
    Conditions
    Actions
        For each (Integer A) from 1 to 12, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Owner of (Sold unit)) Equal to (Player((Integer A)))
                    Then - Actions
                        Unit Group - Pick every unit in (Units owned by (Player((Integer A))) of type Peasant) and do (Actions)
                            Loop - Actions
                                Unit - Kill (Triggering unit)
                    Else - Actions

note: it DOES leak
 

Darkenneko

TH.net Regular
Reaction score
3
try

Code:
Untitled Trigger 001
    Events
        Unit - A unit Sells a unit
    Conditions
    Actions
        For each (Integer A) from 1 to 12, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Owner of (Sold unit)) Equal to (Player((Integer A)))
                    Then - Actions
                        Unit Group - Pick every unit in (Units owned by (Player((Integer A))) of type Peasant) and do (Actions)
                            Loop - Actions
                                Unit - Kill (Triggering unit)
                    Else - Actions

note: it DOES leak


Mmm...
Well, Oddly enough it kills a unit alright.
The tavern. -_-"
Thank you for the help anyways. =]
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> Unit - Kill (Triggering unit)

Well, yes, that's the shop... :p

I guess he wanted to kill the "Picked unit".
Though, you could just use the unit group loop without the for each and the if...
 

Darkenneko

TH.net Regular
Reaction score
3
> Unit - Kill (Triggering unit)

Well, yes, that's the shop... :p

I guess he wanted to kill the "Picked unit".
Though, you could just use the unit group loop without the for each and the if...

Eh. >w<"
I'm not very good with Gui, or infact, a lot of things. =/
Well, thank you all for your help, I'll figure something Out. >w<"
 

KvickaN

TH.net Regular
Reaction score
24
Code:
Hero Picking
    Events
        Unit - A unit Sells a unit
    Conditions
        Or - Any (Conditions) are true
            Conditions
                (Triggering unit) Equal to (Hero Tarvern 1)
                (Triggering unit) Equal to (Hero Tarvern 2)
                (Triggering unit) Equal to (Hero Tarvern 3)
                (Triggering unit) Equal to (Hero Tarvern 4)
    Actions
        Unit - Remove (Random unit from (Units in (Hero Picking Area) owned by Player 1 (Red))) from the game

Assuming that only peasants are in that region.

Simple and should work.
 

Darkenneko

TH.net Regular
Reaction score
3
Code:
Hero Picking
    Events
        Unit - A unit Sells a unit
    Conditions
        Or - Any (Conditions) are true
            Conditions
                (Triggering unit) Equal to (Hero Tarvern 1)
                (Triggering unit) Equal to (Hero Tarvern 2)
                (Triggering unit) Equal to (Hero Tarvern 3)
                (Triggering unit) Equal to (Hero Tarvern 4)
    Actions
        Unit - Remove (Random unit from (Units in (Hero Picking Area) owned by Player 1 (Red))) from the game

Assuming that only peasants are in that region.

Simple and should work.

I Love You. =']
It worked, I just added the last part to my already made trigger, Thank you very much. =]
Problem Solves! =D
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top