Movepoint AI ScriptsThese scripts are a bit raw, but working well enough now to get some feedback from you wise OFP scripting dudes.
Purpose:These scripts allow the mission designer to define a series of positions in buildings (or outside) that a group of units will move through. This includes rooftops that OFP AI currently cannot navigate on. With these scripts you can:
- Send a group of units into a building, up stairs, on to the roof, and onto the next building, down the stairs and out.
- Send a group of units into a series of positions to defend, like roof top sniper positions, windows, etc. Basically a "Fixed Position" script, except the units moved there naturally (via scripts), rather than being statically SETPOSed into desired positions.
- Each position is defined as a "Movepoint" with properties of Position, Direction to Face, Stance (Up, Down, Crouch).
- Paths are defined as simply a series of Movepoints (an array).
Note: One limitation of OFP Waypoints is that the units must maintain Formation, which doesn't work in confined spaces. These scripts help overcome this limitation.
The Potential...There is potential here for the community to build a library of movepoints and paths for every Building, in every Town, on every Island. Mission Designers can then combine the movepoints into whatever paths make sense for their individual missions. Look at how Movepoints are defined in the INIT.SQS, and you will see how we could build up such a library...
Enough hype...here's the Demo...Sorry for requiring addons, but Lybia island has interconnected buildings with great rooftops, which show this off well. Plus I needed the Ladders from Editor Update 102 (by Gunslinger).
Addons Required:Libya island:
http://ofp.gamepark.cz/index.php?showthis=2542Editor Update 102:
http://files.filefront.com/DMALIBYACOMPLETErar/;4863312;;/fileinfo.htmlThe demo mission is attached. Move it to your Users missions directory, and run it from the editor.
Known Issues- Units will stick to movepoint paths and not deviate, except if wounded and commanded to seek a medic, or medic commanded to support a wounded unit. I do not know how to solve this yet, so removed medics from demo.
- If units cannot stand, they hold up movement for the group. My workaround for now is to heal the unit enough so he can stand and continue through path.
- Accelerating time causes units to clip through walls and fall off buildings. Don't use it.
Possible Future Improvements- Integrate with Blanco/BDFY's cover scripts.
- Add "cycle" option, so units can repeat movepoints (i.e., sentry walking rooftop perimeter).
- Add "Pause/Resume" feature so units moving through series of movepoints can stop midway, then resume moving along their path.
- Add "Forward/Reverse" feature. Right now scripts only move forward through series of Movepoints. Note: Reverse is tricky as some Scripted movepoints are "one way" only currently (i.e. climbing a ladder up, or using switchmove commands to navigate across a rooftop).
- Add "Close Ranks" feaure, so when a unit gets killed, the trailing units move up to fill the vacant position.
- Add "Reinforce" feature. When using movepoints to deploy to staggered defensive positions, as units are killed, it would be nice to move up a unit from a reinforcment group to fill the vacant position.
- Add quiet "movement chatter", such as leader saying random stuff such as "move up", "Lets go", "advance", etc. And trailing units responding with "roger", "moving", "in position", "on my way", "clear", etc. The current "Go Go Go", and "Forward" is too loud and annoying, and just there for debugging purposes (audio cue as to when leader moving to next movepoint).[\li]
The ultimate future enhancement...This would take some work, but seems doable... There are a finite number of Building Object Types on an island. Within a building object type, there is a finite number of positions that designers would normally be interested in: Entrances, windows, doorways, Ledges facing out, Roof top edges and corners, ladders, stairs, etc. Once we have identified the most desirable movepoints (and paths) for a building object type, we could calculate the relative positions of the movepoints in relation to the position and azimuth of an individual building instantiation. Instead of defining movepoints for every building instantiation, we define them relatively for every Building Object Type. But that is too ambitious right now...let's see if this idea has any appeal to you people first.
Scenarios not tested yet:I haven't tried the scenario where player is leader or member of a group that is executing a movepoint script. I also have not tried this in multi-player. So you may not want to waste your time on these particular scenarios until I've tested them myself.
Give the demo a whirl and let me know what you think.
Thanks alot.