Jump to content
JGames Family

deletevehicle/edit setLightBrightness from another script

Recommended Posts

I have got another problem, Is there a way to make a variable for the whole server? I tried to remove the underscore but no success.

 

["ALF_EventoDebate_Inicio",

{   

    _light = "#lightpoint" createVehicle [6189.77,6916.42,5.74881];

    _light1 = "#lightpoint" createVehicle [6190.53,6915.18,5.784];

    _light2 = "#lightpoint" createVehicle [6191.03,6913.88,5.86216];   

    _light3 = "#lightpoint" createVehicle [6191.87,6912.65,5.95794]; 

    _light4 = "#lightpoint" createVehicle [6192.79,6911.45,6.01091];

    _light5 = "#lightpoint" createVehicle [6193.55,6910.06,5.9946];  

    _light6 = "#lightpoint" createVehicle [6193.91,6908.83,6.03803]; 

 

    [_light,0.3] remoteExec ["setLightBrightness",0,_light];

    [_light,[247,241,241]] remoteExec ["setLightColor",0,_light];

    [_light,[247,247,247]] remoteExec ["setLightAmbient",0,_light];

    [_light,[0, 0, 0]] remoteExec ["lightAttachObject",0,_light];


 

    [_light1,0.3] remoteExec ["setLightBrightness",0,_light1];

    [_light1,[247,241,241]] remoteExec ["setLightColor",0,_light1];

    [_light1,[247,247,247]] remoteExec ["setLightAmbient",0,_light1];

    [_light1,[0, 0, 0]] remoteExec ["lightAttachObject",0,_light1];


 

    [_light2,0.3] remoteExec ["setLightBrightness",0,_light2];

    [_light2,[247,241,241]] remoteExec ["setLightColor",0,_light2];

    [_light2,[247,247,247]] remoteExec ["setLightAmbient",0,_light2];

    [_light2,[0, 0, 0]] remoteExec ["lightAttachObject",0,_light2];


 

    [_light3,0.3] remoteExec ["setLightBrightness",0,_light3];

    [_light3,[247,241,241]] remoteExec ["setLightColor",0,_light3];

    [_light3,[247,247,247]] remoteExec ["setLightAmbient",0,_light3];

    [_light3,[0, 0, 0]] remoteExec ["lightAttachObject",0,_light3];


 

    [_light4,0.3] remoteExec ["setLightBrightness",0,_light4];

    [_light4,[247,241,241]] remoteExec ["setLightColor",0,_light4];

    [_light4,[247,247,247]] remoteExec ["setLightAmbient",0,_light4];

    [_light4,[0, 0, 0]] remoteExec ["lightAttachObject",0,_light4];


 

    [_light5,0.3] remoteExec ["setLightBrightness",0,_light5];

    [_light5,[247,241,241]] remoteExec ["setLightColor",0,_light5];

    [_light5,[247,247,247]] remoteExec ["setLightAmbient",0,_light5];

    [_light5,[0, 0, 0]] remoteExec ["lightAttachObject",0,_light5];


 

    [_light6,0.3] remoteExec ["setLightBrightness",0,_light6];

    [_light6,[247,241,241]] remoteExec ["setLightColor",0,_light6];

    [_light6,[247,247,247]] remoteExec ["setLightAmbient",0,_light6];

    [_light6,[0, 0, 0]] remoteExec ["lightAttachObject",0,_light6];

 

    [escenario, ["eventoinicio", 600]] remoteExec ["say3D"];

    //playSound3D ["eventoinicio", escenario]

 

    sleep 5;

    

}] call Server_Setup_Compile;

 

Each of this functions are like different scripts and if I add it like 

 

["ALF_EventoDebate_Fin",

{   

 

    deleteVehicle _light1;

    deleteVehicle _light2; 

    deleteVehicle _light3;

    deleteVehicle _light4;

    deleteVehicle _light5; 

    deleteVehicle _light6;

    

}] call Server_Setup_Compile;

 

