Difference between revisions of "009A"

From GTAMods Wiki
Jump to navigation Jump to search
m (meh, large enough to be some sort of tutorial)
Line 9: Line 9:
 
'''Supports''': GTA3, Vice City, San Andreas<br>
 
'''Supports''': GTA3, Vice City, San Andreas<br>
  
This creates a ped at a coordinate. Using this opcode requires [[0247]] or else the game would crash.
+
This creates a ped at a coordinate. Using this opcode requires [[0247]] or else the game might crash.
  
 
==Note==
 
==Note==
Line 21: Line 21:
 
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.
 
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>
+
<b>Recommended format:</b>
<code>:LoadModel<br></code>
+
:LoadModel
<code>[[0247]]: load_model #BFORI</code><br>
+
[[0247]]: load_model #BFORI
<code></code><br>
+
<code>:CheckModel</code><br>
+
:CheckModel
<code>[[0001]]: wait 0 ms</code><br>
+
[[0001]]: wait 0 ms
<code>[[00D6]]: if 0</code><br>
+
[[00D6]]: if 0
<code>[[0248]]: model #BFORI available</code><br>
+
[[0248]]:   model #BFORI available
<code>[[004D]]: jump_if_false @CheckModel</code><br>
+
[[004D]]: jump_if_false @CheckModel
<code>009A: 0@ = create_actor_pedtype 5 model #BFORI at 0.0 0.0 0.0</code><br>
+
009A: 0@ = create_actor_pedtype 5 model #BFORI at 0.0 0.0 0.0
<code>[[0249]]: release_model #BFORI</code><br>
+
[[0249]]: release_model #BFORI
<code>[[004E]]: end_thread</code><br>
+
[[004E]]: end_thread
<br>
+
 
<b>Rockstar's common format:</b><br>
+
<b>Rockstar's common format:</b>
<code>:LoadModel<br></code>
+
:LoadModel
<code>0247: load_model #BFORI</code><br>
+
0247: load_model #BFORI
<code></code><br>
+
<code>:CheckModel</code><br>
+
:CheckModel
<code>00D6: if 0</code><br>
+
00D6: if 0
<code>[[Conditional_opcode|8248]]:  not model #BFORI available</code><br>
+
[[Conditional_opcode|8248]]:  not model #BFORI available
<code>004D: jump_if_false @CreateModel</code><br>
+
004D: jump_if_false @CreateModel
<code>0001: wait 0 ms</code><br>
+
0001: wait 0 ms
<code>[[0002]]: jump @CheckModel</code><br>
+
[[0002]]: jump @CheckModel
<code></code><br>
+
<code>:CreateModel</code><br>
+
:CreateModel
<code>009A: 0@ = create_actor_pedtype 5 model #BFORI at 0.0 0.0 0.0</code><br>
+
009A: 0@ = create_actor_pedtype 5 model #BFORI at 0.0 0.0 0.0
<code>0249: release_model #BFORI</code><br>
+
0249: release_model #BFORI
<code>004E: end_thread</code><br>
+
004E: end_thread
<br>
+
 
<b>Rockstar's less common format:</b><br>
+
<b>Rockstar's less common format:</b>
<code>:LoadModel</code><br>
+
:LoadModel
<code>00D6: if 0</code><br>
+
00D6: if 0
<code>8248:  not model #BFORI available</code><br>
+
8248:  not model #BFORI available
<code>004D: jump_if_false @CreateModel</code><br>
+
004D: jump_if_false @CreateModel
<code>0247: load_model #BFORI</code><br>
+
0247: load_model #BFORI
<code>0001: wait 0 ms</code><br>
+
0001: wait 0 ms
<code>0002: jump @LoadModel</code><br>
+
0002: jump @LoadModel
<code></code><br>
+
<code>:CreateModel</code><br>
+
:CreateModel
<code>009A: 0@ = create_actor_pedtype 5 model #BFORI at 0.0 0.0 0.0</code><br>
+
009A: 0@ = create_actor_pedtype 5 model #BFORI at 0.0 0.0 0.0
<code>0249: release_model #BFORI</code><br>
+
0249: release_model #BFORI
<code>004E: end_thread</code>
+
004E: end_thread
  
 
==Special Peds==
 
==Special Peds==
 
