Ok, I have searched but I could really find anything that described my problem.
I'm currently working on an extension mod to added various game-play modes to any game. many of the settings will be available through "Game Attributes" in the lobby and upon the start of the game I wish several actions to be taken.
For the more simple ones like: creating a building in the middle of map that does something, its fairly easy.
I've setup an attribute with statement "yes" or "no" wether this particular game addition must be used. If yes, the building is created and all is well.
But now I find myself making some attributes that are player specific.
Basically it comes down to having some subfactions for the 3 main factions.
My ideal wish is that I could expand the race selection screen with more entries.
But I can't find where this choice is made, inside the game attributes in the mod it doesn't show this.
So instead I elected to make a new game attribute which is player specific. It turns out that it adds a new 'slot' which shows the new options for subfactions, but these are not bound to the main race selection from what I see. In itself not really a problem.
What I'm striggling with is:
depedning on the choice say Terran faction B (starting out with a planetary fortress and 8 SCVs) I need to actually chance the starting units for the player that picked Terran faction B. But I can't get it to work. first I have no idea how to identify the player that choose this, and then how to I identify where the new starting units must be placed?
And last, I like to make the mod compatible for up to 10 players, so each players choices must be cycled through.
But how does one set a specific action to occur for a random player that can start at a random location?
I need help
@ choice
At the start of the map, you need to have a loop over all players and then process the player's choice within it meaning that you require checks for the player attribute's states.
So, you will end up with a trigger firing on "map initialization", looping over all "active players" and checking their player attributes within that loop in order to spawn the correct units for the selection made.
@ creating units
I would create new race entries (or better, duplicate & modify existing ones) in the data module and use the action that creates the starting units of a specified race at a specified point for a specified player. The point should be the starting point of that player.
Also, this allows you to easily transition back to a proper system once battle.net's lobby starts supporting custom races at all.
Just in the spirit of throwing out ideas: Perhaps have the game start up and a dialog appear asking which faction the player wants to join, then giving the appropriate starting units upon selection. Ahli's idea of making duplicate race entries in the data module sounds promising.
@ choice
At the start of the map, you need to have a loop over all players and then process the player's choice within it meaning that you require checks for the player attribute's states.
So, you will end up with a trigger firing on "map initialization", looping over all "active players" and checking their player attributes within that loop in order to spawn the correct units for the selection made.
@ creating units
I would create new race entries (or better, duplicate modify existing ones) in the data module and use the action that creates the starting units of a specified race at a specified point for a specified player. The point should be the starting point of that player.
Also, this allows you to easily transition back to a proper system once battle.net's lobby starts supporting custom races at all.
Thank you.
I also have used the module to create new races (from copies) and set the proper starting units. And this works fine (so 1 down I guess)
So far however it turns out that wrong players end up with the units of a faction they didn't pick.
What would be the best way to check these choices then?
Currently I have:
"Player Group - Pick each player in (Active Players) and do actions
- General - If (COnditions) then do (Actions) else do...
[condition]: If 'TERRAN B' = 'choose Faction' value for picked player
[action]: Melee - Create 'Terran B' starting units for (picked player)
I also added a remove unit action before this to make sure it would not try to create new units on top/next to the older starting unit.
In principle the action works, but not on the correct players.
I'm a bit confused how I can make it find the correct player.
What would be the best way to check these choices then? Currently I have:
"Player Group - Pick each player in (Active Players) and do actions - General - If (COnditions) then do (Actions) else do...
[condition]: If 'TERRAN B' = 'choose Faction' value for picked player
[action]: Melee - Create 'Terran B' starting units for (picked player)
I also added a remove unit action before this to make sure it would not try to create new units on top/next to the older starting unit. In principle the action works, but not on the correct players. I'm a bit confused how I can make it find the correct player.
Not for the correct players? Can you elaborate on that? Your approach looks fine and in theory it should work unless something else is wrong.
Ok, I have searched but I could really find anything that described my problem.
I'm currently working on an extension mod to added various game-play modes to any game. many of the settings will be available through "Game Attributes" in the lobby and upon the start of the game I wish several actions to be taken. For the more simple ones like: creating a building in the middle of map that does something, its fairly easy. I've setup an attribute with statement "yes" or "no" wether this particular game addition must be used. If yes, the building is created and all is well.
But now I find myself making some attributes that are player specific. Basically it comes down to having some subfactions for the 3 main factions.
My ideal wish is that I could expand the race selection screen with more entries. But I can't find where this choice is made, inside the game attributes in the mod it doesn't show this. So instead I elected to make a new game attribute which is player specific. It turns out that it adds a new 'slot' which shows the new options for subfactions, but these are not bound to the main race selection from what I see. In itself not really a problem.
What I'm striggling with is: depedning on the choice say Terran faction B (starting out with a planetary fortress and 8 SCVs) I need to actually chance the starting units for the player that picked Terran faction B. But I can't get it to work. first I have no idea how to identify the player that choose this, and then how to I identify where the new starting units must be placed? And last, I like to make the mod compatible for up to 10 players, so each players choices must be cycled through. But how does one set a specific action to occur for a random player that can start at a random location? I need help
Custom Campaign Initiative
@ choice
At the start of the map, you need to have a loop over all players and then process the player's choice within it meaning that you require checks for the player attribute's states.
So, you will end up with a trigger firing on "map initialization", looping over all "active players" and checking their player attributes within that loop in order to spawn the correct units for the selection made.
@ creating units
I would create new race entries (or better, duplicate & modify existing ones) in the data module and use the action that creates the starting units of a specified race at a specified point for a specified player. The point should be the starting point of that player.
Also, this allows you to easily transition back to a proper system once battle.net's lobby starts supporting custom races at all.
Just in the spirit of throwing out ideas: Perhaps have the game start up and a dialog appear asking which faction the player wants to join, then giving the appropriate starting units upon selection. Ahli's idea of making duplicate race entries in the data module sounds promising.
Thank you.
I also have used the module to create new races (from copies) and set the proper starting units. And this works fine (so 1 down I guess) So far however it turns out that wrong players end up with the units of a faction they didn't pick.
What would be the best way to check these choices then? Currently I have:
"Player Group - Pick each player in (Active Players) and do actions - General - If (COnditions) then do (Actions) else do...
I also added a remove unit action before this to make sure it would not try to create new units on top/next to the older starting unit. In principle the action works, but not on the correct players. I'm a bit confused how I can make it find the correct player.
Custom Campaign Initiative
Not for the correct players? Can you elaborate on that? Your approach looks fine and in theory it should work unless something else is wrong.
I assume you are already using it like this: