Modding, Mission Design, and Coding > The Scripting Workshop

Getting number of players in game

<< < (2/5) > >>

m!m:
The maximum number of SEXP variables is currently 250.

krevett62:
Ok thanks I should not go above this as only players need sexp variables (there's currently 14 of them) to be set so that the "host" can acces these variables too in the script.

karajorma:
I'm pretty certain there is a SEXP solution to this issue. But I'm not in front of my PC to check. Look at the multiplayer status SEXPs

Even if you can't check the number of players you can definitely loop through starting wings and test if they are players.

krevett62:
I'm using a script on gameplay start to hook the player then set the sexp variables corresponding to that player and a variable "isplayer" to true.

Then the main script looks for all sexp variables and puts them in a table so that the script can acces them easily (the table is updated when a sexp var may change) and is set to run with no restriction on single player (currently testing it seems to work fine) but will only run on Alpha 1's computer during a MP game to avoid conflicts (the script runs sexp that affect players and ai). I still need to test the MP side though.

karajorma:
I'm sure there is a quicker way to do that, but yeah, that should work.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version