Special peds uses models <code>SPECIAL#.dff</code>, where <i>#</i> is a number from <i>01</i> to <i>10</i>. It is used in conjunction with [[023C]]. The special actor ID number corresponds to the number in <code>SPECIAL#.dff</code>. You do not have to load <code>SPECIAL#.dff</code> as it is always loaded into the game. Each special actor ID can accommodate only one special ped at a time and can be replaced by another special ped if the other special ped has the same ID.
 
Special peds uses models <code>SPECIAL#.dff</code>, where <i>#</i> is a number from <i>01</i> to <i>10</i>. It is used in conjunction with [[023C]]. The special actor ID number corresponds to the number in <code>SPECIAL#.dff</code>. You do not have to load <code>SPECIAL#.dff</code> as it is always loaded into the game. Each special actor ID can accommodate only one special ped at a time and can be replaced by another special ped if the other special ped has the same ID.
  
In San Andreas, the game actively uses special actor numbers 1 to 5. The rest is not actively used in the game but it is still useable.
+
In San Andreas, the game actively uses special actor numbers 1 to 5. The rest is not actively used in the game but it is still usable.
  
 
===Example===
 
===Example===
 
Loading special peds is similar to loading regular peds. The following code uses Sanny Builder.
 
Loading special peds is similar to loading regular peds. The following code uses Sanny Builder.
 
+
:LoadModel
<code>:LoadModel<br></code>
+
[[023C]]: load_special_actor 'ANDRE' as 1
<code>[[023C]]: load_special_actor 'ANDRE' as 1</code><br>
+
<code></code><br>
+
:CheckModel
<code>:CheckModel</code><br>
+
0001: wait 0 ms
<code>0001: wait 0 ms</code><br>
+
00D6: if 0
<code>00D6: if 0</code><br>
+
[[023D]]:  special_actor 1 loaded
<code>[[023D]]:  special_actor 1 loaded</code><br>
+
004D: jump_if_false @CheckModel
<code>004D: jump_if_false @CheckModel</code><br>
+
009A: 0@ = create_actor_pedtype 23 model #SPECIAL01 at 0.0 0.0 0.0
<code>009A: 0@ = create_actor_pedtype 23 model #SPECIAL01 at 0.0 0.0 0.0</code><br>
+
[[0296]]: unload_special_actor 1
<code>[[0296]]: unload_special_actor 1</code><br>
+
004E: end_thread
<code>004E: end_thread</code><br>
 
  
 
==Keywords==
 
==Keywords==
create, spawn, actor, ped, , pedestrian, pedtype, model
+
create, spawn, actor, ped, pedestrian, pedtype, model
  
 
[[Category:OpCodes]][[Category:Mission Scripting]]
 
[[Category:OpCodes]][[Category:Mission Scripting]]

Revision as of 21:27, 25 November 2008

009A=6,%1d% %2o% %3d% %4d% %5d% %6d%
Description: Creates a ped at a coordinate
Parameter 1: Ped type
Parameter 2: Valid ped DFF model name or ID number as defined in the IDE file
Parameter 3: X-coordinate
Parameter 4: Y-coordinate
Parameter 5: Z-coordinate
Parameter 6: Actor handle
Supports: GTA3, Vice City, San Andreas

This creates a ped at a coordinate. Using this opcode requires 0247 or else the game might 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 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

Special Peds

Special peds uses models SPECIAL#.dff, where # is a number from 01 to 10. It is used in conjunction with 023C. The special actor ID number corresponds to the number in SPECIAL#.dff. You do not have to load SPECIAL#.dff as it is always loaded into the game. Each special actor ID can accommodate only one special ped at a time and can be replaced by another special ped if the other special ped has the same ID.

In San Andreas, the game actively uses special actor numbers 1 to 5. The rest is not actively used in the game but it is still usable.

Example

Loading special peds is similar to loading regular peds. The following code uses Sanny Builder.

:LoadModel
023C: load_special_actor 'ANDRE' as 1

:CheckModel
0001: wait 0 ms
00D6: if 0
023D:   special_actor 1 loaded
004D: jump_if_false @CheckModel
009A: 0@ = create_actor_pedtype 23 model #SPECIAL01 at 0.0 0.0 0.0
0296: unload_special_actor 1
004E: end_thread

Keywords

create, spawn, actor, ped, pedestrian, pedtype, model