• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

need help with Allaince settings

Status
Not open for further replies.
Level 3
Joined
Jun 3, 2007
Messages
50
please help me how to write up a trigger for the following?

If you ever played Star Wars BattleFront, then perhaps you'll get what I'm trying to do. So here goes:

Here's a brief summary of the scenario:
So there are 12 players on my map, divided into 2 teams. the objective is to capture the opposing teams "capitals" (i.e.: Tree of Hall/Ages/Eternity, Town Hall/Keep/Castle, Great Hall/Stronghold/Fortress, Necropolis/Halls of the Dead/Black Citadel), by destroying it. Once destroyed, the player whose hall was destroyed/captured then joins its opponent's team. Eventually the goal is for each team to capture ALL of their opponent's capitals in order to achieve victory.

Trigger:
I've attempted to make a trigger, but as usual, I've failed.

  • Fallen Capital
    • Events
      • Unit - Town Hall 0028 <gen> Dies
    • Conditions
    • Actions
      • Player - Make Player 1 (Red) treat Player 2 (Blue) as an Ally with shared vision
The only problem is that I need a trigger that makes Player 1 join the team that conquered its capital, instead of allying itself to a single player. Like I can't find an option where it says "Make Player 1 (Red) treat Force 2 as an Ally with shared vision.

I'm also trying to find how to resurrect/respawn the capital that was destroyed and still retain its trigger properties, so that when the other team wishes to retake one of its fallen capital, they can still have that chance! So suppose I managed to capture your capital, you then have joined my team and your capital is then respawned and your forces will aid my team in continuing the fight to capture the other capitals of the opposing team by destroying them and get them to join our side of the fight. Once a team has completely captured all enemy capitals, they win the game.

Thank You for your help. :infl_thumbs_up:
p.s. I will credit your screenname on the trigger as I have done with all those who have helped me make this map I'm making for MONTHS! :grin:
 
Level 9
Joined
Jun 26, 2007
Messages
659
munchkin way:
use a 12-sized array of integer (here called ForceId)
initialize it with number corresponding to force of each players (1 or 2)

every time a player (n) change force, do this:
  • UpdateAlliance (warning: french translated trigger)
    • Set ForceId[n] = (3 - ForceId[n])
    • 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
            • ForceId[(Integer A)] Equal to ForceId[n]
          • Then - Actions
            • Player - Make (Player((Integer A))) treat (Player(n)) as an Ally with shared vision
          • Else - Actions
            • Player - Make (Player((Integer A))) treat (Player(n)) as an Ennemy
 
Last edited:
Level 3
Joined
Jun 3, 2007
Messages
50
um I have some questions regarding to your trigger Yoshi:

so which function do I choose for the variable "n"?
I've noticed that you mentioned "every time a player (n) change force..." so I'm assuming its probably one of the player functions? but which one do I choose specifically? thanks again. ^.^
 
Level 9
Joined
Jun 26, 2007
Messages
659
n is not a variable, and my sample is a part of every trigger wich need a force update
for exemple in your's:
  • Fallen Capital
    • Events
      • Unit - Town Hall 0028 <gen> Dies
    • Conditions
    • Actions
      • Set ForceId[2] = (3 - ForceId[2])
      • 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
              • ForceId[(Integer A)] Equal to ForceId[2]
            • Then - Actions
              • Player - Make (Player((Integer A))) treat (Player(2)) as an Ally with shared vision
            • Else - Actions
              • Player - Make (Player((Integer A))) treat (Player(2)) as an Ennemy
