Jump to content
Sign in to follow this  
snkman

OFP Random Select did not work Correctly!

Recommended Posts

Hi Guy's,

well i have a Mission and i use Dynamic start with Random Select.

The problem is i have 2 Players in a team ( Player1, Player2 ) they bouth should start from different Places on the Map in 1 Team.

The problem is, sometimes they start from different places well i try to explain:

P1 and P2 should be toghetter but every time on an other place.

Sometimes it happends, that they start seperated.... P1 in Noth and P2 in South of the Map.

Well here are the Scripts i use:

move.sqs

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

? !(local Suche):exit

~3

_movepos=[pos1,pos2,pos3,pos4,pos5,pos6,pos7,pos8,pos9,pos10,pos11,pos12,pos13,pos14,pos15,pos16,

pos17] call RandomSelect

_unit1 = _this select 0

_unit1 setpos getpos _movepos

~2

({_x setpos getpos _movepos} forEach units _unit1)

exit

Well about the next 2 Script's i do not know what exactley they do cuz i just copy and past them from another Mission, where i saw Random Select the first time... But i think they are used for Random Select.

randomselect.sqf

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

//RandomSelect 1.1 by Daddldiddl

private ["_list","_ntotal","_random","_result","_ziel"];

_list=_this;

_ntotal=count _list;

_random=random(_ntotal);

_result=_random - ((_random) mod (1));

if (_result==_ntotal) then {_result=_result-1};

_ziel=_list select _result;

_ziel

rands.sqs

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

;================

;preload function

;================

RandomSelect = preprocessFile "randomselect.sqf"

?!(local Server):EXIT

exit

Now on the Editor i have Triggers with the Names: pos1,pos2,pos3,pos4,pos5,pos6,pos7,pos8,pos9,pos10,pos11,pos12,pos13,pos14,pos15,pos16,pos

17

So on the Locations with the Triggers the two Soldiers should start but sometimes they start on 2 different places?

B.t.w. I use Action Hud, Group Link II and Mapfact Respawn as well... Can this be a Problem ( Teleport from Group Link II is still enabled )

Someone can help me plz... confused_o.gif

Share this post


Link to post
Share on other sites

Easiest thing to do would be to make a trigger that executes few seconds into the mission with this in the On Activation field:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">player2 setPos (getPos player1)

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  

×