Difference between revisions of "009A"

From GTAMods Wiki
Jump to navigation Jump to search
m
Line 19: Line 19:
  
 
==Example==
 
==Example==
Beginners have a hard time creating actors because it is tough to learn how to make a code that would create an actor successfully. This will be only shown as an example and shouldn't be copied word for word. There are other ways of doing this. The following code uses the Sanny Builder.
+
Beginners have a hard time creating actors because it is tough to learn how to make a code that would create an actor successfully. These will be only shown as examples and should not be copied verbatim. There are several ways of doing this. The following codes uses the Sanny Builder.
  
 +
<b>Recommended format:</b><br>
 
<code>:LoadModel<br></code>
 
<code>:LoadModel<br></code>
 
<code>[[0247]]: load_model #BFORI</code><br>
 
<code>[[0247]]: load_model #BFORI</code><br>
Line 31: Line 32:
 
<code>009A: 0@ = create_actor_pedtype 5 model #BFORI at 0.0 0.0 0.0</code><br>
 
<code>009A: 0@ = create_actor_pedtype 5 model #BFORI at 0.0 0.0 0.0</code><br>
 
<code>[[0249]]: release_model #BFORI</code><br>
 
<code>[[0249]]: release_model #BFORI</code><br>
<code>[[004E]]: end_thread</code>
+
<code>[[004E]]: end_thread</code><br>
 +
<br>
 +
<b>Rockstar's common format:</b><br>
 +
<code>:LoadModel<br></code>
 +
<code>0247: load_model #BFORI</code><br>
 +
<code></code><br>
 +
<code>:CheckModel</code><br>
 +
<code>00D6: if 0</code><br>
 +
<code>[[Conditional_opcode|8248]]:  not model #BFORI available</code><br>
 +
<code>004D: jump_if_false @CreateModel</code><br>
 +
<code>0001: wait 0 ms</code><br>
 +
<code>[[0002]]: jump @CheckModel</code><br>
 +
<code></code><br>
 +
<code>:CreateModel</code><br>
 +
<code>009A: 0@ = create_actor_pedtype 5 model #BFORI at 0.0 0.0 0.0</code><br>
 +
<code>0249: release_model #BFORI</code><br>
 +
<code>004E: end_thread</code><br>
 +
<br>
 +
<b>Rockstar's less common format:</b><br>
 +
<code>:LoadModel</code><br>
 +
<code>00D6: if 0</code><br>
 +
<code>8248:  not model #BFORI available</code><br>
 +
<code>004D: jump_if_false @CreateModel</code><br>
 +
<code>0247: load_model #BFORI</code><br>
 +
<code>0001: wait 0 ms</code><br>
 +
<code>0002: jump @LoadModel</code><br>
 +
<code></code><br>
 +
<code>:CreateModel</code><br>
 +
<code>009A: 0@ = create_actor_pedtype 5 model #BFORI at 0.0 0.0 0.0</code><br>
 +
<code>0249: release_model #BFORI</code><br>
 +
<code>004E: end_thread</code>
  
 
==Keywords==
 
==Keywords==

Revision as of 00:59, 27 October 2007

009A=6,%1d% %2o% %3d% %4d% %5d% %6d%
Description: Creates an actor at a coordinate
Parameter 1: Ped type
Parameter 2: DFF model name or ID
Parameter 3: X-coordinate
Parameter 4: Y-coordinate
Parameter 5: Z-coordinate
Parameter 6: Actor handle
Supports: GTA3, Vice City, San Andreas

This creates an actor at a coordinate. Using this opcode requires 0247 or else the game would crash.

Note

Sometimes this opcode is written as this:
009A=6,%6d% %1d% %2o% %3d% %4d% %5d%
The sixth parameter is placed in the beginning instead of at the end. This depends on which sascm.ini file you use.
Sanny Builder by default: 009A: 0@ = create_actor_pedtype 5 model #BFORI at 0.0 0.0 0.0

Example

Beginners have a hard time creating actors because it is tough to learn how to make a code that would create an actor successfully. These will be only shown as examples and should not be copied verbatim. There are several ways of doing this. The following codes uses the Sanny Builder.

Recommended format:
:LoadModel
0247: load_model #BFORI

:CheckModel
0001: wait 0 ms
00D6: if 0
0248: model #BFORI available
004D: jump_if_false @CheckModel
009A: 0@ = create_actor_pedtype 5 model #BFORI at 0.0 0.0 0.0
0249: release_model #BFORI
004E: end_thread

Rockstar's common format:
:LoadModel
0247: load_model #BFORI

:CheckModel
00D6: if 0
8248: not model #BFORI available
004D: jump_if_false @CreateModel
0001: wait 0 ms
0002: jump @CheckModel

:CreateModel
009A: 0@ = create_actor_pedtype 5 model #BFORI at 0.0 0.0 0.0
0249: release_model #BFORI
004E: end_thread

Rockstar's less common format:
:LoadModel
00D6: if 0
8248: not model #BFORI available
004D: jump_if_false @CreateModel
0247: load_model #BFORI
0001: wait 0 ms
0002: jump @LoadModel

:CreateModel
009A: 0@ = create_actor_pedtype 5 model #BFORI at 0.0 0.0 0.0
0249: release_model #BFORI
004E: end_thread

Keywords

create, actor, pedtype, model