Jump to content
wildbill2016

Since delay is not allowed in unsheduled environment, how can I add a delay to the activated events?

Recommended Posts

In one of my trigger's "onActivation",

I use

exec "endcine.sqf";

 

and in this sqf file is like this

Sleep 1;
bomb = "Bo_GBU12_LGB" createVehicle (getPos dem1);
Sleep 2;
bomb = "Bo_GBU12_LGB" createVehicle (getPos ramptarget1);
Sleepleep 1.5;
bomb = "Bo_GBU12_LGB" createVehicle (getPos ramptarget2);
sleep 1.5;
bomb = "Bo_GBU12_LGB" createVehicle (getPos ramptarget3);
sleep 1.5;
bomb = "Bo_GBU12_LGB" createVehicle (getPos ramptarget4);
sleep 1.5;
bomb = "Bo_GBU12_LGB" createVehicle (getPos ramptarget5);

 

this sleep causes generic error..

From all the googled results I only find it is caused by the unscheduled environment.

I have found a similar case here

 

It said as long as I put this

  [] spawn {
	  Sleep 1;
	  bomb = "Bo_GBU12_LGB" createVehicle (getPos dem1);
	  Sleep 2;
	  bomb = "Bo_GBU12_LGB" createVehicle (getPos ramptarget1);
	  Sleep 1.5;
	  bomb = "Bo_GBU12_LGB" createVehicle (getPos ramptarget2);
	   sleep 1.5;
	  bomb = "Bo_GBU12_LGB" createVehicle (getPos ramptarget3);
	   sleep 1.5;
	  bomb = "Bo_GBU12_LGB" createVehicle (getPos ramptarget4);
	   sleep 1.5;
	  bomb = "Bo_GBU12_LGB" createVehicle (getPos ramptarget5);
};

In to the trigger's onActivate, it will be Ok,

But I got a "Type Script, expect nothing " error..

So how can I add some delay between this explosions?

 

 

Share this post


Link to post
Share on other sites

Like wildbill2016 said, you need to add a handle (can be "null") to spawn directly in triggers. You don't need to do it when you run the code from a file/function (so putting the second code you posted into the endcine.sqf and execing it would work).

 

Sqf is strange like that.

Share this post


Link to post
Share on other sites
On 17.4.2018 at 1:17 AM, theend3r said:

Like wildbill2016 said, you need to add a handle (can be "null") to spawn directly in triggers. You don't need to do it when you run the code from a file/function (so putting the second code you posted into the endcine.sqf and execing it would work).

 

Sqf is strange like that.

That's not SQF's fault. It's just BI's fault for intentionally bugging script text boxes in the Editor. If you run CBA you don't have that problem because they fixed it.

 

On 16.4.2018 at 11:01 PM, wildbill2016 said:

...Can I find an updated wiki page to this..

https://community.bistudio.com/wiki/Function

What update do you want? I don't see much to update. Besides the useless stuff like that function to get the bigger number of two numbers. We have a command for that now.

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

×