I've made Team Melee triggers (to be played on melee maps, teams of up to four controlling one 'player' each), and they work almost perfectly. The init trigger picks the first player from each (lobby) team, gives them melee starting units at their (random) spawn point, and then sets up all the team stuff like alliances and resource/supply sharing. The most complicated stuff, resources and supply, are totally fine.
However, computers aren't spawning. Here are the relevant init triggers:
I couldn't get computers to spawn for a while, but after taking a look at the premade lobby code here, I implemented the if-thens that you can see. When I did that, computers spawned exactly as they should have. I fixed a couple minor things in the resource sharing triggers, and now they don't. I feel sure that I didn't touch anything that would affect computers spawning, but I obviously have. Any ideas?
Messed around with this for a while - it seems that even though a lone computer on an otherwise empty team is in the top slot, it is NOT "Player 1 from (Players on team 1)". It looks like if there are no other players in game it'll be Player 4 for its team, but this isn't always true...I'm working on getting around this.
I got things working! If anyone else finds this looking for the same answer:
Computers do get weird slot/player values for lobby teams. What I ended up doing was checking if Player 1 of (Players from Team 1) was a user - if it returned Computer or None, pick all players from (Players on Team 1) and do what I need to - in this case, throw away all extra computers and spawn melee units for only one of them.
Also, specific to the map being Team Melee, there are way more players than Start Locations. This means there could be a collision (two players getting the same one), which makes one just not spawn. I got around this by making my own routine to assign them randomly rather than relying on what the game decides one.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Howdy,
I've made Team Melee triggers (to be played on melee maps, teams of up to four controlling one 'player' each), and they work almost perfectly. The init trigger picks the first player from each (lobby) team, gives them melee starting units at their (random) spawn point, and then sets up all the team stuff like alliances and resource/supply sharing. The most complicated stuff, resources and supply, are totally fine.
However, computers aren't spawning. Here are the relevant init triggers:
I couldn't get computers to spawn for a while, but after taking a look at the premade lobby code here, I implemented the if-thens that you can see. When I did that, computers spawned exactly as they should have. I fixed a couple minor things in the resource sharing triggers, and now they don't. I feel sure that I didn't touch anything that would affect computers spawning, but I obviously have. Any ideas?
Messed around with this for a while - it seems that even though a lone computer on an otherwise empty team is in the top slot, it is NOT "Player 1 from (Players on team 1)". It looks like if there are no other players in game it'll be Player 4 for its team, but this isn't always true...I'm working on getting around this.
I got things working! If anyone else finds this looking for the same answer:
Computers do get weird slot/player values for lobby teams. What I ended up doing was checking if Player 1 of (Players from Team 1) was a user - if it returned Computer or None, pick all players from (Players on Team 1) and do what I need to - in this case, throw away all extra computers and spawn melee units for only one of them.
Also, specific to the map being Team Melee, there are way more players than Start Locations. This means there could be a collision (two players getting the same one), which makes one just not spawn. I got around this by making my own routine to assign them randomly rather than relying on what the game decides one.