Setting Alliance.

BassZ

New Member
Reaction score
1
Now I'm sure you have all seen numerous topics about setting an alliance but i looked all over the forums and could not find specifically what i needed...

I'm making a game where when you first start you are asked to join a faction. Either Empire of Legion.

I want a trigger that basically works like this...

When you enter the empire becon it sets your faction as lets say 1, legion would be 2.

Once you have chosen your faction the trigger constantly checks and depending on what team you are on it allies you to everyone in that team while setting you as an enemy to everyone else. so lets say...

player 1,3,4,5,11 are faction 1
player 2,6,12 are faction 2

Make it so everyone in faction 1 is allied with each other but enemy's with faction 2 and vice-versa.

Ive spent 3 hours racking my mind :banghead: on how to do this so if someone could help that would be awesome :shades:
 

mastah_

New Member
Reaction score
5
Now I'm sure you have all seen numerous topics about setting an alliance but i looked all over the forums and could not find specifically what i needed...

I'm making a game where when you first start you are asked to join a faction. Either Empire of Legion.

I want a trigger that basically works like this...

When you enter the empire becon it sets your faction as lets say 1, legion would be 2.

Once you have chosen your faction the trigger constantly checks and depending on what team you are on it allies you to everyone in that team while setting you as an enemy to everyone else. so lets say...

player 1,3,4,5,11 are faction 1
player 2,6,12 are faction 2

Make it so everyone in faction 1 is allied with each other but enemy's with faction 2 and vice-versa.

Ive spent 3 hours racking my mind :banghead: on how to do this so if someone could help that would be awesome :shades:
unless theres another way of changin faction you wouldn't need it constantly checked.. just make it
Event - Unit enters region
Condtions - whatever here
Actions - set alliance of etc etc
 

BassZ

New Member
Reaction score
1
unless theres another way of changin faction you wouldn't need it constantly checked.. just make it
Event - Unit enters region
Condtions - whatever here
Actions - set alliance of etc etc

ok i hate to say this but that did not help at all.

Basically i need it so if you are in faction 1 you join lets say force 1 and everyone in force 1 allies each other. But unfortunately unless someone can give specifics im at a loss here.
 

BassZ

New Member
Reaction score
1
anyone?

anyone? I understand what i am asking is semi complex but anyone know what i need?
 

Mike889

New Member
Reaction score
15
Hmm... You should make the factions in the Forces Editor. So, when the game starts you make your dialog screen and put the choices. If trig player choses Fact 1 then change player froce to fact 1 else change player force to Fact 2.
Ah, and the rules say that you need to wait 24 hours to bump your topic, xD


I hope i helped you. ^^
 

BassZ

New Member
Reaction score
1
Hmm... You should make the factions in the Forces Editor. So, when the game starts you make your dialog screen and put the choices. If trig player choses Fact 1 then change player froce to fact 1 else change player force to Fact 2.
Ah, and the rules say that you need to wait 24 hours to bump your topic, xD


I hope i helped you. ^^

Yes i have the forces made but how to change a player to another force and make them allied with everyone on that force even if someone new joins idk what commands that is in trig edditor.

btw sorry didnt know that i needed to wait 24hrs to bump my bad.
 

Sinan2

New Member
Reaction score
9
Code:
Player Group- Pick All Players in Empire and do (Actions)
Player Group - Make (Picked Player) treat (All players matching (((Matching player) is in Empire) Equal to True)) as an Ally with shared vision
Do the same for legion.
 

BassZ

New Member
Reaction score
1
Code:
Player Group- Pick All Players in Empire and do (Actions)
Player Group - Make (Picked Player) treat (All players matching (((Matching player) is in Empire) Equal to True)) as an Ally with shared vision
Do the same for legion.

Here is the thing in Player Group- i cant seam to be able to select a force, only a specific player.
 

Sinan2

New Member
Reaction score
9
Code:
Player Group - Pick every player in empire and do (Actions)
            Loop - Actions
                Player Group - Make (Player group((Picked player))) treat (All players matching (((Matching player) is in empire) Equal to True)) as an Ally with shared vision
Why shouldn't you be able to select the player? I can do it in the editor.
 

BassZ

New Member
Reaction score
1
Code:
Player Group - Pick every player in empire and do (Actions)
            Loop - Actions
                Player Group - Make (Player group((Picked player))) treat (All players matching (((Matching player) is in empire) Equal to True)) as an Ally with shared vision
Why shouldn't you be able to select the player? I can do it in the editor.

this is what is confusing me. How are you selecting empire? it dose not give me the option of choosing a force and every player in that force. It only gives me the option of picking specific players. Are you using a special editor? I'm using the standard wc3 editor.
 

Shadows

New Member
Reaction score
2
I have not really been paying attention to the other people posting or at least not there segments of code, but I am fairly sure they are using a variable. Probably a player group variable.
 

BassZ

New Member
Reaction score
1
I have not really been paying attention to the other people posting or at least not there segments of code, but I am fairly sure they are using a variable. Probably a player group variable.

Ok that makes sense, how would i assign players to variables?

