Difference between revisions of "009A"
m |
|||
Line 1: | Line 1: | ||
{{OpCode | {{OpCode | ||
− | | ini = 009A=6,%1d% %2o% %3d% %4d% %5d | + | | ini = 009A=6,%6d% %1d% %2o% %3d% %4d% %5d% |
| description = Creates a ped at a coordinate | | description = Creates a ped at a coordinate | ||
| p1 = [[Ped type]] | | p1 = [[Ped type]] | ||
Line 11: | Line 11: | ||
| native = [[CREATE_CHAR]] | | native = [[CREATE_CHAR]] | ||
}} | }} | ||
− | This creates a ped at a coordinate. Using this opcode requires [[0247]] or else the game might crash. | + | This creates a ped at a coordinate. Using this opcode requires [[0247]] or else the game might crash. Note that the sixth parameter is placed in the beginning instead of at the end. |
+ | [[Sanny Builder]] example:<source lang="scm">009A: 0@ = create_actor_pedtype 5 model #BFORI at 0.0 0.0 0.0</source> | ||
==Notes== | ==Notes== | ||
− | + | The above format is more commonly used. The actual format of this opcode is in order:<br> | |
− | <code>009A=6, | + | <code>009A=6,%1d% %2o% %3d% %4d% %5d% %6d%</code><br> |
− | The | + | The format to use depends on which INI file you use.<br> |
− | |||
− | |||
In Sanny Builder, this opcode is equivalent to the command '''Actor.Create'''. | In Sanny Builder, this opcode is equivalent to the command '''Actor.Create'''. |
Revision as of 23:04, 27 December 2008
{{{games}}}
- Description
- Creates a ped at a coordinate
- Syntax
- {{{syntax1}}}
- Parameter
- Native analog
- CREATE_CHAR
This creates a ped at a coordinate. Using this opcode requires 0247 or else the game might crash. Note that the sixth parameter is placed in the beginning instead of at the end.
Sanny Builder example:
009A: 0@ = create_actor_pedtype 5 model #BFORI at 0.0 0.0 0.0
Contents
Notes
The above format is more commonly used. The actual format of this opcode is in order:
009A=6,%1d% %2o% %3d% %4d% %5d% %6d%
The format to use depends on which INI file you use.
In Sanny Builder, this opcode is equivalent to the command Actor.Create.
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