to turn off lights apart, the _light doest call the first _light so I cant add a function apart to turn off the _lights of the other function, any help? Thx. 

 

PS: Is the same script but I can add like more than 1 function in the script, the problem is that inside that function is like a script apart even tho it's in the same .sqf, so it won't call the private variables between different functions. I also tried to put the private variables outside each function so that it is global and the set brightness inside the functions and didn't work still. Its for multiplayer tho.

Share this post


Link to post
Share on other sites

Hello JGames Family. Not sure how you used publicVariable, if you don't share an example won't be too easy to help. Apart from that, you could possibly use the setVariable and getVariable commands. If I am not mistaken (haven't tested it, but to my understanding, it should work fine) you could set variables in the missionNamespace and retrieve them from any connected machine.

 

Please ask here if this doesn't work for you or you need help with the said commands.

Edited by ZaellixA
Added some links
  • Like 2

Share this post


Link to post
Share on other sites

No, I just want to execute a function that deletes the vehicle of another function, like calling a variable from another script. _ variables do not work with this...

1 minute ago, ZaellixA said:

Hello JGames Family. Not sure how you used publicVariable, if you don't share an example won't be too easy to help. Apart from that, you could possibly use the setVariable and getVariable commands. If I am not mistaken (haven't tested it, but to my understanding, it should work fine) you could set variables in the mission namespace and retrieve them from any connected machine.

 

Please ask here if this doesn't work for you or you need help with the said commands.

 

Share this post


Link to post
Share on other sites

Have you tried adding this variable in the mission namespace? If I am not mistaken you could do something like this

//--------------------------------------------------------------------------------
// Function that creates the vehicle
//--------------------------------------------------------------------------------
private _jeep = "Jeep" createVehicle position player; // Just creating a random object for demonstration

missionNamespace setVariable["mySuperJeep", _jeep]; // Add the jeep to the mission namespace

/*
 * Do some other things in this function...
 */

[] call yourTAG_fnc_delJeep; // Call the function below to delete the jeep

//--------------------------------------------------------------------------------
//--------------------------------------------------------------------------------
// Other function that must delete the vehicle. Let's call it yourTAG_fnc_delJeep
//--------------------------------------------------------------------------------
private _jeep = missionNamespace getVariable["mySuperJeep", objNull]; // Get the jeep
deleteVehicle _jeep; // Delete the vehicle
missionNamespace setVariable["mySuperJeep", nil]; // Delete the variable in the mission namespace (not sure this is needed thought)

Let me know if this worked for you.

Share this post


Link to post
Share on other sites

Apart from this, when I put a say3D and then exit arma it pauses the sound and then continues. That will cause a desync between players of the sound, what can I do so that the song keeps going even tho Im not in the screen?

Share this post


Link to post
Share on other sites

Not sure about it... Haven't used say3D and I'll have to check that. Or hopefully, someone more experienced than me will show up to save us :D.

 

I will have a look at say3D sometime later today and if I find something interesting I will let you know. Please let me know if the above snippets work for you or should look for alternatives.

Share this post


Link to post
Share on other sites

Thank u for ur help bro, testing ^^

Just now, ZaellixA said:

Not sure about it... Haven't used say3D and I'll have to check that. Or hopefully, someone more experienced than me will show up to save us :D.

 

I will have a look at say3D sometime later today and if I find something interesting I will let you know. Please let me know if the above snippets work for you or should look for alternatives.

 

  • Like 1

Share this post


Link to post
Share on other sites

tried with both 

    [escenario, ["eventoinicio", 600]] remoteExec ["say3D"];

    playSound3D ["@evento\efectos\eventoinicio.ogg", escenario, false, getPos escenario, 1, 1, 300] 

so taht u make an idea

both work but have the same problem with the desync when alt+esc

Share this post


Link to post
Share on other sites
13 minutes ago, ZaellixA said:

Have you tried adding this variable in the mission namespace? If I am not mistaken you could do something like this


//--------------------------------------------------------------------------------
// Function that creates the vehicle
//--------------------------------------------------------------------------------
private _jeep = "Jeep" createVehicle position player; // Just creating a random object for demonstration

missionNamespace setVariable["mySuperJeep", _jeep]; // Add the jeep to the mission namespace

/*
 * Do some other things in this function...
 */

[] call yourTAG_fnc_delJeep; // Call the function below to delete the jeep

//--------------------------------------------------------------------------------
//--------------------------------------------------------------------------------
// Other function that must delete the vehicle. Let's call it yourTAG_fnc_delJeep
//--------------------------------------------------------------------------------
private _jeep = missionNamespace getVariable["mySuperJeep", objNull]; // Get the jeep
deleteVehicle _jeep; // Delete the vehicle
missionNamespace setVariable["mySuperJeep", nil]; // Delete the variable in the mission namespace (not sure this is needed thought)

Let me know if this worked for you.

Didn't work 😞

Share this post


Link to post
Share on other sites
24 minutes ago, JGames Family said:

Thank u for ur help bro, testing ^^

 

About this 

25 minutes ago, ZaellixA said:

Not sure about it... Haven't used say3D and I'll have to check that. Or hopefully, someone more experienced than me will show up to save us :D.

 

I will have a look at say3D sometime later today and if I find something interesting I will let you know. Please let me know if the above snippets work for you or should look for alternatives.

I found there is a parameter that is called nopause, but since I run the command in server execute if I add that command to the server will work? mb I break it but will try

EDIT: The command was already running in the server so I guess if there is no way the server itself executes the command so that it doesn't pause, I can't do anything but tell user by user to enable the parameter... I use the "server execute" option in console command but no success, it sounds but pauses when alt+tab

Share this post


Link to post
Share on other sites

Been hours trying to fix this problem with say3d with no success... im using remote exec with say3d. On console, I select server to execute. and tried with playsound3d also works but when alt + esc it pauses the audio and then resumes. server is in nopause, client is in nopause... what the hell more wants arma. @Dedmen save me with your superpowers, please. (Sorry for mentioning u, if I bother tell me and wont do it anymore)

Share this post


Link to post
Share on other sites
4 hours ago, JGames Family said:

Didn't work 😞

Ppppppfffff...... can you try to change the setVariable in the way shown below and try again (apologies but I don't have a PC to check the scripts before posting 😔)?

// Change from this
missionNamespace setVariable["mySuperJeep", _jeep];

// To this...
missionNamespace setVariable["mySuperJeep", _jeep, true];

This last argument makes the variable public.

Share this post


Link to post
Share on other sites
9 minutes ago, ZaellixA said:

Ppppppfffff...... can you try to change the setVariable in the way shown below and try again (apologies but I don't have a PC to check the scripts before posting 😔)?


// Change from this
missionNamespace setVariable["mySuperJeep", _jeep];

// To this...
missionNamespace setVariable["mySuperJeep", _jeep, true];

This last argument makes the variable public.

Completely fine, will be chacking and telling u, about say3D... just forget about it, I don't think there is a single way to fix that so guess I will have to conform with that ^^ 

  • Like 1

Share this post


Link to post
Share on other sites
2 minutes ago, JGames Family said:

Completely fine, will be chacking and telling u, about say3D... just forget about it, I don't think there is a single way to fix that so guess I will have to conform with that ^^ 

I will have a look one of those days, but if you said you have already spent quite some time trying to fix it with no result I kinda doubt I will be able to help with it. Dedmen would know best whether this doable or not.

  • Like 1

Share this post


Link to post
Share on other sites

Asked him and he didnt know

1 minute ago, ZaellixA said:

I will have a look one of those days, but if you said you have already spent quite some time trying to fix it with no result I kinda doubt I will be able to help with it. Dedmen would know best whether this doable or not.

so no way its possible lol.

Share this post


Link to post
Share on other sites

Hey, I changed the title of the post so that sb can help me out with that. I tried with different kind of variables with no success, mb together we figure out how to change light brightness of a vehicle created in another script? Check out first post. Thx for ur help in advance ^^.

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

×