Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
pierremgi

MP mission parameters - isGlobal behavior?

Recommended Posts

Hi all,

I'm trying to understand what "isGlobal" really does in mission parameters.

BIKI says:  isGlobal = 1; // (Optional) 1 to execute script / function locally for every player who joins, 0 to do it only on server

 

My question is simple:

does (isGlobal = 1) make every player can choose his own setting, or this is a mean for publicVariable this setting coming from server? In this last case, I understand that isGlobal = 0 (or absent) means that the parameter concerns the server only and clients can't change the param (or will not see it at all);

 

The BI example adds confusion:

class Daytime {

  title = "Time";

  texts[] = {"Morning","Day","Evening","Night"};

  values[] = {6,12,18,0};

  default = 12;

  function = "BIS_fnc_paramDaytime"; // (Optional) [[Functions_Library_(Arma_3)|Function]] [[call]]ed when player joins, selected value is passed as an argument

  isGlobal = 1; // (Optional) 1 to execute script / function locally for every player who joins, 0 to do it only on server

};

class ViewDistance {

  title = "View distance (in metres)";

  values[] = {500,1000,2000,5000}; // When 'texts' are missing, values will be displayed directly instead default = 1000;

  file = "setViewDistance.sqf"; // (Optional) Script [[call]]ed when player joins, selected value is passed as an argument

};

 

Well! Here view distance could be a local parameter (on each client) for better FPS, so why on server only???

and I can't imagine every player choosing his own day time. So, why locally on every player who joins???

 

My actual case:

From init.sqf, I'm using a param for running a script on specific units. The script is loaded by server + clients but I need the param to be chosen by the server (hosted)/ admin? (dedicated).

It's clear that I want the hosting player chose the parameter. I don't know how that works on dedicated. Perhaps at the mission start???

Then, this param must be known by all clients (in order to run the script locally, but not modified by them).

 

Thanks for your lights.

Share this post


Link to post
Share on other sites
Just now, pierremgi said:

My question is simple:

does (isGlobal = 1) make every player can choose his own setting, or this is a mean for publicVariable this setting coming from server? In this last case, I understand that isGlobal = 0 (or absent) means that the parameter concerns the server only and clients can't change the param (or will not see it at all);

 

No its not.

The params value is hard set for every client/server and remains unchanged until host change it before mission start (mission params menu).

Global means that the script or function attached to, will be executed on every client or only on server.

This is mostly usable if you have some script/function  that should run only server side, - for example:  because in its code you have command with global effect  or remoteexec stuff.

 

PS: using view distance in mission params has only one reason:

restrict distance and prevent players to see far above units spawn distance around player. (player will never see appearing/disappearing units)

PS2:

Quote

I don't know how that works on dedicated. Perhaps at the mission start???

 

You need to avoid -autoInit server start parameter that you can login as admin select mission and set its parameters.

  • Thanks 1

Share this post


Link to post
Share on other sites
Just now, davidoss said:

 

No its not.

The params value is hard set for every client/server and remains unchanged until host change it before mission start (mission params menu).

 

Fine! that seems to me clearer.

 

Just now, davidoss said:

Global means that the script or function attached to, will be executed on every client or only on server.

This is mostly usable if you have some script/function  that should run only server side, - for example:  because in its code you have command with global effect  or remoteexec stuff.

The reason why there is no difference for me. I don't have any function "attached to" the param class (like function = "BIS_fnc_paramDaytime";) , but only scripts from init.sqf which refer to these params as a variable (a global one, compared to local or public).

So, I understand  isGlobal   doesn't matter in my param classes.

 

Share this post


Link to post
Share on other sites

×