edit: ok i got varibles and code set up just like that but its not working.
 

Shadows

New Member
Reaction score
2
Alrighty, I am paying full attention now. Post the code that you currently have up. I will take a look at it and try to find out whats wrong. Be sure to post anything involved with the trigger.
 

BassZ

New Member
Reaction score
1
Alrighty, I am paying full attention now. Post the code that you currently have up. I will take a look at it and try to find out whats wrong. Be sure to post anything involved with the trigger.

Events:
-A unit enters <choose empire>
Conditions:
Actions:
-Player Group-Pick every player in empire and do actions
-Loop actions
-Player Group - Make(player group((picked player))) treat (all players matching (((Matching player) is in empire) equal to true)) as an ally with shared vision.

that is all i have so i know there has to be more but idk what to do. I also need to initially set Player 12 as already in empire and player 11 as already in legion but don't know how.
 

Shadows

New Member
Reaction score
2
Learn from these codes, don't just copy and paste. =D

Anyway, as for setting player 11 and 12 into there separate groups, just use this trigger, it should set both of them.

Code:
SortComputers
    Events
        Map initialization
    Conditions
    Actions
        Player Group - Add Player 11 (Dark Green) to EmpireVariable
        Player Group - Add Player 12 (Brown) to EmpireVariable

As for sorting players, just change the trigger were needed. I am only going to make one for the Empire side, just change it enough to work for the Leigon side as well.

Code:
SortPlayers
    Events
        Unit - A unit enters Choose Empire <gen>
    Conditions
    Actions
        Player Group - Add (Owner of (Entering unit)) to EmpireVariable
        Player Group - Make EmpireVariable treat EmpireVariable as an Ally with shared vision
        Unit - Remove (Entering unit) from the game

To break that down so it is easy to understand...
+ Every time a unit enters the "Choose Empire" reigon, it activates the trigger
+ It places the owner of the unit that entered the reigon into the Empire Group
+ It resets all the alliances for the group so they are allied (the make emp.. treat emp... as an ally)
+ It then removes the unit that was used as a selector from the game.

If you want to improve this code, I suggest adding a condition so that only specific units can enter the regions (to help avoid problems). Also, you might want to think about using dialog boxes instead of regions if you know how to. And on a last note, I did not test this, but if I am fairly sure it will work. If for some reason it dose not, please post again soon and I will try to help you fix it.
 

BassZ

New Member
Reaction score
1
Learn from these codes, don't just copy and paste. =D

Anyway, as for setting player 11 and 12 into there separate groups, just use this trigger, it should set both of them.

Code:
SortComputers
    Events
        Map initialization
    Conditions
    Actions
        Player Group - Add Player 11 (Dark Green) to EmpireVariable
        Player Group - Add Player 12 (Brown) to EmpireVariable

As for sorting players, just change the trigger were needed. I am only going to make one for the Empire side, just change it enough to work for the Leigon side as well.

Code:
SortPlayers
    Events
        Unit - A unit enters Choose Empire <gen>
    Conditions
    Actions
        Player Group - Add (Owner of (Entering unit)) to EmpireVariable
        Player Group - Make EmpireVariable treat EmpireVariable as an Ally with shared vision
        Unit - Remove (Entering unit) from the game

To break that down so it is easy to understand...
+ Every time a unit enters the "Choose Empire" reigon, it activates the trigger
+ It places the owner of the unit that entered the reigon into the Empire Group
+ It resets all the alliances for the group so they are allied (the make emp.. treat emp... as an ally)
+ It then removes the unit that was used as a selector from the game.

If you want to improve this code, I suggest adding a condition so that only specific units can enter the regions (to help avoid problems). Also, you might want to think about using dialog boxes instead of regions if you know how to. And on a last note, I did not test this, but if I am fairly sure it will work. If for some reason it dose not, please post again soon and I will try to help you fix it.

thanks for the help and i try to learn, i did some experiments with it but nothing was working. I experiment with every tigger im given to make it feel just perfect through fine tuning. Sometimes i dont do much other times i make massive edits. This will help me in the long run, ty again for the help.
 

foodflare

You can change this now in User CP.
Reaction score
32
Try player group - set alliance, click the one just after the word treat, click the drop-down box that is alligned horizontally with the word function, and select allies of player, then click on the player who you want to change (in this case gray),that is the basics
 

BassZ

New Member
Reaction score
1
Code Problem.

I think there is a major leak in that code Shadows because about 5 seconds into the game the entire game freezes.
 

Shadows

New Member
Reaction score
2
Re-Post all of the triggers that you created so I can see them. As far as I can see, there is no reason for mine to glitch. Also, dose it only happen when you walk onto a region?

Edit: Also, please place them into the [ code ] and [ / code ] brackets (without spaces). It makes it a lot easier.
 

BassZ

New Member
Reaction score
1
Re-Post all of the triggers that you created so I can see them. As far as I can see, there is no reason for mine to glitch. Also, dose it only happen when you walk onto a region?

Edit: Also, please place them into the [ code ] and [ / code ] brackets (without spaces). It makes it a lot easier.

im going to pm you my map k.
 
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