Jump to content

Recommended Posts

Hey guys,

 

I am trying myself on a remoteExec. The idea is, that on the execution of the remoteExec (which can only be triggered by the Game Master) every player gets teleported to their starting position by evaluating in which truck they are sitting.

I was hoping that I could get the player object in the remoteExec but nothing happens. Is there a way to get the Player in a remoteExec that i completely missed?

Thanks for your help.

_vehicle = (vehicle player);

switch (_vehicle) do
{
	case "truck_alpha": 	{ player setPos (getMarkerPos "mrk_start_alpha"); };
	case "truck_bravo":		{ player setPos (getMarkerPos "mrk_start_bravo"); };
	case "truck_charlie":	{ player setPos (getMarkerPos "mrk_start_charlie"); };
	case "truck_delta":		{ player setPos (getMarkerPos "mrk_start_delta"); };
	case "truck_echo":		{ player setPos (getMarkerPos "mrk_start_echo"); };
	case "truck_sierra":	{ player setPos (getMarkerPos "mrk_start_sierra"); };
};

 

Share this post


Link to post
Share on other sites

Hello. remoteExec: See BIKI.
Note: As you are in multiplayer, each player runs an initPlayerLocal.sqf at start. Create it at root of mission folder, where the mission.sqm is.
You just need to write your code inside.

While in game, instead of player (which is local, so the game master itself!), you can teleport, running your script for a unit (you need to know who is  who).
For example, you want to teleport player1 who is logged as player1 unit (named like that).

No need to remoteExec because setPos is AG EG (argument global, so can be remote), effect global (so, all PCs will be sync with that).
_vehicle = (vehicle player1); ... player1 setPos ....

Share this post


Link to post
Share on other sites

Hey pierremgi,

yes I know. Sorry, was maybe a bit of a sloppy wording.

 

The idea is that the script that is executed via remoteExec and so every player would run that script. There is a lot more happening in the script, creating a mission intro with a bit of story background at the start of the mission. While this is running, the player should get teleported to the starting position of the mission.

The thing is, I don't want to run it on the initPlayerlocal.sqf because when the mission is started at on the server, the players start in a base where they can choose their loadout and so on. So this must be an event triggered by the Zeus responsible for the mission control when all Players are ready.

Therefor I want a Zeus activate the script "start_mission.sqf" via remoteExec and now my problem is that I need to get the player object in the remoteExec. My idea was, that because remoteExec fires on every client (at least when configured that way) so this should guarante that all Players should teleport at the same time and see the Mission Intro.

So thats the idea behind all of that.

Share this post


Link to post
Share on other sites

Well, the Idea was that the teleport happens during the mission Opening that has to be remoteExec so titletext and music are played on every client. I also want to be sure the teleport happens while the screen is black. So there was the idea to execute everything in one Script.

Share this post


Link to post
Share on other sites

Thanks man, great hint.

On 1/12/2023 at 11:00 AM, killzone_kid said:

try 
 


switch (vehicleVarName _vehicle) do



instead of

 


switch (_vehicle) do 

 

 

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

×