Complicated Triggers?

adeoin

Member
Reaction score
11
I want to make it so when a specific builder enters a circle of power and building is automatically built for that player. then like footman frenzy it will continully spawn units. But these units will be spawned for his teammate.

Ex. Red who has a footman builder runs into a circle of power. A barracks is now in construction for Player Blue his teammate. Now around the barracks footman will spawn for player blue overtime.

So its kinda like a micro macro game. One builder and One controller.

How do i do this, i thought it over and i can't seem to figure out how to do it. Thanks In Advance
Adeoin
 

Squirel

New Member
Reaction score
13
If I understand correctly, what you want is three triggers, one initially off and one that turns it on and a third that turns it off. You need the one that is initially off to pick all of the barracks in the area and to create a unit at that barracks. The on/off triggers will detect when a unit enters or exits the circle of power.
 

jwallstone

New Member
Reaction score
33
Here's to get you started:

Trigger one:
Trigger:
  • Untitled Trigger 001
    • Events
      • Unit - A unit enters No region
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Peasant
    • Actions
      • Unit - Create 1 Builder for Player 2 (Blue) at (Position of (Picked unit)) facing Default building facing degrees
      • Unit - Order (Last created unit) to build a Barracks at (Center of No region)
      • Unit - Remove (Last created unit) from the game

Creation a Region at your Circle of Power to use in place of No Region (both places its used). Create a custom unit (To place in the "Builder" spot) with the Undead's construction ability, so it doesn't need to stick around. The trigger removes the builder right after it begins. Make sure the building costs 0 gold and lumber.

Trigger 2:
Trigger:
  • Untitled Trigger 002
    • Events
      • Unit - A unit Finishes construction
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Barracks
    • Actions
      • Unit - Set the custom value of (Triggering unit) to 1

You're setting the custom value to 1 to indicate that it's completed. This prevents uncompleted buildings from creating units.

Trigger 3:
Trigger:
  • Untitled Trigger 003
    • Events
      • Time - Every 10.00 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Playable map area) matching (((Unit-type of (Triggering unit)) Equal to Barracks) and ((Custom value of (Matching unit)) Equal to 1))) and do (Actions)
        • Loop - Actions
          • Unit - Create 1 Footman for (Owner of (Picked unit)) at (Position of (Picked unit)) facing Default building facing degrees

You're picking every barracks with Custom value 1 (finished in other words) and creating a footman for its owner.

Now, if you want to do this right, you'll leak proof the code. Just search the forums and you'll find guides. But this'll get you started.
 

adeoin

Member
Reaction score
11
Srry Bout this but is there a way to make this trigger more efficient in GUI so it works for all the players. Cause if not that would mean i hafta make a set of these three triggers for each player times the amount of builders there is.
 

DrStyles

New Member
Reaction score
7
it should work for everyone..? if you mean different races just use
Trigger:
  • Or - Any (Conditions) are true
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Footman
      • (Unit-type of (Triggering unit)) Equal to Whatever


or if you mean different buildings then you would have to use
Trigger:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Unit-type of (Triggering unit)) Equal to Footman
    • Then - Actions
      • Whatever
    • Else - Actions
      • If - Conditions
      • (Unit-type of (Triggering unit)) Equal to Different unit
    • Then - Actions
      • Whatever (again)
    • Else - Actions
 

MateoSoetsu

New Member
Reaction score
9
You will probably need atleast 1 set of triggers per circle of power region. Other than that you can change the unit type of the entering unit or the custom value of the constructed building or the units spawned. You could use an if/then statement.
 

adeoin

Member
Reaction score
11
Your ideas helped me alot but I can't figure out how to make the trigger so that when a unit enters a region it will make the barracks for his teammate not himself. So thats the complication here. There are five teams of 2. And on each team there is a builder and a fighter. I hope I can make you guys see basically how the game works. I got this part of the condition down.

Code:
Conditions
    Or - Any (Conditions) are true
        Conditions
            (Unit-type of (Entering unit)) Equal to Builder Of The Royal Order
            (Unit-type of (Entering unit)) Equal to Naga Subordinate
            Or - Any (Conditions) are true
                Conditions
                    (Color of (Owner of (Entering unit))) Equal to Red
                    (Color of (Owner of (Entering unit))) Equal to Teal
                    (Color of (Owner of (Entering unit))) Equal to Yellow
                    (Color of (Owner of (Entering unit))) Equal to Green
                    (Color of (Owner of (Entering unit))) Equal to Gray


I'm thinking that you could do something like... Construct barracks for random ally of entering unit. Cause the entering unit only has one ally so it has too choose the other guy right? I can't find a line for this though.
Could anyone help me?

Thanks In Advance
~Adeoin
 

Pyropenguins

New Member
Reaction score
4
You can have it be created for triggering player then transfer ownership of tower to his allie. Its like something like unit - change ownership to allie of triggering player.
Dont have WE on this comp sorry i cant be of more help

But i do hope this is accurate and helps ya out :)
 
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