Jump to content
Sign in to follow this  
Blanco

COCdiver vehiclescript

Recommended Posts

Ok, I already made something like that long time ago. If you're registered on OFPEC read this

The script allows a COCdiver (and only him) to enter a vehicle while he's underwater. This includes boats (obviously), APC's but also chopper extraction is possible.

Some history...

COC made swimming/diving possible by creating an invisible boat when the diverunit jumps into the water.

The problem :

You can't enter another vehicle by clicking an action because you are already in a vehicle.

Workaround (well...kind of..)

Add the action to your "diving-vehicle", detect any vehicle nearby running the COC_veh script and you can board it.

You will always enter a COC vehicle in cargoposition, once you're in, you can move to any other available positions.

To do :

- Cargo positions safety check (if possible)

- <s>Clean up the code, cause it's really messy atm wink_o.gif</s> <span style='color:red'>DONE</span>

Three Parameters

1 - Name of the vehicle

Obvious

2 - Index nr (must be unique)

Every action needs an unique ID. I add the action when you're close and I remove it again when you're far away

3 - Action click range

Range within an action will appear. For larger vehicles the distance will be bigger and so on.

The script is put on hold when you reach (action click range * 1.5)

Example

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">[mylittleboat,1,3] exec "COC_veh.sqs"; [myhugeship,2,8] exec "COC_veh.sqs"

Bugs :

<s>- Sometimes when I move from cargo to another position a new action is created</s> <span style='color:red'>FIXED</span>

- When COC vehicles are placed close to eachother, sometimes detection is messed up. This means you click on the action of boatA and you board BoatB.

Few notes

- Heli_dust is not part of the script, it's just eyecandy.

- ALWAYS shut down the engines before you take a swim, or get ready for a long swim to catch up your boat :whistle:

- Not tested in MP.

GIVE IT A TRY

Required: http://ofp.gamepark.cz/index.php?showthis=4083

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  

×