Tutorial - Autopilot missions
The following tutorial is to show you how to build a fully functional autopilot-mission. Note, that even when I describe my way of doing it, there may be other or better ways to build it.
By Starman©
Please post any comments or questions concerning the autopilot missions tutorial to the talk page
Contents
Required:
Freespace SCP 3.6.7 or higher (higher highly recommended)
Same for the Fred-Build (should be from the same date as the exe)
Building your Mission
Important Notes
- Make yourself a little drawing to think about the placement of the waypoint. Don’t forget the Y-Axis, think 3-dimensional.
- When your mission is planned, place simple Waypoints for the final Navpoints. Call them Waypoint Nav 1 see SEXP-Explanation below. The templates already includes 6 Waypoints for that purpose though, just move them.
- By placing your ships, keep in mind how the autopilot works. It drops you out of automatic flight-control when you reached the nav-point (get within 1000 meters) or if enemies are within 5.000 meters range. It will also disallow to activate the autopilot when enemies are closer than 5500 meters (there is also a message for that in the template-mission).
- Don’t forget to give your wingmates special orders (according to the mission), as soon
you reached the navpoints (waypoints, guard, attack, stay near etc.), otherwise the AI reacts really annoying.
The New Operators
- Two new keys have been implemented,
- ALT-A is for activation of the autopilot,
- ALT-N is for choosing nav-points ingame.
- Let’s take a look on the new operators. A new operator-section has been added, called Autopilot/Navpoints. Also important the new operator in Change/HUD called radar-set-max-range. Kazan has added small Fred-explanations to all operators, so I’m sure you will have no difficulties.
- Takes 3 arguments:
- a) Name (manually tipping), this is the name of the Navpoint while ingame (i.e. "Wellington Nav").
- b) the fred-name of the waypoint you set earlier in the mission area
- c) Number of waypoint, I always used "1", cause I have no waypoint-paths added for nav-points.
- Same as above, but you can bind the Navpoint directly to a ship. So you can create a “moving” navpoint.
- Never used it till now, but it’s rather obvious what’s it used for.
- Hides a Navpoint and make it unselectable while playing. If the nav-map is ever going to be implemented, then it isn’t visible there either.
- Same as “hide-nav”, but would make it visible (but not selectable)on the nav-map. I haven’t tried that yet, but it would be recommended using this, if it has the same-ingame-effect than hide-nav.
- Makes navpoints visible again
- Make them accessable again
- A navpoint will be normally marked “visited” (gets green) when you are within 1000 meters. With this and the following function you can control this too.
- See above.
- Second important function.
- Every ship or fighter-wing, which receives this flag, will follow the player on the next autopilot-move. The slowest ship is always giving the cruising-speed.
- The contrary again. Unset-nav-carry a ship, and it won’t follow you anymore (i.e. used for dropping an escorted freighter at the jumppoint).
radar set-max range
- Same as in the launcher, reduces the visibility of the radar (but still allows targeting, hope this will get fixed soon). Suggestion is 30 K or 40 K meters. I recommend using this, otherwise the illusions of big distances is not given if everything is visible on the radar.
Building the Mission
Now that you know the flags, the rest explains itself. I will show you now some examples, and will give you some more tips, and that should do the trick. I will use demo-mission 2 for explanation, so you can refer to the mission itself (and me too of course), if you have questions:
Remark
These pictures are old, I highly recommend that you use restrict nav instead of hide nav. I have no Idea if we will get a navmap someday, but if we do we must not change the missions again.
Also important
- To make the autopilot flight not too long, I suggest making the distances between the navpoints to something like 50K or 100K meters (better 50 K when escorting slow capships). However, that leaves a small problem that the ships of your battlegroup (if you have one) are still staying visible. To avoid that (since we don’t want that, the idea is that the simulated distance is much bigger than only 50 km), I’m usually changing the models after a distance of 25000 meter to the invisible “Ghost” model that you will find In the table. Same for returning paths, rechange the models back when getting closer than 25000 meters.
- The enemy appearance should be that way, that capital ships show up (without warp) when the player is getting closer than 10K to 15K meters to a navpoint (maybe varify that a little, depends on the incoming ship size). Same goes for leaving navpoints. No need to keep the ships there and waste memory when you not intend the player to return to that nav (therefore “restrict Nav” again). Let fighters appear in the same moment when you arrive at the nav. Otherwise you risk that the autotarget-function is on and the player sees them cruising at 64xtime compression. Believe me, this sucks.
- So that was the biggest deal in creating autopilot-missions. You have to experiment a little with it, but that’s the core of the new feature. Everything else is set in the code. I want to say, it’s still a little buggy but that’s already being worked on from the SCP-Guys.
Example
Template Mission (template.fs2). NOTE: Uses ships from WC: Saga. Will be later replaced with FreeSpace version