Jump to content
Sign in to follow this  
derringer

How to pause a trigger and resume.

Recommended Posts

Hiya, so I have a trigger set to change to a camera angle and then have a car blow up. This is my On Act script:

camera = [player]ExecVM "camera.sqf";

_i = 0; waitUntil {_i = _i + 1; _i >= 100};

Bomb = "Bo_GBU12_LGB" createVehicle getPos Bomb1;

Basically copy and pasted from the forum here and the wiki.

What is happening is the bomb is going off as soon as the camera changes, as if the waitUntil line isn't even there. I would like it to work like this:

Cut to the camera, wait a few seconds then have the bomb go off.

Nothing fancy as I'm just learning and I'm horrible with scripting and the like.

I've searched the wiki, other sites and this site and have no luck. I have also tried values of 1, 10, 50 and 1000 in the waitUntil line as nothing specifies if that's in seconds or what, no luck.

Many thanks in advance!

Share this post


Link to post
Share on other sites

Unless it's changes, I thought most camera scripts were still done in SQS?

Either way, use sleep 5; for 5 seconds of pause in an SQF or ~5 for 5 seconds of pause in an SQS.

I know the great ArmA cam tutorials had lots of ways of pausing and timing the camera, check out Mr Murry's guide.

Share this post


Link to post
Share on other sites
Unless it's changes, I thought most camera scripts were still done in SQS?

Either way, use sleep 5; for 5 seconds of pause in an SQF or ~5 for 5 seconds of pause in an SQS.

I know the great ArmA cam tutorials had lots of ways of pausing and timing the camera, check out Mr Murry's guide.

Thanks for the quick reply! I tried adding that, but I'm not sure where I have to add it in the sqf file. This is what I have for my SQF:

_camera = "camera" CamCreate [5099.49,9709.04,30.91];

_camera cameraEffect ["internal","back"];

_preload = [] spawn {waitUntil{preloadCamera [5099.49,9709.04,30.91]}};

_camera camPrepareTarget [-69754.94,61650.76,-41469.34];

_camera camPreparePos [5099.49,9709.04,30.91];

_camera camPrepareFOV 0.700;

_camera camCommitPrepared 0;

@camCommitted _camera

Do I add it at the start or end of the script? If I have it at the end, it still doesn't pause for me. I'll look up Mr. Murray's guide as well.

---------- Post added at 01:08 AM ---------- Previous post was at 12:59 AM ----------

Also, could you or someone else post a link to MrMurry's guide? It has Invalid User on this forum for a search for his posts. Thanks again in advance!

Share this post


Link to post
Share on other sites

That's because Mr. Murray has an a in his name =]

Try googling it - the Mr. Murray guide is linked from several ARMA sites.

Share this post


Link to post
Share on other sites

I haven't been able to put a delay in a trigger either, why not call the camera script and then call a bomb script with the sleep command in it.

If you do call the bomb by script it gives you more control , you can expand it to add things like velocity which could make the vehicle jump a few feet in the air when hit.

Sorry if I haven't read it correctly as I'm trying to relearn all the stuff I've forgotten.

Share this post


Link to post
Share on other sites
I haven't been able to put a delay in a trigger either, why not call the camera script and then call a bomb script with the sleep command in it.

If you do call the bomb by script it gives you more control , you can expand it to add things like velocity which could make the vehicle jump a few feet in the air when hit.

Sorry if I haven't read it correctly as I'm trying to relearn all the stuff I've forgotten.

I've tried to use the sleep command but it doesn't work at all for me. I managed an ugly workaround for it by having the first trigger activate another one that has a Timeout delay on it. Thanks for the reply though!

Share this post


Link to post
Share on other sites

Surely as Derringer said:

Lose the waitUntil line.

Create a bomb.sqf file and move the bomb line into it

Add sleep 5; to the top of the bomb.sqf

Call bomb.sqf after camera.sqf

Share this post


Link to post
Share on other sites

Thanks for the link to the guide, this will be really helpful.

Thanks everyone, I should be able to get this working without the extra trigger now :)

Share this post


Link to post
Share on other sites
I've tried to use the sleep command but it doesn't work at all for me. I managed an ugly workaround for it by having the first trigger activate another one that has a Timeout delay on it. Thanks for the reply though!

I think you miss understood.

you call one script which is your cam script and then the bomb script

camera = [player]ExecVM "camera.sqf";nul=[unit,explosive,delay] execVM "Bomb.sqf";

_unit  = _this select 0;
_expch = _this select 1;
_delay = _this select 2;

sleep _delay;

_bomb = _expch createVehicle [getpos _unit select 0,getpos _unit select 1, 1];

unit is what you want blown up

explosive is class name "ARTY_Sh_81_HE"

delay would be how long before it goes off

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  

×