Capturing Citadel

lummerlars

Member
Reaction score
2
Hello guys.
I've a question and I can't fiqure this trigger out myself so I would love to have some help.

Okay - The map is basically about capturing buildings to gain more points.
There are 5 building (Called Citadels) in the map - right now they are called:
Citadel A
Citadel B
Citadel C
Citadel D
Citadel Mid
(That's just for now)

There are 2 teams
Player 1-5 (Team 1)
Player 5-10 (Team 2)
And the citadels are owned by Player 12 (brown)

So the idea is that every Citadel in the game are owned by Player 12 in the beginning, and if a team (1 or 2) kills a citadel they'll get the Citadel.
So - Team 1 kills a citadel then set the owner of Citadel to Team 1 or something like that.
And you'll get like 10 point every 10 second for each citadel you own (But I think i can handle that trigger though)
I've created this trigger so far, and what it does:
It checks for each Citadel which are killed and then respawn the killed Citadel.
But the problem is that it just respawns the Citadel in the Attackin Units ownership.
I want it to check if the AttackingUnit equal to Team 1 or Team 2, and then spawns a Citadel equal to the owner of the AttackingUnit. Because then I'm able to check how many citadels team 1 and 2 have captured duing the game.

Code:
Destroy Citadel Hostile
    Events
        Unit - A unit Dies
    Conditions
    Actions
        Set Citadel = (Dying unit)
        Set AttackingUnit = (Killing unit)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Or - Any (Conditions) are true
                    Conditions
                        (Unit-type of Citadel) Equal to Citadel A
                        (Unit-type of Citadel) Equal to Citadel B
                        (Unit-type of Citadel) Equal to Citadel C
                        (Unit-type of Citadel) Equal to Citadel D
                        (Unit-type of Citadel) Equal to Citadel MID
                (Owner of Citadel) Equal to Player 12 (Brown)
            Then - Actions
                Unit - Remove Citadel from the game
                Unit - Create 1 (Unit-type of Citadel) for (Owner of AttackingUnit) at (Position of Citadel) facing Default building facing degrees
            Else - Actions
                Game - Display to (All players) the text: FAIL


I hope you all understand this, else I'll try to explain in more detail or what ever :)
 

afisakov

You can change this now in User CP.
Reaction score
37
well, the fastest way to achieve that would be to change trigger to say:
Trigger:
  • If - Conditions
    • Or - Any (Conditions) are true
    • Conditions
    • Owner of (Killing unit)Equal to Player 1
    • Owner of (Killing unit)Equal to Player 2
    • Owner of (Killing unit)Equal to Player 3
    • Owner of (Killing unit)Equal to Player 4
    • Owner of (Killing unit)Equal to Player 5
    • Then - Actions
    • Unit - Create 1 (Unit-type of Citadel) for Player 1 at (Position of Citadel) facing Default building facing degrees
    • Else - Actions
    • Unit - Create 1 (Unit-type of Citadel) for Player 6 at (Position of Citadel) facing Default building facing degrees


instead of
Trigger:
  • Unit - Create 1 (Unit-type of Citadel) for (Owner of AttackingUnit) at (Position of Citadel) facing Default building facing degrees

sorry if code is imperfect but it should be close enough to get the idea.
Also I assumed player 12 does not kill citadels, if he does it would need a separate if/then/else statement for owner =6-11 instead of just putting it under "else"

then you would assigning points based on citadels owned by player 1 vs player 6.
not perfect but you don't seem to ave enough players left to section one off for "team 1" and another for "team 2"

unless of course you want to make red team 1, blue team 2. 3-7 players on team 1, 8-12 players on team 2, and citadels owned by neutral hostile.
of course players specifically named team 1 or team 2 would be unplayeable. just a thought
 

Solu9

You can change this now in User CP.
Reaction score
216
Is it mandatory that the new Citadels are created for player 1 and 6?
If not:

Trigger:
  • Test 4
    • Events
    • Conditions
    • Actions
      • Unit - Create 1 Castle for (Owner of (Killing unit)) at (Center of (Playable map area)) facing Default building facing degrees


Should be sufficient, no?
 

afisakov

You can change this now in User CP.
Reaction score
37
Well, in the original post he said
But the problem is that it just respawns the Citadel in the Attackin Units ownership.
so I thought he didn't want to do it for attacking unit, that is why I tried to make them all for 1 player that would be considered as the team one.
Of course, it would help to hear from the original poster what exactly he wants and whether the ideas we posted are sufficient.
 

lummerlars

Member
Reaction score
2
If been off for a while but I've seen the posts now and I think if found out the problem.
Okay afisakov, your ideer is actually what I need. I needed a trigger that seperated the two teams from eachother like, If player 1-5 kills a citadel then the citadel will respawn in what's ment to be team 1 and else it will respawn in team 2. There are 2 teams, Team 1 (player 1-5) and team 2 (player 6-10). Now player 12 is just a computer who's not able to kill any citadels. It's a computer which is the owner of the citadels in the beginning and I'll might make som creeps around the map who' owned by player 12 aswell.
Thanks for the help!
 
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