Hey all,
I'm working on setting up a team melee map, which right now is under very limited constraints (2v1).
I keep getting an error at the start of each game when my Initialization trigger goes. For clarification, I'm testing this online using multiplayer so I can add in a computer teammate and a computer opponent.Here's what's in it:
InitializationEventsGame-MapinitializationLocalVariablesStartingPosition=NoPoint<Point[3]>
player = 0 <Integer>
Conditions
Actions
Melee - Start the melee AI for all computer players
Player - Modify player 1 Supplies Limit: Set To 400
Player - Turn player 1 Help Requests On towards player 2
Player - Turn player 2 Help Requests On towards player 1
Player - Turn player 1 Help Responses On towards player 2
Player - Turn player 2 Help Responses On towards player 1
Player - Turn player 1 Pushable On towards player 2
Player - Turn player 2 Pushable On towards player 1
Player - Turn player 1 Resource Spending On towards player 2
Player - Turn player 2 Shared Defeat On towards player 1
Player - Make player 1 and player 2 treat each other as Ally With Shared Vision And Control
Player Group - For each player player in (All players) do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
player != 2
Then
Variable - Set Starting Position[player] = (Start location of player player)
Melee - Create (Race of player player) melee starting units for player player at Starting Position[player]
Melee - Set (Race of player player) melee starting resources for player player
Else
Player 1 is the owner of the base (since you can't have a shared ownership), and Player 2 is the other member of the Team with control and spending.
Player 2 does not have any starting units generated because then it would just be having 2v1 with each player having shared control and spending, and wouldn't be a "Team Melee".
Also, I believe I managed to bug my map where I added in a computer and moved them to the opposing team, then added in my teammate. It made the person that was supposed to be my opponent my ally.
I've also had to make 'standard' melee defeat procedures for the computer player (player 3) and the unit owning player (player 1), but not apply them to player 2. If someone knows a better way of doing it than this, please let me know:
DefeatEventsTimer-Every1.0secondsofGameTimeLocalVariablesPickedUnit=NoUnit<Unit>PickedUnit2=NoUnit<Unit>player=0<Integer>structures=0<Integer[12]>
Conditions
Actions
Player Group - For each player player in (Enemies of player 1) do (Actions)
Actions
Variable - Set structures[player] = 0
Unit Group - For each unit PickedUnit in (Any units in (Entire map) owned by player player matching Required: Structure, with at most Any Amount) do (Actions)
Actions
Variable - Modify structures[player]: + 1
General - If (Conditions) then do (Actions) else do (Actions)
If
structures[player] == 0
Then
Game - End game in Defeat for player player (Show dialogs, Show score screen)
Player Group - Pick each player in (Enemies of player player) and do (Actions)
Actions
Game - End game in Victory for player (Picked player) (Show dialogs, Show score screen)
Else
Unit Group - For each unit PickedUnit2 in (Any units in (Entire map) owned by player 1 matching Required: Structure, with at most Any Amount) do (Actions)
Actions
Variable - Modify structures[1]: + 1
General - If (Conditions) then do (Actions) else do (Actions)
If
structures[1] == 0
Then
Game - End game in Defeat for player 1 (Show dialogs, Show score screen)
Else
Change this :
Player Group - For each player player in (All players) do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
player != 2
Then
Variable - Set Starting Position[player] = (Start location of player player)
Melee - Create (Race of player player) melee starting units for player player at Starting Position[player]
Melee - Set (Race of player player) melee starting resources for player player
Else
into:
Player Group - Pick each player in (All players) and do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
(Picked player) != 2
Then
Else
with the other thing I can't help you.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hey all, I'm working on setting up a team melee map, which right now is under very limited constraints (2v1). I keep getting an error at the start of each game when my Initialization trigger goes. For clarification, I'm testing this online using multiplayer so I can add in a computer teammate and a computer opponent.Here's what's in it:
Player 1 is the owner of the base (since you can't have a shared ownership), and Player 2 is the other member of the Team with control and spending. Player 2 does not have any starting units generated because then it would just be having 2v1 with each player having shared control and spending, and wouldn't be a "Team Melee".
Also, I believe I managed to bug my map where I added in a computer and moved them to the opposing team, then added in my teammate. It made the person that was supposed to be my opponent my ally.
I've also had to make 'standard' melee defeat procedures for the computer player (player 3) and the unit owning player (player 1), but not apply them to player 2. If someone knows a better way of doing it than this, please let me know:
That's a lot of script. What error message are you getting (copy paste plz)
@Anthius: Go
Change this : Player Group - For each player player in (All players) do (Actions) Actions General - If (Conditions) then do (Actions) else do (Actions) If player != 2 Then Variable - Set Starting Position[player] = (Start location of player player) Melee - Create (Race of player player) melee starting units for player player at Starting Position[player] Melee - Set (Race of player player) melee starting resources for player player Else
into: Player Group - Pick each player in (All players) and do (Actions) Actions General - If (Conditions) then do (Actions) else do (Actions) If (Picked player) != 2 Then Else
with the other thing I can't help you.