Ok, I already made something like that long time ago. Read
http://www.ofpec.com/forum/index.php?topic=16685.0The 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)
-
Clean up the code, cause it's really messy atm DONEThree Parameters1 - Name of the vehicle
Obvious2 - 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 away3 - 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
[mylittleboat,1,3] exec "COC_veh.sqs"; [myhugeship,2,8] exec "COC_veh.sqs"
Bugs :- Sometimes when I move from cargo to another position a new action is created FIXED- 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.
NOTE :
- 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
- Not tested in MP.
Required :
http://ofp.gamepark.cz/index.php?showthis=4083