Difference between revisions of "Streamed Script"
m (Seemann moved page Streamed Scripts to Streamed Script: singular form preferred) |
(wrong IV category removed) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | + | A '''streamed script''' is a script file that is streamed on demand, only when the script needs to be executed. They are stored in the [[script.img]] file. It contains the opcodes which are parsed by the game in the same way as the ones located in usual scripts, except that it has no header. | |
− | |||
− | ==Tutorial== | + | == GTA San Andreas == |
+ | The file is located in the <code>data/script/</code> directory and is loaded by [[gta.dat]]. | ||
+ | |||
+ | The maximum number of streamed scripts that can be defined is 82. The maximum number of streamed scripts that can be used simultaneously is 70. The game currently has 78 defined streamed scripts. | ||
+ | |||
+ | ===Tutorial=== | ||
In order to add more external script files, you have to define the number of files you are going to use:<br> | In order to add more external script files, you have to define the number of files you are going to use:<br> | ||
<code>DEFINE EXTERNAL_SCRIPTS 78</code><br> | <code>DEFINE EXTERNAL_SCRIPTS 78</code><br> | ||
Line 11: | Line 15: | ||
{{incomplete}} | {{incomplete}} | ||
− | ==Opcodes== | + | ===Opcodes=== |
− | + | * [[07D3]] - Adds a script brain for peds. | |
− | [[07D3]] - | + | * [[0884]] - Adds a script brain for peds triggered by attractors. |
− | [[0884]] - | + | * [[08A9]] - Loads a streamed script. |
− | [[08A9]] - Loads | + | * [[08AB]] - Checks if the streamed script has been loaded. |
− | [[08AB]] - Checks if the | + | * [[08E8]] - Attaches an animation to a ped model. |
− | [[08E8]] - | + | * [[090F]] - Marks a previously loaded streamed script as no longer needed. |
− | [[090F]] - | + | * [[0910]] - Frees an streamed script from the memory (shouldn't be used). |
− | [[0910]] - | + | * [[0913]] - Runs the streamed script (needs to be loaded first). |
− | [[0913]] - Runs the | + | * [[091C]] - Gets an ped using an attractor with the specified model and in the specified area. |
− | + | * [[0926]] - Gets the number of instances of a script. | |
− | [[091C]] - Gets an | + | * [[0928]] - Tells the engine to start a streamed script when the player is within the range of the specified ped. |
− | [[0926]] - Gets the | + | * [[0929]] - Tells the engine to start a streamed script when the player is within the range of the specified model. |
− | [[0928]] - | + | |
− | [[0929]] - | + | ===Problems=== |
+ | There is one main problem with streamed scripts: the script doesn't work if you save while the script is running. If you reload the game, the streamed script will be disabled. You have to force the script to end before saving to prevent this from happening. | ||
− | == | + | == GTA IV == |
− | + | {{incomplete}} | |
==See also== | ==See also== | ||
− | *[[Script.img#San Andreas|List of | + | * [[Resource Streaming]] |
+ | * [[SCM]] | ||
+ | * [[Script.img#San Andreas|List of streamed scripts]] | ||
− | + | {{N|SA|IV}} | |
+ | [[Category:Mission Script]] |
Latest revision as of 22:58, 5 February 2015
A streamed script is a script file that is streamed on demand, only when the script needs to be executed. They are stored in the script.img file. It contains the opcodes which are parsed by the game in the same way as the ones located in usual scripts, except that it has no header.
GTA San Andreas
The file is located in the data/script/
directory and is loaded by gta.dat.
The maximum number of streamed scripts that can be defined is 82. The maximum number of streamed scripts that can be used simultaneously is 70. The game currently has 78 defined streamed scripts.
Tutorial
In order to add more external script files, you have to define the number of files you are going to use:
DEFINE EXTERNAL_SCRIPTS 78
Add the external script to the list with this:
DEFINE SCRIPT NAME AT LABEL
At the end of the file add your code in.
This section is incomplete. You can help by fixing and expanding it.
Opcodes
- 07D3 - Adds a script brain for peds.
- 0884 - Adds a script brain for peds triggered by attractors.
- 08A9 - Loads a streamed script.
- 08AB - Checks if the streamed script has been loaded.
- 08E8 - Attaches an animation to a ped model.
- 090F - Marks a previously loaded streamed script as no longer needed.
- 0910 - Frees an streamed script from the memory (shouldn't be used).
- 0913 - Runs the streamed script (needs to be loaded first).
- 091C - Gets an ped using an attractor with the specified model and in the specified area.
- 0926 - Gets the number of instances of a script.
- 0928 - Tells the engine to start a streamed script when the player is within the range of the specified ped.
- 0929 - Tells the engine to start a streamed script when the player is within the range of the specified model.
Problems
There is one main problem with streamed scripts: the script doesn't work if you save while the script is running. If you reload the game, the streamed script will be disabled. You have to force the script to end before saving to prevent this from happening.
GTA IV
This section is incomplete. You can help by fixing and expanding it.
See also
Grand Theft Auto IV | |
---|---|
File Formats | .dat • .gxt • .ide • .img • .ipl • .nod • .sco • .rpf • .rrr • .wad • .wbd/.wbn • .wdd • .wdr • .wft • .whm • .wpl • .wtd |
Documentation | Audio • Bink Video • Cryptography • Cutscenes • GXT Text • Image listing • Keycodes • Map Listing • Native functions • Paths • Radar Blips • Radio Stations • Saves • Scenarios • VTable • Weapons |
Tools | ASI Loader • ENBSeries • G-Texture • GIMS IV • Ingame WPL Editor • IV Needle • OpenIV • SparkIV • XLiveLess • WPL Manager • X Mod Installer Alice • C++ Script Hook • .NET Script Hook • Scocl |
Tutorials | Importing Textures with OpenIV • Importing Textures with SparkIV |
Modifications | GTA Connected • Gostown IV • Four Multiplayer • IV Multiplayer • CitizenMP:IV Reloaded |
Useful links | Community portal • Discussion forums • Modding forums • Mods on GTAGarage.com |