Jump to content
Sign in to follow this  
galzohar

setPos for multiple players on the same position

Recommended Posts

Anyone knows of any problems that this might cause? Or will it always just end up finding a solution for them?

So far I have made missions with ~10-15 players setPos on the same position with nothing bad happening (as long as nobody misfires), but was wondering if there could be problems when there are more players, say 25-50. At least if we assume that the area has enough free space to contain that many players if they were to walk them by themselves.

Share this post


Link to post
Share on other sites

kylania showed me a simple code awhile ago with spawning in a random pos to avoid just this:

i dont remember the exact details, but anyway:

(vehicle _this) SetPos [(getMarkerPos "base" select 0)-200*sin(round(random 359)),(getMarkerPos "base" select 1)-200*cos(round(random 359))];

i think the 200 is the max radius from the position, and 359 is a random direction from the position.

Share this post


Link to post
Share on other sites

I've been using the same thing as Demonized. 200 is the radius, yes, but it's also massive. I use 15 :D

Share this post


Link to post
Share on other sites

I don't really care how cluttered the players will be, as long as they don't do anything funny like dying/flying/etc. At lesat with lower player counts (up to 15) it'll simply put the players very very close to eachother, but not really cause any problems. I just wonder if anyone tried testing with more.

I'd test with AI but they behave completely different in such situations (they don't seem to have the same "anti-collision" mechanics as players do).

Share this post


Link to post
Share on other sites

I've tested this multiple times, actually with vehicles. Set the radius to 30 and you'll be golden.

Share this post


Link to post
Share on other sites

players can die or get stuck - do NOT setPos them into the exact same position

Share this post


Link to post
Share on other sites
players can die or get stuck - do NOT setPos them into the exact same position

Hence the randomness in it.

Share this post


Link to post
Share on other sites

Spacing as in the radius? If so, hell no :P at the least use 10 as the radius and you really shouldn't have any problems.

Share this post


Link to post
Share on other sites

Spacing = minimum distance between each 2 players, not radius to use as random :)

Anyway, I decided to just use their editor relative positions so that they will end up in the same formation that they started in the editor, since the origianl "formation" in the editor had just good enough spacing (tight enough yet spaced enough so that they don't get "pushed around").

Is findEmptyPosition reliable? Does it work similarly to how createVehicle creates the vehicle in the nearest viable spot?

Additionally, what happens when many players respawn to the same respawn marker? Does this cause similar issues to setPos or does the game handle it differently in this case?

Edited by galzohar

Share this post


Link to post
Share on other sites

i think with the default MP respawn the units are placed in empty positions, not on top of eachother.

at least thats what ive observered.

just test with 20 playable AI in a MP mission with respawn, place them together and drop a LGBU amongst them.

Share this post


Link to post
Share on other sites
place them together and drop a LGBU amongst them.

This is a solid troubleshooting technique for basically any problem you might encounter in ArmA2 to be honest.

Share this post


Link to post
Share on other sites
This is a solid troubleshooting technique for basically any problem you might encounter in ArmA2 to be honest.

It's how I fix script errors :)

Share this post


Link to post
Share on other sites

AI collision detection works differently than for players, though. But they probably deserve the GBU anyway.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×