Jump to content
Sign in to follow this  
bangabob

JIP build array

Recommended Posts

RESOLVED. see 2nd post

I have a script that updates an array(EOS_markers) with new marker names everytime it is called. EG.

init.sqf

[["mkr1","mkr2"],[false,false,false,false,5],[1,0],[25,0]] execVM "eos\eos_init.sqf"; 
[["mkr3","mkr4"],[true,false,false,false,5],[1,0],[25,0]] execVM "eos\eos_init.sqf";

eos\eos_init.sqf

EOSmarkers = EOSmarkers + (_this select 0); publicvariable"EOSmarkers";

Then EOSmarkers = ["mkr1","mkr2","mkr3","mkr4"];

When a player connects they run

onplayerConnected {[] execVM "eos\eos_functions.sqf"};

eos_functions.sqf

{
_x setMarkerAlpha (MarkerAlpha _x);
_x setMarkercolor (getMarkercolor _x);
}foreach EOSmarkers;

But this doesn't work. For some reason the EOSmarkers array is not being synced with JIP players

Edited by BangaBob

Share this post


Link to post
Share on other sites
I have a script that updates an array(EOS_markers) with new marker names everytime it is called. EG.

init.sqf

[["mkr1","mkr2"],[false,false,false,false,5],[1,0],[25,0]] execVM "eos\eos_init.sqf"; 
[["mkr3","mkr4"],[true,false,false,false,5],[1,0],[25,0]] execVM "eos\eos_init.sqf";

eos\eos_init.sqf

EOSmarkers = EOSmarkers + (_this select 0); publicvariable"EOSmarkers";

Then EOSmarkers = ["mkr1","mkr2","mkr3","mkr4"];

When a player connects they run

onplayerConnected {[] execVM "eos\eos_functions.sqf"};

eos_functions.sqf

{
_x setMarkerAlpha (MarkerAlpha _x);
_x setMarkercolor (getMarkercolor _x);
}foreach EOSmarkers;

But this doesn't work. For some reason the EOSmarkers array is not being synced with JIP players

Are you sure that it's the Array that is not synced? Maybe test'em with a Hint.

Im doing something similar in a mission of mine. However if i recall correctly forEach didn't work like i wanted it to.

This is what i've done:

              _grids = _this select 0;
       _amount = count _grids;
              _counter = 0;

              while {_counter < _amount + 1} do {

              _mark = _grids select _counter;
              _mark setMarkerAlpha 0;
              _counter = _counter + 1;
              };

Share this post


Link to post
Share on other sites

I accidentally found the answer by forgetting to update the onplayerconnected.

So its working and this is how

init.sqf

 EOSmarkers = [];publicVariable "EOSmarkers";

[["mkr1","mkr2"],[false,false,false,false,5],[1,0],[25,0]] execVM "eos\eos_init.sqf";
[["mkr3","mkr4"],[false,false,false,false,5],[1,0],[25,0]] execVM "eos\eos_init.sqf";

onplayerConnected {[] execVM "eos\eos_init.sqf"};

eos_init.sqf


EOSmarkers = EOSmarkers + (_this select 0); //publicVariable "EOSmarkers";

{
_x setMarkerAlpha (MarkerAlpha _x);
_x setMarkercolor (getMarkercolor _x);
hint format ["%1",_x];
}foreach EOSmarkers;

if (!isServer) exitwith {};
{
[_x,(_this select 1),(_this select 2),(_this select 3)] execVM "eos\eos_launch.sqf";

}foreach (_this select 0);

Don't ask me why it works. It just does. Lol

Share this post


Link to post
Share on other sites

Hy,

I've enjoyed playing in missions using your EOS system.

I've tried to use it in 1 of my new mission but I always get an error message of undefinded variable for the EOSMarker on line 9 of EOSGearBox (using v18).

Do you know what I mabe did wrong cause I did not find a solution to solve the problem.

Thanks for your help.

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  

×