Difference between revisions of "009A"
m |
|||
Line 8: | Line 8: | ||
| p5 = Z-coordinate | | p5 = Z-coordinate | ||
| p6 = Actor handle | | p6 = Actor handle | ||
− | | game = | + | | game = [[GTA 3]], [[Vice City]], [[San Andreas]] |
| native = [[CREATE_CHAR]] | | native = [[CREATE_CHAR]] | ||
}} | }} | ||
Line 23: | Line 23: | ||
==Example== | ==Example== | ||
− | + | :''Main article: [[Spawn a ped]]'' | |
+ | This is an example code and should not be copied verbatim. The following codes is for San Andreas using Sanny Builder's format. | ||
<source lang="scm"> | <source lang="scm"> | ||
:LoadModel | :LoadModel | ||
Line 41: | Line 42: | ||
Special peds uses models <code>SPECIAL#.dff</code>, where <i>#</i> is a number from <i>01</i> to <i>04</i> in GTA3, <i>01</i> to <i>21</i> in Vice City, and <i>01</i> to <i>10</i> in San Andreas. 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>04</i> in GTA3, <i>01</i> to <i>21</i> in Vice City, and <i>01</i> to <i>10</i> in San Andreas. 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 | + | In GTA 3 and Vice City, every special actor number is used at least once. 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 | + | Loading special peds is similar to loading regular peds. The following code is for San Andreas using Sanny Builder's format. |
<source lang="scm"> | <source lang="scm"> | ||
:LoadModel | :LoadModel | ||
Line 61: | Line 62: | ||
==Keywords== | ==Keywords== | ||
create, spawn, actor, ped, pedestrian, pedtype, model, character | create, spawn, actor, ped, pedestrian, pedtype, model, character | ||
+ | |||
+ | __NOTOC__ |
Revision as of 04:07, 15 January 2010
{{{games}}}
- Description
- Creates a ped at a coordinate
- Syntax
- {{{syntax1}}}
- Parameter
- Native analog
- CREATE_CHAR
This creates a character at a coordinate. Using this opcode requires opcode 0247 or else the game might crash. The character will stay visible in the game even after it dies or after you die or get busted. If you no longer need your character anymore, you could turn it into a random ped using opcode 01C2 or destroy it instantly using opcodes 009B or 034F. Note that the sixth parameter is placed in the beginning instead of at the end.
Sanny Builder example:
009A: 0@ = create_actor_pedtype 4 model #BFORI at 0.0 0.0 0.0
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:
Actor.Create(0@, 4, #BFORI, 0.0, 0.0, 0.0)
Example
- Main article: Spawn a ped
This is an example code and should not be copied verbatim. The following codes is for San Andreas using Sanny Builder's format.
:LoadModel
0247: load_model #BFORI
:CheckModel
0001: wait 0 ms
00D6: if
0248: model #BFORI available
004D: jump_if_false @CheckModel
009A: 0@ = create_actor_pedtype 4 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 04 in GTA3, 01 to 21 in Vice City, and 01 to 10 in San Andreas. 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 GTA 3 and Vice City, every special actor number is used at least once. 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 is for San Andreas using Sanny Builder's format.
:LoadModel
023C: load_special_actor 'ANDRE' as 1
:CheckModel
0001: wait 0 ms
00D6: if
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, character