Same Races ? (Trigger Help) ?

LaZyNation43

New Member
Reaction score
2
Hello

I have a question.. I am currently working on a mode called "Same Races"
What this does is it waits until Player 1 (Red) constructs a tower, a specific tower, out of 64. One of those 64 towers will be constructed, and then I want Player 2, 3, 4, 5, and 6, to get the same constructed structure at their own personal region.

This is what I have right now.. it works, but I would have to do this about 385 times.. I'm trying to figure out an easier way to work this.

Code:
Same Race
    Events
        Unit - A unit owned by Player 1 (Red) Finishes construction
    Conditions
    Actions
        If ((Unit-type of (Constructed structure)) Equal to Footman) then do (Unit - Create 1 (Unit-type of (Constructed structure)) for Player 2 (Blue) at (Center of Blue Random Spawn <gen>) facing Default building facing (270.0) degrees) else do (Do nothing)

Sigh.. any ideas how to do this in an easier way without having to copy/paste this 384 more times and change the data? :confused:
 

Emu.Man00

New Member
Reaction score
41
are there any towers that you DONT want this to work for?

you can simply take the if part out, then youd only need the action five times :3

>>and if im understand this right its a tower u build once that chooses your race, so if you want this to only run for the first tower simply add

"trigger-turn off this trigger"

at the end of it
 

Chewbalka

New Member
Reaction score
14
is there specific player conversions?
or is it if player 1 makes something all players get the same unit?


events
unit - a unit owned by player 1 finishes construction
unit - a unit owned by player 2 finishes construction
unit - a unit owned by player 3 finishes construction
unit - a unit owned by player 4 finishes construction
unit - a unit owned by player 5 finishes construction
unit - a unit owned by player 6 finishes construction

actions
unit - creat 1 of (constructed unit) at center of ....

maybe that?
 

Emu.Man00

New Member
Reaction score
41
i understood it as player 1 decides the race and everyone has the same, based on his math (64 races * 6 players) Otherwise you'd be looking at a number more like 2300, as opposed to 380
 

LaZyNation43

New Member
Reaction score
2
Nah I need it to work for all 64 races.

Eh... I'm trying to figure out how to make it so where red can build any one of these towers and then the tower he builds will be summoned at 5 regions, one for blues spawn, teals spawn, yellows spawn, oranges spawn, and purples spawn.






Yeah.. I would have to do this 384 times, because 64*6=384.. 64 races.. 6 players. or 64*5 which is 320.. but there must be an easier way to do this, right?
 

Emu.Man00

New Member
Reaction score
41
Code:
Melee Initialization
    Events
        Unit - A unit owned by Player 1 (Red) Finishes construction
    Conditions
    Actions
        Unit - Create 1 (Unit-type of (Constructed structure)) for Player 2 (Blue) at (Center of (blue region)) facing Default building facing degrees
        Unit - Create 1 (Unit-type of (Constructed structure)) for Player 3 (Teal) at (Center of (teal region)) facing Default building facing degrees
        Unit - Create 1 (Unit-type of (Constructed structure)) for Player 4 (Purple) at (Center of (purple region)) facing Default building facing degrees
        Unit - Create 1 (Unit-type of (Constructed structure)) for Player 5 (Yellow) at (Center of (yellow region)) facing Default building facing degrees
        Unit - Create 1 (Unit-type of (Constructed structure)) for Player 6 (Orange) at (Center of (Orange region)) facing Default building facing degrees
        Trigger - Turn off (This trigger)

does this not work?
 

LaZyNation43

New Member
Reaction score
2
are there any towers that you DONT want this to work for?

you can simply take the if part out, then youd only need the action five times :3

>>and if im understand this right its a tower u build once that chooses your race, so if you want this to only run for the first tower simply add

"trigger-turn off this trigger"

at the end of it



Thanks! Problem solved. :)

I didn't understand you at first but i made it and it works
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
Hello

I have a question.. I am currently working on a mode called "Same Races"
What this does is it waits until Player 1 (Red) constructs a tower, a specific tower, out of 64. One of those 64 towers will be constructed, and then I want Player 2, 3, 4, 5, and 6, to get the same constructed structure at their own personal region.

