Jump to content
Sign in to follow this  
nullsys

Radio trigger local, but executed commands need to be global, please help

Recommended Posts

I'm having an issue with locality on a dedicated server.

Can someone please help me out?

I have a random objective generator (simple random number generator, with a switch statement) which calls the corresponding SQF for each objective type.

This is activated through a radio trigger for the team leader.

Unfortunately, I have hints and BIS_fnc_showNotification's in there, which work in the editor and for the radio activator in multiplayer....but they do not show up for everyone else.

How can I still keep the objective generator script only activated by one unit, but also:

1. Show hints and bis_fnc_showNotification's for each player.

2. Run addActions and CreateUnits globally (if the player runs these, they are local and of course don't function accordingly for other players).

Thank you!

Share this post


Link to post
Share on other sites

Thank you, just using that on the hints/tasks would work for me perfectly.

If I want to 'call compile preprocessFile' some scripts from the objective generator script (activated by the players radio trigger), but only have them run on the dedicated server side, how would I do that?

Would I just put:

if (isServer) then {call compile preProcessFile "mission1.sqf";};

In the objective generator script?

Share this post


Link to post
Share on other sites

You could still use BIS_fnc_MP, just set the third parameter to false:

[[[script params],"script.sqf"],"BIS_fnc_execVM",false,false,false] call BIS_fnc_MP;

EDIT: Misread a bit, above would be to execute the script on the server only, you could just do the call compile in the initServer.sqf, just make sure anytime you call that function that it is called from the server.

Edited by JShock

Share this post


Link to post
Share on other sites
You could still use BIS_fnc_MP, just set the third parameter to false:

[[[script params],"script.sqf"],"BIS_fnc_execVM",false,false,false] call BIS_fnc_MP;

EDIT: Misread a bit, above would be to execute the script on the server only, you could just do the call compile in the initServer.sqf, just make sure anytime you call that function that it is called from the server.

Thank you, this would execute the script on the server, not on the clients, right?

Share this post


Link to post
Share on other sites

Thanks JShock, but I tested this and found that it generates those scripts for each player on the server. They aren't executed only on the server.

Also on dedicated, the scripts called in the BIS_fnc_MP command have AddAction's and Eventhandler's in them. They stopped working after using BIS_fnc_MP

Edited by nullsys

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  

×