Jump to content
Sign in to follow this  
paulytrick

Aim, Fire, miss.....

Recommended Posts

Hi all, I've been playing OFP for a while now but I'm new to editing and scripting (and this forum).

I've made a scripted intro for a campaign I'm making and in part of it a helicopter flies low over some rooftops and I want some guys with RPG's to shoot it down.

this is fine but the thing is nineteen times out of twenty, they all miss.

here is part of my script. i'm not going to paste it all, there's no point. this says all you need to know without me sending you to sleep :)

rpg1 dotarget uh1
rpg2 dotarget uh1
~2
rpg1 dofire uh1
rpg2 dofire uh1
~7
uh1 setdamage 1

is there another way to get them to hit the chopper?

I put the setdamage line in as a last resort. it looks rubbish when the chopper just drops from the sky without being hit.

I've tried increasing the number of RPG soldiers to 10 and they all miss.

Thanks for any help guys.

Paul

Share this post


Link to post
Share on other sites

It's pretty much impossible to make the AI's shot always count. If it's a cutscene, it may be possible to fake it. For example: First film as the unit fires the RPG. Then change the camera angle to the chopper and createVehicle an RPG round on the chopper's position, so it'll look like it actually got hit. An example:

rpg = "RPG" createVehicle getPos chopper

You might also want to add this eventHandler for the RPG operator, so when and if he actually hits the chopper, there won't be duplicated explosions, as if it got hit twice with the real RPG and the "faked" one:

this addEventHandler ["fired", "deleteVehicle (nearestObject [(_this select 0),(_this select 4)])"]

This eventHandler will remove any fired ammunations of the unit as he launches them. There will be the muzzle sound, effects and everything, but no bullets / rockets.

Edited by Rellikki

Share this post


Link to post
Share on other sites

Sound, thanks. I'll give that a go.

Just one question, I don't fully understand event handlers, what do the bits this select 0 and this select 4 mean?

Thanks a million,

Paul.

Share this post


Link to post
Share on other sites

The this selects are variables. Every eventHandler have their own defined variables with different meanings. In this case, 0 means the unit who the eventHandler was assigned to and 4 means the ammo fired. So basicly the command would literally mean: "Once the unit has fired, delete the fired ammo of the shooter".

See here for more info:

http://community.bistudio.com/wiki/Operation_Flashpoint:_EventHandlers_List

http://community.bistudio.com/wiki/Variables :)

Edited by Rellikki

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  

×