Jump to content
Tom212

[Solved] Issue with RemoteExec not running on client

Recommended Posts

Hi,

 

I'm having the following issue with remote Exec.

 

In my initServer file I have the following code:

FNC_SetupBunkerDoors = compile loadFile "scripts\bunkerDoors.sqf";
remoteExec ["FNC_SetupBunkerDoors"];

'bunkerDoors.sqf contains the following code':

BunkerAlphaInteriorDoor addAction ["Exit Bunker", {[player, BunkerAlphaExterior]execVM "scripts\doorTravel.sqf"}, nil, 1.5, true, true, "", "true", 4];
BunkerAlphaExteriorDoor addAction ["Enter Bunker", {[player, BunkerAlphaInterior]execVM "scripts\doorTravel.sqf"}, nil, 1.5, true, true, "", "true", 4];

The desired effect is that all players have the action to enter/exit the bunker. If I test this locally in singleplayer or MP the code executes on my client and works fine. But when testing with a local dedicated server with 'loopback=true' clients do not receive the action so I can only assume the code isn't executing on them.

 

I've tried changing the remoteExec line to the following in case the default value for target was incorrect on the wiki, or if for some reason my client was being treated as JIP but it didnt't solve the problem.

remoteExec ["FNC_SetupBunkerDoors",0,true];



Any idea what I might be doing wrong here? Any help would be greatly appreciated :).

Share this post


Link to post
Share on other sites
8 minutes ago, Tom212 said:

remoteExec ["FNC_SetupBunkerDoors"];

And thats supposed to do what?

If that function is not defined on the clients (which your code very much looks like) then it cannot execute it on the clients so nothing will happen.

If you want your code to execute on clients, you need to send it to them.

you could remoteExec "call" or "spawn", or publicVariable the function to them.

Also

8 minutes ago, Tom212 said:

I've tried changing the remoteExec line to the following in case the default value for target was incorrect on the wiki, or if for some reason my client was being treated as JIP but it didnt't solve the problem.

You will need to do that if you want it to work for JIP clients, initServer only runs once. If a player joins later, you wouldn't remoteExec it and the new player would never run your function and not get the actions.

  • Like 1

Share this post


Link to post
Share on other sites
3 minutes ago, Dedmen said:

And thats supposed to do what?

If that function is not defined on the clients (which your code very much looks like) then it cannot execute it on the clients so nothing will happen.

If you want your code to execute on clients, you need to send it to them.

you could remoteExec "call" or "spawn", or publicVariable the function to them.

 Also

You will need to do that if you want it to work for JIP clients, initServer only runs once. If a player joins later, you wouldn't remoteExec it and the new player would never run your function and not get the actions.

 

Awesome thanks that makes sense, missed that. Yeah I was planning on eventually adding JIP true, but just wanted to get it working in it's default settings first.

 

Appreciate the swift assistance, thank you!

Share this post


Link to post
Share on other sites

can also do

 

 [CMD] remoteexeccall ["FUNCTION",[0,-2] select isDedicated,true];

 

  • Like 1

Share this post


Link to post
Share on other sites
23 minutes ago, phatpuke said:

can also do

The function would still not be global.

The unscheduled execution is unnecessary.

The select prevents server execution but I can't see any need to do that here.

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

×