This is what I have right now.. it works, but I would have to do this about 385 times.. I'm trying to figure out an easier way to work this.

Code:
Same Race
    Events
        Unit - A unit owned by Player 1 (Red) Finishes construction
    Conditions
    Actions
        If ((Unit-type of (Constructed structure)) Equal to Footman) then do (Unit - Create 1 (Unit-type of (Constructed structure)) for Player 2 (Blue) at (Center of Blue Random Spawn <gen>) facing Default building facing (270.0) degrees) else do (Do nothing)

Sigh.. any ideas how to do this in an easier way without having to copy/paste this 384 more times and change the data? :confused:

You could save some time by removing the if-then condition.


Code:
Same Race
    Events
        Unit - A unit owned by Player 1 (Red) Finishes construction
    Conditions
    Actions
        [del]If ((Unit-type of (Constructed structure)) Equal to Footman) then do ([/del]Unit - Create 1 (Unit-type of (Constructed structure)) for Player 2 (Blue) at (Center of Blue Random Spawn <gen>) facing Default building facing (270.0) degrees[de]l) else do (Do nothing)[/del]

If you want to make sure it's one of those 64 buildings, do something like this:

Code:
Same Race
    Events
        Unit - A unit owned by Player 1 (Red) Finishes construction
    Conditions
        Or - Any conditions are true
            Conditions
                (Unit type of (Constructed structure)) equal to Footman
                (Unit type of (Constructed structure)) equal to Grunt
                (Unit type of (Constructed structure)) equal to Arthas The Action Figure Building
            .......... and so on........
    Actions
        Unit - Create 1 (Unit-type of (Constructed structure)) for Player 2 (Blue) at (Center of Blue Random Spawn <gen>) facing Default building facing (270.0) degrees

Then, to avoid having to create more triggers:

Code:
Initialization
    Events
        Map Initialization
    Conditions
    Actions
        Set PlayerRegion[1] = (Center of Red Random Spawn <gen>)
        Set PlayerRegion[2] = (Center of Blue Random Spawn <gen>)
        Set PlayerRegion[3] = (Center of Teal Random Spawn <gen>)
        Set PlayerRegion[4] = (Center of Purple Random Spawn <gen>)
        Set PlayerRegion[5] = (Center of Yellow Random Spawn <gen>)
        Set PlayerRegion[6] = (Center of Orange Random Spawn <gen>)

Here we set all the centers of the spawn regions, so that we can loop through them, as we can loop through players.

Code:
Same Race
    Events
        Unit - A unit owned by Player 1 (Red) Finishes construction
        Unit - A unit owned by Player 2 (Blue) Finishes construction
        Unit - A unit owned by Player 3 (Teal) Finishes construction
        Unit - A unit owned by Player 4 (Purple) Finishes construction
        Unit - A unit owned by Player 5 (Yellow) Finishes construction
        Unit - A unit owned by Player 6 (Orange) Finishes construction
    Conditions
        Or - Any conditions are true
            Conditions
                (Unit type of (Constructed structure)) equal to Footman
                (Unit type of (Constructed structure)) equal to Grunt
                (Unit type of (Constructed structure)) equal to Arthas The Action Figure Building
            .......... and so on........
    Actions
        For each (Integer A) from 1 to 6 do (Actions) -- [B]Loop through players and their respective spawn locations[/B]
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Triggering Player) is not equal to (Player(Integer A)) -- [B]So that One player does not get a second building after building one.[/B]
                    Then - Actions
                        Unit - Create 1 (Unit-type of (Constructed structure)) for (Player(Integer A)) at PlayerRegion[(Integer A)] facing Default building facing (270.0) degrees -- [B]Create 1 of the constructed units for every player except the triggering player, at each player's region.[/B]

Needs a Point variable with the "Array" box checked. Name it "PlayerRegion"

EDIT: Ah, problem was solved while I was answering. :p I also missed the part where you said you only wanted it for player 1 (Red), sorry.
 
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