Jump to content
Sign in to follow this  
Skul

When a unit fires his law...

Recommended Posts

Okay, here's the deal. I'm making a video mission based around a certain character. If I can get this, then I should be able to have it finished by today, or maybe tomorrow...but with me, it's bound to take a million years to finish (remember all those dates when I said certain missions and a certain campaign were gonna come out? crazy_o.gif Ooh, boy!)

Er, anyhoo, as you've probably guessed from the title, I want time to slow down when this unit fires his LAW. I've got an extremely (and I mean extremely!) vague idea of what the script code should look like. Apart from that, I haven't got the foggiest...

Any help would be appreciated. smile_o.gif

TIA... and to any mods who get pissed off and tell me to search (which I have), I'd also like to say AIA (Apoligising In Advance). biggrin_o.gif

[Gareth Gates must die]

Share this post


Link to post
Share on other sites

You set the time to slow......oh man, I know this command but I ain't have it right now!!! arrrghh crazy_o.gif

something setaccuratetime or something and then 0.1 or i 2

Share this post


Link to post
Share on other sites

Yup. Setacctime # smile_o.gif

I want it to slow down when the unit fires his LAW. After the target is destroyed by it, time is restored to normal.

[Gareth Gates must die]

Share this post


Link to post
Share on other sites

...Not THAT slow! biggrin_o.gif I don't want time to practically freeze, just slow down a bit.

Now, can anyone give me the 'when-a-weapon-is-fired-something-happens-command'? smile_o.gif

lol...0.000000000001..where'd you get that idea from? biggrin_o.gif

[Gareth Gates must die]

Share this post


Link to post
Share on other sites

Use the fired eventhandler:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">unit addEventHandler ["fired",{[_this select 1] exec firedlaw.sqs}]

firedlaw.sqs:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

?_this select 0 != "LAWLauncher": exit

Setacctime 0.1

Is that what you wanted?

RED

Share this post


Link to post
Share on other sites

To make soldier fire his weapon just do the

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

this dofire me

command or

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

you fire "at4"

And he will fire his weapon. But if you want is so that the camera slows down and focuses on whatever right when the missile is fired, then look for the command that detects and checks the unit firing the missile, so that when he fires it the script knows it then the cam or the game slows down imediatlly

Share this post


Link to post
Share on other sites
Use the fired eventhandler:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">unit addEventHandler ["fired",{[_this select 1] exec firedlaw.sqs}]

firedlaw.sqs:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

?_this select 0 != "LAWLauncher": exit

Setacctime 0.1

Is that what you wanted?

RED

man

I still need to get used to event handlers and shit. So does that make it so that when the law or rocket is fired then cam script is activated and what does the cam do? follow it or something??

Share this post


Link to post
Share on other sites

What if there are many people firing LAWS how will it detect at which to slowdown?

And will it work for the RPG onthe other side too?

This is simply asking if theres a battle raging with both sides using the weapons ? smile_o.gif

Share this post


Link to post
Share on other sites

Eventhandles are true to their name, they handle events. The events it can handle are:

Quote[/b] ]

"Killed"

"Hit"

"Engine"

"GetIn"

"GetOut"

"Fired"

"IncomingMissile"

"Dammaged"

"Gear"

"Fuel"

"Init"

You add an event to a specific unit, the event will not be trigged until a specific condition is met (like a trigger) When the condition is met, the EH will then activate with certain arguments which can be used.

The small example I posted above will wait till that unit has fired, each time the unit fires it will activate the firedlaw.sqs script. The firedlaw.sqs checks which weapon was used to fire the projectile (which can also be found btw) if the weapon is not eqaul to "LAWLauncher" it will exit.

Check out the com ref for a better example.

RED

Share this post


Link to post
Share on other sites

okie. the engine on thing. Would that be like if the engine turns on say.....

this engineon true

then the event handler possibly turns something else on so by turning the engine on then a bunch of other things happen.....

Share this post


Link to post
Share on other sites
What if there are many people firing LAWS how will it detect at which to slowdown?

And will it work for the RPG onthe other side too?

This is simply asking if theres a battle raging with both sides using the weapons ?  smile_o.gif

Don't worry 'bout that. smile_o.gif It's just one guy firing.

Use the fired eventhandler:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

unit addEventHandler ["fired",{[_this select 1] exec firedlaw.sqs}]

firedlaw.sqs:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">?_this select 0 != "LAWLauncher": exit

Setacctime 0.1

Is that what you wanted?

RED

Yeah! Thanks! I'll got test that out now! smile_o.gif

[Gareth Gates must die]

Share this post


Link to post
Share on other sites

Just saw a typo:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

unit addEventHandler ["fired",{[_this select 1] exec "firedlaw.sqs"}]

@bmgarcangel: Yes, that is the general idea.]

RED

Share this post


Link to post
Share on other sites

i'm sure you can do that other ways, aka not using event handlers. Like in a script, when the rocket leaves, you use a

@ blablablabla

and it activates the next part of hte script

in this case what would you put with

@

to make it go to the next part of the script??

Share this post


Link to post
Share on other sites

lol, I just came back to say that. It came up with the ever annoying 'Unknown operator' crap.

Right. Off to test the proper script! smile_o.gif

[Gareth Gates must die]

Share this post


Link to post
Share on other sites

Works like a charm!!! biggrin_o.gif

Thanks loads, RED! You've gotten yourself a place in the credits!

Boy, rockets sure look cool when they go flying through the air in slo-mo! smile_o.gif

[Gareth Gates must die]

Share this post


Link to post
Share on other sites
Works like a charm!!! biggrin_o.gif

Thanks loads, RED! You've gotten yourself a place in the credits!

Boy, rockets sure look cool when they go flying through the air in slo-mo! smile_o.gif

[Gareth Gates must die]

Hi Skul

Try it at night

group control view with a Bradley firing a TOW

Big flash bang

rocket leaps from the launcher

then it lights up and steers to the target.

Gorgoeous

Do it all the time in BSO6 using the slow time in the command engine then just press the the minus key (QWERTY one not numberpad) and your back to normal speed.

Time slicing is suposed to be this big thing in so many games Max Paynes Bullet time etc we have been doing it OFP since it came out.

Kind Regards Walker

Share this post


Link to post
Share on other sites

I'll have to try that sometime, Walker! smile_o.gif

The video I have is set at dusk, but not quite dark enough for bright flashes. In the next one, I'll make sure it's darker so the flashes are visible.

Oh, and, by the way. The video is now 99% complete! Just got to get an Overview and a site to host it on and away we go! I think a lot of you will like who the video is centred around... wink_o.gif

[Gareth Gates must die]

Share this post


Link to post
Share on other sites

Question about this time command--does it work in MP? If so, I'm assuming it's a local occurrence? If so, then what happens if only one client is in slow-mo?

I know that the time acceleration in SP is based on this command by pressing the +/-, and that doesn't work in MP. I didn't know if the scripted version works in MP.

Share this post


Link to post
Share on other sites

I am almost 99% sure it doesn't smile_o.gif

RED

Share this post


Link to post
Share on other sites

Just tested, and no it doesn't work.

RED

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  

×