Script Path: Difference between revisions

2,176 bytes added ,  5 August 2018
add related commands
mNo edit summary
(add related commands)
 
Line 26: Line 26:


== Mission script ==
== Mission script ==
The following commands along with their details relate directly to the script path in the game's mission script.
=== INITIALISE_OBJECT_PATH ===
<code>INITIALISE_OBJECT_PATH</code> (opcode 049C) is a command that requests a script path file to be used by other related commands. It can be released using <code>CLEAR_OBJECT_PATH</code>. The first parameter comes from the path file's number at the end of the file name, i.e. <code>spath0.dat</code> would use a value of 0, <code>spath1.dat</code> would use a value of 1, etc. The second parameter denotes how far from the path can the object be when traveling along the path. The larger the value, the more smooth the path can be, while the smaller the value, the more rigid the path can be. More than one variables can handle one script path file. Only one script path file was used in the [[Main.scm|original script]] but additional script paths can be created and used.
=== START_OBJECT_ON_PATH ===
<code>START_OBJECT_ON_PATH</code> (opcode 049D) is a command that attaches an object to the script path. The object is relocated to the current position of the path by the center of its bounding box so it does not matter how or where the object was created beforehand. The object's position and heading cannot be changed after being attached. Once the first object is attached to the path, the path will immediately start with a speed of 1.0 though that can be changed through <code>SET_OBJECT_PATH_SPEED</code>. This command can only be used a maximum of six times per script path; any more times do not attach the object and may cause game instability.
=== SET_OBJECT_PATH_SPEED ===
<code>SET_OBJECT_PATH_SPEED</code> (opcode 049E) is a command that sets the speed in units per second of the script path. A negative value is acceptable, allowing objects on the path to move backwards.
=== SET_OBJECT_PATH_POSITION ===
<code>SET_OBJECT_PATH_POSITION</code> (opcode 049F) is a command that sets the distance in units to put attached objects along the script path. ''0.0'' is the beginning of the path and the distance will never exceed the total distance of the path.
=== Example ===
The following example explains how <code>spath0.dat</code> is used in the original script in [[Sanny Builder]]'s format to move Cortez's yacht. First, the script path is initialized using opcode 049C.
The following example explains how <code>spath0.dat</code> is used in the original script in [[Sanny Builder]]'s format to move Cortez's yacht. First, the script path is initialized using opcode 049C.
{{Pre|1=
{{Pre|1=
Line 80: Line 95:


== See also ==
== See also ==
* [[Carrec|Carrec.img]]
* {{Icon|3}} [[Chase Scene]]
* {{Icon|SA}} [[Car Recording]]


{{fdl}}
{{fdl}}
12,236

edits