Staredit Network > Forums > SC1 UMS Mapmaking Assistance > Topic: Problems with units spawning for players
Problems with units spawning for players
Apr 15 2010, 4:45 pm
By: BloodRed  

Apr 15 2010, 4:45 pm BloodRed Post #1



Ok, so i ve made a map that is 5 player and 3 comps.

the problem im having is that even in single player, when player 1 chooses the game type from the maps menu it spawns all 5 human players, where only one should spawn because only player 1 (me) is playing. and whats worse, even though i have triggers stating that players 1-5 are allied, and are locked as such, and they are allied in the forces menu, the units spawned for all the players attack each other.

this all happens in both single and multi-player. if there are 5 players in the game, player one chooses the game type and the units spawned proceed to kill each other. if there is only one player in the game, the other 4 players units are still spawned and the units proceed to kill each other.

i cant figure out why the extra units spawn and why, even though they are all allied, they still kill each other.

any help with this would be nice. ill try and post the map up soon, but man, im stumped.

Attachments:
Rural Dead Sneak Peek.scx
Hits: 0 Size: 63.5kb

Post has been edited 1 time(s), last time on Apr 15 2010, 5:46 pm by BloodRed.



None.

Apr 15 2010, 4:54 pm fat_flying_pigs Post #2



Quote from BloodRed
Ok, so i ve made a map that is 5 player and 3 comps.

the problem im having is that even in single player, when player 1 chooses the game type from the maps menu it spawns all 5 human players, where only one should spawn because only player 1 (me) is playing. and whats worse, even though i have triggers stating that players 1-5 are allied, and are locked as such, and they are allied in the forces menu, the units spawned for all the players attack each other.

this all happens in both single and multi-player. if there are 5 players in the game, player one chooses the game type and the units spawned proceed to kill each other. if there is only one player in the game, the other 4 players units are still spawned and the units proceed to kill each other.

i cant figure out why the extra units spawn and why, even though they are all allied, they still kill each other.

any help with this would be nice. ill try and post the map up soon, but man, im stumped.
Ok, I don't have time to look at the map, but my guess is that you are using triggers like:
Player 1,2,3,4,5
Condition: Something
Action:
Create unit for player 1
Create unit for player 2
Create unit for player 3
Create unit for player 4
Create unit for player 5

What this does is run the trigger for player 1, and creates units for all 5 players. If player 2 is there, it will run it for him too.

To solve this, make a trigger like this:

Player: 1,2,3,4,5
Condition: Something
Action: Create 1 unit for Current Player

So when only you are playing, the trigger only runs for you, and it only creates the unit you the "current player," aka: you. If player 1 and 2 are in the game, then the trigger will create it for "current player" for each player, creating units for players 1 and 2.



None.

Apr 15 2010, 4:58 pm BloodRed Post #3



ill look into how the trigger is made, because honestly ive done it both ways in other maps, i just dont remember which i did for this one.

however, this does not solve the biggest problem as to why they kill each other even when they are allied in every possible manner.



None.

Apr 15 2010, 5:32 pm NudeRaider Post #4

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Quote from fat_flying_pigs
Ok, I don't have time to look at the map, but my guess is that you are using triggers like:
Player 1,2,3,4,5
Condition: Something
Action:
Create unit for player 1
Create unit for player 2
Create unit for player 3
Create unit for player 4
Create unit for player 5
Almost, but not quite. The stated behavior happens when you designate a single player to "hand out" the units that are to be created for everyone.
So for example:
[Computer Player]
Condition: Something
Action:
Create unit for player 1
Create unit for player 2
Create unit for player 3
Create unit for player 4
Create unit for player 5


*looks back at BloodRed*
The easiest way to fix that is to preplace the units and set properties if necessary. They won't get created if the player isn't present.

The other solution is, as flying pigs said, to create for Current Player. This implies having the trigger owned by the respective players, rather than a "master player" and triggers owned by absent player won't run.

As a general rule NEVER create units for specific players (e.g. Player 1) if they are human. Use Current Player whenever possible. It makes trigging safer and more efficient.


Oh and BloodRed it would be nice if you could rename the title of your topic to something descriptive like "units for absent players still get created". Topic titles like that are against the rules and usually result in the topic being closed. The only thing that saved you from the close is your description which barely points into the right direction.

Post has been edited 1 time(s), last time on Apr 15 2010, 5:37 pm by NudeRaider.




Apr 15 2010, 5:47 pm BloodRed Post #5



this is all fine and dandy and im sure they will work, but how to i keep the allied units from killing each other? if you dl the map ull see that they are all allied in multiple ways, but they still kill each other.



None.

Apr 15 2010, 6:06 pm NudeRaider Post #6

We can't explain the universe, just describe it; and we don't know whether our theories are true, we just know they're not wrong. >Harald Lesch

Units that are created for players that don't exist (Ghost Players) are automatically unallied to everyone. But using the above methods they won't even get created so there's nothing that can attack.




Apr 16 2010, 10:49 am BloodRed Post #7



awesome. thanks guys. ill report back ina bit and tell u all if it worked.



None.

Options
  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[09:38 pm]
NudeRaider -- Ultraviolet
Ultraviolet shouted: NudeRaider sing it brother
trust me, you don't wanna hear that. I defer that to the pros.
[07:56 pm]
Ultraviolet -- NudeRaider
NudeRaider shouted: "War nie wirklich weg" 🎵
sing it brother
[06:24 pm]
NudeRaider -- "War nie wirklich weg" 🎵
[03:33 pm]
O)FaRTy1billion[MM] -- o sen is back
[2024-4-27. : 1:53 am]
Ultraviolet -- :lol:
[2024-4-26. : 6:51 pm]
Vrael -- It is, and I could definitely use a company with a commitment to flexibility, quality, and customer satisfaction to provide effective solutions to dampness and humidity in my urban environment.
[2024-4-26. : 6:50 pm]
NudeRaider -- Vrael
Vrael shouted: Idk, I was looking more for a dehumidifer company which maybe stands out as a beacon of relief amidst damp and unpredictable climates of bustling metropolises. Not sure Amazon qualifies
sounds like moisture control is often a pressing concern in your city
[2024-4-26. : 6:50 pm]
Vrael -- Maybe here on the StarEdit Network I could look through the Forums for some Introductions to people who care about the Topics of Dehumidifiers and Carpet Cleaning?
[2024-4-26. : 6:49 pm]
Vrael -- Perhaps even here I on the StarEdit Network I could look for some Introductions.
[2024-4-26. : 6:48 pm]
Vrael -- On this Topic, I could definitely use some Introductions.
Please log in to shout.


Members Online: jun3hong