Jump to content
Simchef

Stuck with script any IDEAS

Recommended Posts

does anyone know how to launch a script from another script within a loop without the script been launched from the script with loop stacking ?

 

example: the script launched from the looped script will stack instead of playing the script as normal then repeat

Share this post


Link to post
Share on other sites

Welcome on this forum. Take time to detail your problem. Without more precision, I'd say add some waitUntil condition in your script(s). See also scriptdone command. You'll find useful commands here.

Share this post


Link to post
Share on other sites

@Simchef,

More specific information would help us help you but I think I got the point. Check this out,

Condition variables and exitWith or perhaps scriptdone.

Condition variables act like a switch. Declare the variable in your init, like:

toggleSwitch=0;

In your script,

if (toggleSwitch==0) exitWith { toggleSwitch=1;  stuff };
if (toggleSwitch==1) exitWith { toggleSwitch=0; other stuff };

or

waitUntil {scriptdone scriptname};

Take a look at the link @pierremgi  posted for more information on specific script commands.

Have fun!

Share this post


Link to post
Share on other sites

ok so heres a better explanation

 

first script

while this is true once the player is within the radius of the zone the sound  will play with a sleep command of 2 

which will then give me my sound i want playing on repeat with no pauses until i leave the zone which is perfect

 

 

and lets say my other script also has a sound and effects if im not wearing something e.g. goggles included perfect but then i want to launch it from the first script

every time the first script loops it launches the second script making it stack on top which then plays sound and effects every time it loops it echos  this is because the script is been launched on each loop causing it to launch numerous times

 

so i want both scripts running same time depending on different conditions but also on the main condation once im in that zone 

 

if i use a waituntil command it will pause my first script

Share this post


Link to post
Share on other sites

Sorry I was having fun and ran on with the idea, just a little bit 😃

 

EDIT: Re-uploaded with commented script

  • Like 2

Share this post


Link to post
Share on other sites

my brain just froze but thank you im still new to scripting arma so still trying to figure things out just realised thats not what i was asking 

i can make the second script 

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

×