Difference between revisions of "Native function"

From GTAMods Wiki
Jump to navigation Jump to search
m ("native" opcode)
Line 1: Line 1:
Native function is a specific parameter used in [[GTA IV]] and [[GTA V]] script engine that perform various tasks. There is a [[SCO#Opcodes|"native" opcode]] for calling natives.
+
A '''native function''' is a one of the functions exposed by the [[RAGE]] engine to be called from a [[script]]. Comparing to the [[SCM]] engine from previous GTA 3D series, which used thousands of [[opcode]]s assigned for commands both handling the scripts and performing the in-game tasks (such as manipulating peds, vehicles, displaying texts, etc), RAGE has less than [[SCO#Opcodes|100 opcodes]] only to handle the scripts itself. To retrieve the data and make any change in the game's world, a SCO script invokes an appropriate native function using a special opcode.
  
 
== GTA IV ==
 
== GTA IV ==
There are something like [[List of native functions (GTA IV)|~3000 of natives in GTA IV]]. Comparing to the scm-engine from previous GTA 3D series, which had one native to one opcode assigned, [[RAGE]] has less than 100 opcodes and they look like a real assembler, there is only one opcode for native calling. Native to call is the param of this opcode, this param is a hash of the native name.
+
There are something like [[List of native functions (GTA IV)|~3000 of natives in GTA IV]]. Their names are stored in the game's executable file, thus are known.
  
 
== GTA V ==
 
== GTA V ==
GTA V features ~4500 natives and almost all of these functions are in use in the original game scripts, this means that while building game's main executable only the natives required by the scripts are included (IV scripts were using only 2/3 of them). There is no original native name list in GTA V (IV had one), name hashes were used instead.
+
[[GTA V]] features ~4500 natives and almost all of these functions are in use in the original game scripts, this means that while building game's main executable only the natives required by the scripts are included (IV scripts were using only 2/3 of them). There is no original native name list in GTA V, name hashes were used instead.
  
 
== See also ==
 
== See also ==
*[[GTA V Native declarations]]
+
* [[GTA V Native declarations]]
 
* [[Scocl]] - a SCO compiler for GTA IV by {{U|Alexander Blade}}
 
* [[Scocl]] - a SCO compiler for GTA IV by {{U|Alexander Blade}}
  

Revision as of 17:09, 23 August 2014

A native function is a one of the functions exposed by the RAGE engine to be called from a script. Comparing to the SCM engine from previous GTA 3D series, which used thousands of opcodes assigned for commands both handling the scripts and performing the in-game tasks (such as manipulating peds, vehicles, displaying texts, etc), RAGE has less than 100 opcodes only to handle the scripts itself. To retrieve the data and make any change in the game's world, a SCO script invokes an appropriate native function using a special opcode.

GTA IV

There are something like ~3000 of natives in GTA IV. Their names are stored in the game's executable file, thus are known.

GTA V

GTA V features ~4500 natives and almost all of these functions are in use in the original game scripts, this means that while building game's main executable only the natives required by the scripts are included (IV scripts were using only 2/3 of them). There is no original native name list in GTA V, name hashes were used instead.

See also

External links