JPreston 10 Posted May 30, 2013 Couple of questions for the experts today. I've got a co-op mission that works perfectly if I set the number of respawns (I've got a basic respawn limiter) and the number of enemies. I have however, been trying to get the mission to auto-balance itself. So if more players join, more enemies are spawned and the respawn limit is upped. Initially I tried using: players = playersNumber west; publicvariable "players"; But as I'm sure you know that returns the number of playable AI, so the respawn limit always get set as if there are 10 players. Is there any work around for this as it is doing my head in! Also I was trying to use the "Condition of presence: players >=5;" field to spawn more AI when there are more players. I cannot get them to spawn, anyone got any ideas? Thanks in advance. J Share this post Link to post Share on other sites
Larrow 2821 Posted May 30, 2013 Try numPlayers = {isPlayer _x} count playableUnits; Condition looks ok, could try wrapping it in () maybe. Share this post Link to post Share on other sites
JPreston 10 Posted June 3, 2013 Ok, after a few days of fiddling I've finally got my respawn system to work as intended. I still cannot get these AI units to spawn though. Tired wrapping the condition in () as suggested, to no avail. Has anyone got any ideas about this? J Share this post Link to post Share on other sites
samatra 85 Posted June 3, 2013 (edited) players = ({isPlayer _x} count playableUnits); Should properly count players. You can debug the value with systemChat str(players); to see what value "players" has at certain moment in your script. (will output value into chat) Also if you use this variable just once you can simply avoid using variable completely: if(({isPlayer _x} count playableUnits) > 5) then { //something }; Or use it in equation: _number_of_ai_to_spawn = (({isPlayer _x} count playableUnits) * 5) min 10; Edited June 3, 2013 by SaMatra Share this post Link to post Share on other sites