Difference between revisions of "Script"

From GTAMods Wiki
Jump to navigation Jump to search
(See also)
m
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
A term '''thread''' means some kind of minimal process in computer science. Processes and threads are used to simulate parallel execution of programcode. But there is a difference between both: a process describes the execution of a whole program. It contains an image of the programs binary executeable code in memory just as it is used for handling memory allocation by the operating system. However a thread is nothing in this way. It does just describe a parallel execution of code inside a process, so one process can hold multiple threads.
+
A '''script''' is a collection of [[opcode|instructions]] that performs a specific task when executed by a virtual machine.  
 
 
The description above is just one very simple definition of a thread. GTA simplifies multithreading alot so everything the script needs to do is to start a thread and perhaps end it somehow. It does not need to handle variable synchronisation or communication between two threads. This is what the game does through internal routines.
 
  
 
== Mission Script ==
 
== Mission Script ==
 
[[Opcode]]s:
 
[[Opcode]]s:
* [[00D7]] – Creates a thread
+
* [[00D7]] – Starts a script
* [[004F]] – Creates a thread with additional parameters
+
* [[004F]] – Starts a script with additional parameters
* [[004E]] – Ends the current thread
+
* [[004E]] – Ends the current script
* [[03A4]] – Gives a thread a name
+
* [[03A4]] – Gives a name to the script
* [[0459]] – Ends a named thread
+
* [[0459]] – Ends a named script
  
''[[CLEO]] Opcodes'':
+
[[CLEO]] Opcodes:
* [[0A92]] – Creates a ''CLEO'' thread
+
* [[0A92]] – Starts a ''CLEO'' script
* [[0A93]] – Ends a ''CLEO'' thread
+
* [[0A93]] – Ends a ''CLEO'' script
* [[0A95]] – Enables thread saving for a ''CLEO'' thread
+
* [[0A95]] – Enables saving for a ''CLEO'' script
* [[0A9F]] – Returns the pointer to the current thread
+
* [[0A9F]] – Returns the pointer to the current script
* [[0AAA]] – Returns the pointer to a named thread
+
* [[0AAA]] – Returns the pointer to a named CLEO script
* [[0ABA]] – Ends a named ''CLEO'' thread
+
* [[0ABA]] – Ends a named ''CLEO'' script
 +
 
 +
[[Native function]]s:
 +
* [[REQUEST_SCRIPT]]
 +
* [[START_NEW_SCRIPT]]
 +
* [[START_NEW_SCRIPT_WITH_ARGS]]
 +
* [[TERMINATE_ALL_SCRIPTS_WITH_THIS_NAME]]
 +
* [[TERMINATE_THIS_SCRIPT]]
 +
* [[MARK_SCRIPT_AS_NO_LONGER_NEEDED]]
 +
* [[STORE_SCRIPT_VALUES_FOR_NETWORK_GAME]]
 +
* [[THIS_SCRIPT_IS_SAFE_FOR_NETWORK_GAME]]
 +
* [[THIS_SCRIPT_SHOULD_BE_SAVED]]
  
 
{{Incomplete}}
 
{{Incomplete}}
 +
 
== See also ==
 
== See also ==
 
* [[Mission Scripting (Overview)]]
 
* [[Mission Scripting (Overview)]]
* {{Icon|SA}} [[Create a thread]]
+
* {{Icon|SA}} [[Create a script]]
* {{Icon|SA}} Thread structure in memory - [http://www.gtamodding.com/index.php?title=Memory_Addresses_(SA)#Threads] [http://www.gtamodding.com/index.php?title=Saves_(GTA_SA)#Block_1:_Script]
+
* {{Icon|SA}} Script structure in memory - [http://www.gtamodding.com/index.php?title=Memory_Addresses_(SA)#Threads] [http://www.gtamodding.com/index.php?title=Saves_(GTA_SA)#Block_1:_Script]
  
 
== External links ==
 
== External links ==
* [[Wikipedia:Process_(computing)|Process]]
+
* [[Wikipedia:Computer_program|Program]]
* [[Wikipedia:Thread_(computer_science)|Thread]]
 
  
{{N|4|SA}}
+
{{N|4|SA|VC|3}}
 
[[Category:Mission_Scripting]]
 
[[Category:Mission_Scripting]]

Latest revision as of 19:53, 5 September 2016

A script is a collection of instructions that performs a specific task when executed by a virtual machine.

Mission Script

Opcodes:

  • 00D7 – Starts a script
  • 004F – Starts a script with additional parameters
  • 004E – Ends the current script
  • 03A4 – Gives a name to the script
  • 0459 – Ends a named script

CLEO Opcodes:

  • 0A92 – Starts a CLEO script
  • 0A93 – Ends a CLEO script
  • 0A95 – Enables saving for a CLEO script
  • 0A9F – Returns the pointer to the current script
  • 0AAA – Returns the pointer to a named CLEO script
  • 0ABA – Ends a named CLEO script

Native functions:

This section is incomplete. You can help by fixing and expanding it.

See also

External links