Tutorial - Autopilot missions

From FreeSpace Wiki
Revision as of 20:43, 25 July 2006 by Wanderer (talk | contribs) (initial page commit)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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©

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.

add-nav-waypoint

  • 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.

add-nav-ship

  • Same as above, but you can bind the Navpoint directly to a ship. So you can create a “moving” navpoint.

del-nav

  • Never used it till now, but it’s rather obvious what’s it used for.

hide-nav

  • 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.

restrict-nav

  • 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.

unhide-nav

  • Makes navpoints visible again

unrestrict-nav

  • Make them accessable again

set-nav-visited

  • 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.

unset-nav-visited

  • See above.

set-nav-carry

  • 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.

unset-nav-carry

  • 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:

Setting up the navpoints

Nav point pic1.jpg
  • TCS-Aurora is the transport, see how it get it’s own set-nav-carry-flag. The newer builds are more stable, so you can add more than one ship to a set-nav-carry It will get unset-nav-carry when it reaches Nav4 (not visible here, just place an operator).



  • Nav 1 is typed in manually, this will be displayed above the nav-point target-box in the game-engine. Keep this kind of naming for all Navs, we don’t want different ways of handling for each fredder, because it is only one game



  • Wayppoint Nav 1 is the waypoint, that we set in Fred as navpoints.



  • 1 is the number of the waypoint, if a waypoint-path is used.

Hide Navpoints and Set Radar-range

Nav point pic2.jpg
  • As said, this is for restricting the selection of Nav-points. The line of order, how the nav-points must be flown is given by the fredders. Of course there will be exceptions like bonus-goals or special mission-assignments.



  • Usage : At the mission-start is only Nav1 visible, maybe not even that, if you have big mission-chatter at the beginning. Simply activate the nav-point whenever you want using unhide-nav. On later Nav-Points there are only 2 visible, the green visited one where you currently are, and the next one (maybe activated a little later, according to the mission-script.



  • This will prevent that the player flies somewhere and miss vital mission-events.

Remark

These pictures are old, I hardly 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.