Jump to content
Sign in to follow this  
El Mariachi

Launch script on description.ext parameter

Recommended Posts

I tried searching, and I've tried cracking open different missions for this and no examples seem to work.

Basically, I want to a parameter on/off to determine if a script is run.

example of params code, in description.ext

class RunScript

title = "run this or not?";

values[] = {0,1};

texts[] = {"off","on"};

default = 1;

In my Init.sqf I've tried this:

if (RunScript = 1) then { execVM "thatscript.sqf" };

But that doesn't work. The param is available in the multiplayer screen, and displays correctly, but the script doesn't run. To complicate things, the script has arguments like [5,4,false,1] How would I get that to run for the sqf?

Any help?

Share this post


Link to post
Share on other sites

Well for the sqf arguement passing part, as that is within my scope of knowledge, also within the "if" check for RunScript you need to use the double equals, not the single, all you would need is:

if (RunScript == 1) then {nul = [5,4,false,1] execVM "thatscript.sqf";};

Share this post


Link to post
Share on other sites
I tried searching, and I've tried cracking open different missions for this and no examples seem to work.

Basically, I want to a parameter on/off to determine if a script is run.

example of params code, in description.ext

class RunScript

title = "run this or not?";

values[] = {0,1};

texts[] = {"off","on"};

default = 1;

In my Init.sqf I've tried this:

if (RunScript = 1) then { execVM "thatscript.sqf" };

But that doesn't work. The param is available in the multiplayer screen, and displays correctly, but the script doesn't run. To complicate things, the script has arguments like [5,4,false,1] How would I get that to run for the sqf?

Any help?

No idea what you are trying to do, but you can read any param from description .ext with missionConfigFile. for example to read texts param you need:

[color="#FF8040"][color="#191970"][b]getArray[/b][/color] [color="#8B3E2F"][b]([/b][/color][color="#191970"][b]missionConfigFile[/b][/color] [color="#8B3E2F"][b]>[/b][/color][color="#8B3E2F"][b]>[/b][/color] [color="#7A7A7A"]"RunScript"[/color] [color="#8B3E2F"][b]>[/b][/color][color="#8B3E2F"][b]>[/b][/color] [color="#7A7A7A"]"texts"[/color][color="#8B3E2F"][b])[/b][/color][color="#8B3E2F"][b];[/b][/color][/color]

Share this post


Link to post
Share on other sites

Ok, figured it out, thanks for the help. I couldn't get it to work but you put me on the right track, here's the code that works so hopefully this helps anyone else with the question:

(assuming the defined param in description.ext is the second param)

if (paramsArray select 1 == 1) then {[5,4,true,false] execVM "somescript.sqf"};

I couldn't grasp the missionconfig thing, though, but hey this gets me where I need to be. Thanks again for the 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  

×