(and don't forget i only show you a global way to do it)
 
Last edited:
Level 3
Joined
Jun 3, 2007
Messages
50
thanks Yoshi, that explains alot, but (forgive me), so when I do a force update I would use this trigger, but which areas would I modify though?

so what I'm saying is which area of the trigger do I modify to switch the affected player to either Team 1 or to Team 2. In this map I'm making there are only 2 teams.


oh one other thing, so I'm trying to write up the trigger you made. I'm having problems finding where you got the
  • Player - Make (Player((Integer A))) treat (Player(2)) as an Ally with shared vision
like I'm making the action in Player Group - Set Alliance
so I'm clicking on (All players) and I'm trying to find the (Integer A) part? I'm assuming its somewhere in the variables area, but its empty??? please help. :bored:
 
Last edited:
Level 9
Joined
Jun 26, 2007
Messages
659
Set Alliance doesn't change the team of the players, but only the relation they have
(i don't know if something to really change the teams exist in triggers)

For the Integer A, you can find it in the "Function" combo box at the top "For Loop Interger A"
(well, it's it if it's the same in the english editor, i've the french one)
 
Last edited:
Level 3
Joined
Jun 3, 2007
Messages
50
Thanks Again

Thanks Yoshi, one last request, could you/or someone else explain to me what each trigger does? Sort of give me a more intricate detail on each line?

Here is the trigger I wrote from the example you provided:

  • Fallen Capital
    • Events
      • Unit - Castle 0028 <gen> Dies
    • Conditions
    • Actions
      • Set ForceId[2] = (3 - ForceId[2])
      • 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
              • ForceId[(Integer A)] Equal to ForceId[2]
            • Then - Actions
              • Player - Make (Player((Integer A))) treat (Player(2)) as an Ally with shared vision
            • Else - Actions
              • Player - Make (Player((Integer A))) treat (Player(2)) as an Enemy
like what does the Integer A stand for?
or what does the "ForceId" or the [2] represent?
things like that. It would help me a great deal to know these things.
I'm sorry if I ask too much, but I'd like to learn. :grin:


Here I'll explain what happened when I applied the trigger, and the cause and effect it had. So this is what happened during the testing phase:

I destroyed Player 2's (blue) capital, and as a result, this event was met:
  • Events
    • Unit - Castle 0028 <gen> Dies
and thereby triggering this action:
  • Then - Actions
    • Player - Make (Player((Integer A))) treat (Player(2)) as an Ally with shared vision
So Player 2 is part of my team, there are 6 players in each team, here is a complete listing:

TEAM 1: THE ALLAINCE
Player 2 (Azeroth) *player affected by trigger above*
Player 3 (Dwarves)
Player 4 (Frostwolf Clan)
Player 7 (Khaldorei) *me*
Player 10 (Taurens)
Player 11 (Trolls)

TEAM 2: THE HORDE
Player 1 (Lordaeron)
Player 5 (Vampires)
Player 6 (Warsong Clan)
Player 8 (Blood Elf)
Player 9 (Nerubians)
Player 12 (Undead)

anyhow, when Player 2's capital was destroyed, Player 2 then became my enemy. end of story. :infl_thumbs_up:
 
Level 9
Joined
Jun 26, 2007
Messages
659
  • Fallen Capital
    • Events
      • Unit - Castle 0028 <gen> Dies
    • Conditions
    • Actions
      • Set ForceId[2] = (3 - ForceId[2]) [COLOR="SeaGreen"]the 2 is the index of the owner of Castle 0028, you can traduce it by something like "index of owner of dying unit"[/COLOR]
      • For each (Integer A) from 1 to 12, do (Actions) [COLOR="seagreen"]here is the "Interger A" setting, the following loop will be execute 12 time with value from 1 to 12 for "Interger A" (means, for each player)[/COLOR]
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ForceId[(Integer A)] Equal to ForceId[2] [COLOR="seagreen"]test if the player A in the same force than the player 2[/COLOR]
            • Then - Actions
              • If - Conditions
                • (Integer A) Not equal to 2 [COLOR="seagreen"]it may be a good idea to not ask the trigger so set alliance between player 2 and player 2 ^^'[/COLOR]
              • Then - Actions
                • Player - Make (Player((Integer A))) treat (Player(2)) as an Ally with shared vision
                • Player - Make (Player((2))) treat (Player(((Integer A))) as an Ally with shared vision [COLOR="seagreen"]I think you'll need to set it in the 2 way after all[/COLOR]
              • Else - Actions
            • Else - Actions
              • Player - Make (Player((Integer A))) treat (Player(2)) as an Enemy
              • Player - Make (Player(2)) treat (Player((Integer A))) as an Enemy
or what does the "ForceId" or the [2] represent?
ForceId is a 12-sized integer array corresponding to the force id of each player (for exemple, ForceId[8] = 2 means that player 8 is in force 2)

I think you chould replace all "2" by "index of (owner of(dying unit))"
If so, you'll be able to use 1 trigger with 12 events instead of 12 triggers with 1 event.

the "Set ForceId[2] = (3 - ForceId[2])" action is a shortcut to make:
  • If (ForceId[2] Equal to 1)
    • Set ForceId[2] = 2
  • Else [COLOR="seagreen"](ForceId[2] is equal to 2)[/COLOR]
    • Set ForceId[2] = 1
 
Last edited:
Level 9
Joined
Jun 26, 2007
Messages
659
Well

I've finaly worked on tour problem for real and this is the result:
(you can download the attached map to look it with your editor)

ForceId is an Integer 12-sized array with default value 0

  • ForceId Initialization
    • Evénements
      • Map initialization
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Boucle - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Si - Conditions
              • ((Player((Integer A))) controller) Différent de Aucun
            • Alors - Actions
              • Set ForceId[(Integer A)] = ((Team number of (Player((Integer A)))) + 1)
            • Sinon - Actions
  • Alliance Update
    • Evénements
      • Unité - A unit Meurt
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Dying unit)) Egal à Hôtel de ville
          • (Unit-type of (Dying unit)) Egal à Donjon
          • (Unit-type of (Dying unit)) Egal à Château
          • (Unit-type of (Dying unit)) Egal à Village
          • (Unit-type of (Dying unit)) Egal à Bastion
          • (Unit-type of (Dying unit)) Egal à Forteresse
          • (Unit-type of (Dying unit)) Egal à Nécropole
          • (Unit-type of (Dying unit)) Egal à Salle des morts
          • (Unit-type of (Dying unit)) Egal à Catacombes
          • (Unit-type of (Dying unit)) Egal à Arbre de vie
          • (Unit-type of (Dying unit)) Egal à Arbre des âges
          • (Unit-type of (Dying unit)) Egal à Arbre d'éternité
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Si - Conditions
          • ForceId[(Player number of (Owner of (Dying unit)))] Egal à 1
        • Alors - Actions
          • Set ForceId[(Player number of (Owner of (Dying unit)))] = 2
        • Sinon - Actions
          • Set ForceId[(Player number of (Owner of (Dying unit)))] = 1
      • For each (Integer A) from 1 to 12, do (Actions)
        • Boucle - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Si - Conditions
              • ForceId[(Integer A)] Egal à ForceId[(Player number of (Owner of (Dying unit)))]
            • Alors - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • Si - Conditions
                  • (Integer A) Différent de (Player number of (Owner of (Dying unit)))
                • Alors - Actions
                  • Joueur - Make (Player((Integer A))) treat (Owner of (Dying unit)) as an Allié avec vision partagée
                  • Joueur - Make (Owner of (Dying unit)) treat (Player((Integer A))) as an Allié avec vision partagée
                • Sinon - Actions
            • Sinon - Actions
              • Joueur - Make (Player((Integer A))) treat (Owner of (Dying unit)) as an Ennemi
              • Joueur - Make (Owner of (Dying unit)) treat (Player((Integer A))) as an Ennemi

I've also add a debug trigger that display the ForceId values when you type ForceId in the chat.
 

Attachments

  • (12)EmeraldGardens-Conquest.w3x
    314.2 KB · Views: 52
Last edited:
Level 3
Joined
Jun 3, 2007
Messages
50
Yoshiryu!

Well

I've finaly worked on tour problem for real and this is the result:
(you can download the attached map to look it with your editor)

ForceId is an Integer 12-sized array with default value 0

  • ForceId Initialization
    • Evénements
      • Map initialization
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Boucle - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Si - Conditions
              • ((Player((Integer A))) controller) Différent de Aucun
            • Alors - Actions
              • Set ForceId[(Integer A)] = ((Team number of (Player((Integer A)))) + 1)
            • Sinon - Actions
  • Alliance Update
    • Evénements
      • Unité - A unit Meurt
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Dying unit)) Egal à Hôtel de ville
          • (Unit-type of (Dying unit)) Egal à Donjon
          • (Unit-type of (Dying unit)) Egal à Château
          • (Unit-type of (Dying unit)) Egal à Village
          • (Unit-type of (Dying unit)) Egal à Bastion
          • (Unit-type of (Dying unit)) Egal à Forteresse
          • (Unit-type of (Dying unit)) Egal à Nécropole
          • (Unit-type of (Dying unit)) Egal à Salle des morts
          • (Unit-type of (Dying unit)) Egal à Catacombes
          • (Unit-type of (Dying unit)) Egal à Arbre de vie
          • (Unit-type of (Dying unit)) Egal à Arbre des âges
          • (Unit-type of (Dying unit)) Egal à Arbre d'éternité
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • Si - Conditions
          • ForceId[(Player number of (Owner of (Dying unit)))] Egal à 1
        • Alors - Actions
          • Set ForceId[(Player number of (Owner of (Dying unit)))] = 2
        • Sinon - Actions
          • Set ForceId[(Player number of (Owner of (Dying unit)))] = 1
      • For each (Integer A) from 1 to 12, do (Actions)
        • Boucle - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • Si - Conditions
              • ForceId[(Integer A)] Egal à ForceId[(Player number of (Owner of (Dying unit)))]
            • Alors - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • Si - Conditions
                  • (Integer A) Différent de (Player number of (Owner of (Dying unit)))
                • Alors - Actions
                  • Joueur - Make (Player((Integer A))) treat (Owner of (Dying unit)) as an Allié avec vision partagée
                  • Joueur - Make (Owner of (Dying unit)) treat (Player((Integer A))) as an Allié avec vision partagée
                • Sinon - Actions
            • Sinon - Actions
              • Joueur - Make (Player((Integer A))) treat (Owner of (Dying unit)) as an Ennemi
              • Joueur - Make (Owner of (Dying unit)) treat (Player((Integer A))) as an Ennemi

I've also add a debug trigger that display the ForceId values when you type ForceId in the chat.

:grin: OMG, DUDE, THANK YOU VERY MUCH!
ahem, I apologize for the caps, but thank you! :thumbs_up:
don't worry about the french thing, I sort of get the "gist" of it, but anyways, everything worked! and I've credited you on my alliance trigger. Again, many thanks! :eek: :smile:
 
Status
Not open for further replies.
Top