JBOY Boat Waypoints script
Vanilla boat AI is terrible at navigating narrow rivers. This script fixes that problem. Using this script, mission makers can now use waypoints to move boats up any narrow river that is deep enough for their boat to access it.
I was inspired by the awesome Prairie Fire DLC map Cam Lao Nam that has many beautiful rivers and the Mekong Delta. Let's fill those rivers with AI boats!
Download sample mission here.
Boats move to exact positions and can navigate narrow rivers, pass under bridges, etc.
Easy for mission maker to use: Place move waypoints for boat, and place call to my script in first move waypoint.
Boats can back out from a beached position or a boat dock (if you put the word "reverse" in the move waypoint description).
Waypoints supported: Move and GetOut. I will add support for Transport/Unload later.
If a boat is beached, units exit boat and script terminates
When AI senses danger and switches to Combat Mode they will:
React verbally using various random in-game voice reactions: Under Fire!, Enemy Spotted!, Stay Low!, etc.
Boat will accelerate to max speed for boat.
25% chance driver pops a smoke at back of boat to obscure their getaway
Some AI will ragdoll and fall from vehicle when killed (thanks to my Fall From Vehicles script which is also included)
Boat speed can be set by 2nd parameter to script call, or by default, it will be set by speedMode of Waypoint (Limited, Normal, or Full). Limited will be 25% of max speed of boat. Normal is 50% of max speed. Full is 75% of max speed. 100% (max speed) is reserved for when boat goes into combat mode, they will accelerate to max speed.
3rd parameter to call is an "x offset", which means boat will travel x meters to right or left of waypoints. This allows many boats to share same set of waypoints but travel in parallel paths to right or left of waypoint.
How to add to your own mission:
From the demo mission, copy the JBOY folder into your mission folder.
Put the following code into your init.sqf to compile my scripts.
Place a boat with an AI driver in the editor and create Move waypoints for him.
Note that each waypoint must have clear unobstructed line of sight to next waypoint (with no land in-between)
In the first move way point, place a call to my script. Here's three different formats for the call:
_n = [vehicle this] spawn JBOY_boatMoveWaypoints; // boat will follow waypoints with speed dictated by speedMode of waypoints (Limited, Normal, Full)
_n = [myboat,25] spawn JBOY_boatMoveWaypoints; // boat will follow waypoints, and speed will always be 25 (speedMode of waypoints ignored if speed specified).
_n = [vehicle this,0,-4] spawn JBOY_boatMoveWaypoints; // boat will follow waypoints, speedmode determines speed of boat, and -4 means boat will travel 4 meters to left of waypoints.