Jump to content
Sign in to follow this  
snkman

RandomSelect on Server doesn't work?

Recommended Posts

Hi Guys,

well i have a Mission with 2 playable teams a 6 Soldiers Team 1 ( p1,p2,p3,p4,p5,p6) Team 2 (p7,p8,p9,p10,p11,p12) and i use a RandomSelect Script so the mission always starts on different playces.

The move.sqf is activated once by the Team Leader of the first Team (p1) movepos=[this] execVM "randomSelect\move.sqf"

move.sqs

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">/////////////////////////////////////////////////////////////

// ArmA - Random Select move Script - By Unknown

/////////////////////////////////////////////////////////////

_all = [p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12];

if (!local Suche) exitWith {};

sleep 3;

_movepos=[gl_1,gl_4,gl_6,gl_7,gl_9,gl_10] call RandomSelect;

_unit1 = _this select 0;

_unit1 setpos getpos _movepos;

sleep 2;

{_x setpos getpos _movepos} forEach _all;

well like i told in the editor it always works just perfect but on a Server only the Human players are moving to the positions AI will not move..? mad_o.gif

Share this post


Link to post
Share on other sites

Cant think of whats wrong with that, allthough you didnt include the code in the actual function (randomselect).

Heres a way to move them, and I did a quick test that it works in dedi server.

http://www.derfel.org/arma/random_starting_position.zip

You can keep the game logics, but you dont have to add them in the script itself. You call the script like:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">nul=[gl1,gl2,gl3] execvm "move.sqf"

Do that in the "server" game logic rather than a unit (especially playable since they dont exist 100% of the time).

Add in any number of groups and men, then make a trigger with their side on them name it whatever you want. The name is used in the script. I named the trigger "westunits";

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

if (!local server) exitwith {};

sleep 1;

_pos = _this select floor(random count _this);

{ _x setpos getpos _pos } foreach list westunits;

You might want to do a small black in fade out at the start so the actual movement isnt shown for players.

Share this post


Link to post
Share on other sites

Hmm, small change... not gonna bother changing the zip thou...

We can just pass the trigger name as well, then we dont have to touch the script at all.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">nul=[westunits,[gl1,gl2,gl3]] execvm "move.sqf"

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

if (!local server) exitwith {};

sleep 1;

_t = _this select 0;

_a = _this select 1;

_pos = _a select floor(random count _a);

{ _x setpos getpos _pos } foreach list _t;

Share this post


Link to post
Share on other sites

AWESOME Shuko thumbs-up.gif

Work's like a Charm! smile_o.gif

Thank you very very much.

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  

×