Difference between revisions of "0247"

From GTAMods Wiki
Jump to navigation Jump to search
(Added my favorite format :-))
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
{{OpCode
 
{{OpCode
| ini        = 0247=1,%1o%
+
| games      = {{Icon|t}}
| description = Loads a model into memory
+
| command    = REQUEST_MODEL
| p1          = [[DFF]] model ID or name as defined at the beginning of the <code>main.scm</code>
+
| description = Requests the model
| game        = GTA3, Vice City, San Andreas
+
| syntax1    = 0247: request_model [''int'']
 +
| syntax2    = Model.Load( [''int''] )
 +
| p1t        = [''int'']
 +
| p1d        = Valid model index as defined in the [[IDE]] file; also acceptable is model's [[DFF]] name with a hash character
 
| native      = [[REQUEST_MODEL]]
 
| native      = [[REQUEST_MODEL]]
 
}}
 
}}
This opcode is almost always required when using opcodes that creates characters, vehicles, or objects. This is also used to speed up loading certain map objects that you want to load quickly. [[0248]] checks if the model is loaded and [[0249]] marks the model as no longer needed.
 
  
==Example==
+
This opcode requests the model to be loaded into the game. It is almost always required when using opcodes that spawns [[Spawn a ped|characters]], [[Spawn a vehicle|vehicles]], objects, or [[weapon]]s. This is also used to speed up loading certain map objects that you want to load quickly. Opcode [[0248]] checks if the model has been loaded, opcode [[038B]] loads all models without the need for 0248, and opcode [[0249]] marks the model as no longer needed.
These examples will show you the ways of loading a model, with a ped model as an example. These will be only shown as examples and should not be copied verbatim. There can be several ways of doing this not shown here. The following codes uses the [[Sanny Builder]].
 
  
===Shorter format (only for Sanny Builder)===
+
== Example ==
<source lang="scm">
+
:''See [[009A#Example]], [[00A5#Example]], [[010E#Example]], [[01B2#Example]]
#BFORI.Load()
 
  
repeat
+
== Keywords ==
    wait 0
 
 
 
    if
 
        #BFORI.Available()
 
    then
 
        break
 
    end
 
until false
 
 
 
009A: 0@ = create_actor_pedtype 5 model #BFORI at 0.0 0.0 0.0
 
#BFORI.Destroy()
 
end_thread
 
</source>
 
 
 
===Recommended format===
 
<source lang="scm">
 
: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
 
</source>
 
 
 
===Rockstar's common format===
 
<source lang="scm">
 
: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
 
</source>
 
 
 
===Rockstar's less common format:===
 
<source lang="scm">
 
: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
 
</source>
 
 
 
==Keywords==
 
 
load, request, model
 
load, request, model

Latest revision as of 05:52, 7 July 2017

GTA III Vice City San Andreas REQUEST_MODEL


Description
Requests the model
Syntax
0247: request_model [int]
Model.Load( [int] )
Parameter
[int]
Valid model index as defined in the IDE file; also acceptable is model's DFF name with a hash character
Native analog
REQUEST_MODEL

This opcode requests the model to be loaded into the game. It is almost always required when using opcodes that spawns characters, vehicles, objects, or weapons. This is also used to speed up loading certain map objects that you want to load quickly. Opcode 0248 checks if the model has been loaded, opcode 038B loads all models without the need for 0248, and opcode 0249 marks the model as no longer needed.

Example

See 009A#Example, 00A5#Example, 010E#Example, 01B2#Example

Keywords

load, request, model