Difference between revisions of "049C"

From GTAMods Wiki
Jump to navigation Jump to search
(Created page with '{{OpCode | ini = 049C=3,%3d% %1h% %2d% | description = Creates a scripted path file | p1 = Scripted path file ID | p2 = Width | p3 …')
 
 
(6 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{{OpCode
 
{{OpCode
| ini        = 049C=3,%3d% %1h% %2d%
+
| games      = {{Icon|VC}}
| description = Creates a [[Scripted Path|scripted path file]]
+
| command    = INITIALISE_OBJECT_PATH
| p1          = Scripted path file ID
+
| description = Initialises a [[Script Path|script path]]
| p2          = Width
+
| syntax1    = 049C: [''var''] = scripted_path_file [''int''] width [''flt'']
| p3          = Scripted path handle
+
| p1t        = [''int'']
| game        = [[Vice City]]
+
| p1d        = Script path index
 +
| p2t        = [''flt'']
 +
| p2d        = Width of the path in units
 +
| p3t        = [''var'']
 +
| p3d        = Variable to store the handle of the script path
 
}}
 
}}
This opcode defines the scripted file to be used by other [[Scripted Path#Scripting|related opcodes]]. The first parameter comes from the path file's number at the end of the file name, i.e. spath0.dat would be ID 0, spath1.dat would be ID 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 curve can be. Only one scripted path file was used by default but additional scripted paths can be created and used. Note that the parameters are rearranged.
 
[[Sanny Builder]] example:<source lang="scm">049C: 0@ = scripted_path_file 0 width 5.0</source>
 
  
==Note==
+
This opcode initialises a script path to be used by [[Script Path#Mission script|script]]. It can be cleared using opcode [[04A1]]. The script path index 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 width of the path 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. One script path file was used in the [[Main.scm|original script]] for Cortez's yacht. A script path file can be initialised more than once. Only three script paths can be loaded at a time; you must clear one before you can initialise another one.
The above format is more commonly used. The actual format of this opcode is in order:<br>
+
 
<code>049C=3,%1d% %2h% %3d%</code><br>
+
== Keywords ==
The format to use depends on which INI file you use.
+
initialize, object, script, scripted, path, file

Latest revision as of 22:02, 4 September 2017

Vice City INITIALISE_OBJECT_PATH


Description
Initialises a script path
Syntax
049C: [var] = scripted_path_file [int] width [flt]
Parameter
[int]
Script path index
[flt]
Width of the path in units
[var]
Variable to store the handle of the script path

This opcode initialises a script path to be used by script. It can be cleared using opcode 04A1. The script path index comes from the path file's number at the end of the file name, i.e. spath0.dat would use a value of 0, spath1.dat would use a value of 1, etc. The width of the path 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. One script path file was used in the original script for Cortez's yacht. A script path file can be initialised more than once. Only three script paths can be loaded at a time; you must clear one before you can initialise another one.

Keywords

initialize, object, script, scripted, path, file