X Enter region And write Y

Gripen2

New Member
Reaction score
1
How can i make so.

If a "Pig" is in the Region.Whatever played types "-eliminate" all the pigs in the region dies.I must have it beacus my map starts to lagg when pigs come's to town. :p
 

ManyTimes

I'm so lonesome I could cry...
Reaction score
293
Code:
Untitled Trigger 004
    Events
        Player - Player 1 (Red) types a chat message containing -eliminate as An exact match
    Conditions
    Actions
        Unit Group - Pick every unit in (Units in Region 000 <gen>) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Unit-type of (Picked unit)) Equal to Pig
                    Then - Actions
                        Unit - Kill (Picked unit)
                    Else - Actions
Or you can do it with one like pick every unit in region matching... or whatever.
 

Gripen2

New Member
Reaction score
1
Code:
Untitled Trigger 004
    Events
        Player - Player 1 (Red) types a chat message containing -eliminate as An exact match
    Conditions
    Actions
        Unit Group - Pick every unit in (Units in Region 000 <gen>) and do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Unit-type of (Picked unit)) Equal to Pig
                    Then - Actions
                        Unit - Kill (Picked unit)
                    Else - Actions
Or you can do it with one like pick every unit in region matching... or whatever.

SO that would kill all Player 1's pigs or all pigs?
 

Larcenist

REP: Respect, Envy, Prosperity?
Reaction score
211
Events:
Player 1 (Red) Types -eliminate as an exact match

Conditions:

Actions:
Set Temp_Group = Units in <your region> matching (unit-type of (matching unit) equal to Pig) and (matching unit) is alive equal to true:
Pick every unit in Temp_Group and do actions
Kill (picked unit)
call DestroyGroup (udg_Temp_Group)

Something like that maybe?

Edit. Way too slow...
 

ManyTimes

I'm so lonesome I could cry...
Reaction score
293
>>Kill only pl1 pigs or all
All pigs.

But only player1 red can write it.

Add more events, one for each player... If you want to remove leaks also, if you do not know how to, I suggest you look up a leak tutorial here on thehelper.net, search after it, or look in the tutorial section.

Edit: here is explode
Code:
Then - Actions
    Unit - Explode (Picked unit)
 

Larcenist

REP: Respect, Envy, Prosperity?
Reaction score
211
Code:
Exploding Pigs
    Events
        Player - Player 1 (Red) types a chat message containing -eliminate as An exact match
        Player - Player 2 (Blue) types a chat message containing -eliminate as An exact match
        Player - Player 3 (Teal) types a chat message containing -eliminate as An exact match
        Player - Player 4 (Purple) types a chat message containing -eliminate as An exact match
    Conditions
    Actions
        Set Temp_Group = (Units in [B](Playable map area)[/B] matching (((Unit-type of (Matching unit)) Equal to [B]Footman[/B]) and ((((Matching unit) is alive) Equal to True) and ((Owner of (Matching unit)) Equal to (Triggering player)))))
        Unit Group - Pick every unit in Temp_Group and do (Actions)
            Loop - Actions
                Unit - Explode (Picked unit)
        Custom script:   call DestroyGroup (udg_Temp_Group)

Bolded parts are what you need to change.
 

Gripen2

New Member
Reaction score
1
Code:
Exploding Pigs
    Events
        Player - Player 1 (Red) types a chat message containing -eliminate as An exact match
        Player - Player 2 (Blue) types a chat message containing -eliminate as An exact match
        Player - Player 3 (Teal) types a chat message containing -eliminate as An exact match
        Player - Player 4 (Purple) types a chat message containing -eliminate as An exact match
    Conditions
    Actions
        Set Temp_Group = (Units in [B](Playable map area)[/B] matching (((Unit-type of (Matching unit)) Equal to [B]Footman[/B]) and ((((Matching unit) is alive) Equal to True) and ((Owner of (Matching unit)) Equal to (Triggering player)))))
        Unit Group - Pick every unit in Temp_Group and do (Actions)
            Loop - Actions
                Unit - Explode (Picked unit)
        Custom script:   call DestroyGroup (udg_Temp_Group)

Bolded parts are what you need to change.
Somehow i cant make that first Action trigger.
Do i need WE Unlimited?
 

Larcenist

REP: Respect, Envy, Prosperity?
Reaction score
211
It's a Unit Group Variable, and I'm using the "Set Variable" function.
 
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