Jump to content
Sign in to follow this  
Nephris1

Updating "start" marker in briefing

Recommended Posts

Hi folks,

i hope you can give me advice in this.

My missions (MP - dedicated Server) shall use random stzarting positions.

Moving the player and few objects to that random start position

does shk_moveobjects script.

Additionally i move the marker to that position

if isserver then {

_pads = [hpad2, hpad1, hpad3, hpad4, hpad5, hpad6, hpad7, hpad8] ;

_dest = _pads select (floor (random count _pads));

[siteObjects,_dest,75] execvm "shk_moveobjects.sqf";

sleep 0.1;

"start" setmarkerpos (getpos siteObjects);

;

};

The problem:

When the briefing is loaded, the "start" marker is still on a dummy location, and moves to the actual starting position after the player has spawned.

That way i cant refer to the "start" marker in the briefing itself, which can be annoying for a team to plan its misison, as the "start" marker gets updated later to the correct starting postion.

I hope i was able to point out my problem correct.

So how is it possible to get the "start" marker updated at the corresponding start postion and show it in the briefing before the player gets spawned?

Share this post


Link to post
Share on other sites

Put this into any Hpad's init field:

if isserver then {
 SHK_moveobjects = compile preprocessfile "shk_moveobjects.sqf";
 _pads = [hpad2, hpad1, hpad3, hpad4, hpad5, hpad6, hpad7, hpad8] ;
 _dest = _pads select (floor (random count _pads));
 [siteObjects,_dest,75] call SHK_moveobjects;
 "start" setmarkerpos (getpos _dest);
};

Share this post


Link to post
Share on other sites

Thx for both inputs.

But neither

Remove sleep 0.1;.

nor

if isserver then {
 SHK_moveobjects = compile preprocessfile "shk_moveobjects.sqf";
 _pads = [hpad2, hpad1, hpad3, hpad4, hpad5, hpad6, hpad7, hpad8] ;
 _dest = _pads select (floor (random count _pads));
 [siteObjects,_dest,75] call SHK_moveobjects;
 "start" setmarkerpos (getpos _dest);
};

did the trick.

The "start" marker in the briefing has still a different location than the "start" marker after the player spawned.

:confused:

Share this post


Link to post
Share on other sites

The server is probably trying to make client(s) move the marker before they have even created it. So, either make clients wait (not nice for briefings) or create the marker locally for each client.

You could also try something I've made to address the random start + object moving: SHK_randstapos

Share this post


Link to post
Share on other sites

Thx gonna try that out.

Your script resources, are always first adress reposity for me.:)

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  

×