A vehicle (NFO)

From PikkaWiki
(Difference between revisions)
Jump to: navigation, search
(Basic layout)
Line 25: Line 25:
 
*The action 4 sets the name of the vehicle.  See [http://wiki.ttdpatch.net/tiki-index.php?page=Action4 the wiki page].
 
*The action 4 sets the name of the vehicle.  See [http://wiki.ttdpatch.net/tiki-index.php?page=Action4 the wiki page].
  
*The action 0 sets the properties for the vehicle.  See [http://wiki.ttdpatch.net/tiki-index.php?page=Action0Vehicles the wiki page].
+
*The action 0 sets the properties for the vehicle.  See [http://wiki.ttdpatch.net/tiki-index.php?page=Action0General the wiki page].

Revision as of 23:48, 11 May 2007

This is an explanation of how to code a vehicle. You should have the wiki open while you read this, and refer to it. I will gloss over a lot of things that are explained in detail there.

Contents

Basic layout

The basic code structure for a vehicle in NFO is as follows:

Real sprites (Action 1)
Action 2
VarAction 2s
Action 3

Action 4
Action 0s
  • The real sprites are the graphics your vehicle will use. See the wiki page.
  • The action 2 gives the graphics a label (a "cargoID", although I prefer to think of it as an Action 2 ID). See the wiki page.
  • The VarAction2s are decision-making code between the action 3 and the action 2 (nb: you read action 2 chains from the bottom up, starting with the action 3 and ending with a "real" action 2!). They can also be used to do all kinds of cool tricks with the use of callbacks. Your first vehicle will probably not have any of these at all, but will simply have an action 3 pointing directly to a "real" action 2.
  • The action 3 is where you tell the vehicle what sprites to use. See the wiki page.
  • The action 0 sets the properties for the vehicle. See the wiki page.
Personal tools