Difference between revisions of "0107"

From GTAMods Wiki
Jump to navigation Jump to search
m
 
Line 6: Line 6:
 
| syntax1    = 0107: [''var''] = create_object [''int''] at [''flt1''] [''flt2''] [''flt3'']
 
| syntax1    = 0107: [''var''] = create_object [''int''] at [''flt1''] [''flt2''] [''flt3'']
 
| p1t        = [''int'']
 
| p1t        = [''int'']
| p1d        = Model ID number as defined in the [[IDE]] file; also acceptable is model's [[DFF]] name with a hash character
+
| p1d        = Model index as defined in the [[IDE]] file; also acceptable is model's [[DFF]] name with a hash character
 
| p2t        = [''flt1'']
 
| p2t        = [''flt1'']
 
| p2d        = X-coordinate
 
| p2d        = X-coordinate
Line 20: Line 20:
  
 
In GTA III and Vice City, there are two models that exhibit unique behaviors when created: <code>money.dff</code> and <code>[[Collectibles#GTA III|package1.dff]]</code>. They will appear just like a regular [[pickup]] (rotating, glowing coronas, and emitting light) but they can't be picked up and they have collision.
 
In GTA III and Vice City, there are two models that exhibit unique behaviors when created: <code>money.dff</code> and <code>[[Collectibles#GTA III|package1.dff]]</code>. They will appear just like a regular [[pickup]] (rotating, glowing coronas, and emitting light) but they can't be picked up and they have collision.
 +
 +
== Example ==
 +
:''See [[0392#Example]]''
  
 
== Keywords ==
 
== Keywords ==

Latest revision as of 05:43, 1 February 2017

The left bus sign was created using 0107 while the right was created using 029B, both at ground z.

GTA III Vice City San Andreas CREATE_OBJECT


Description
Creates an object at the coordinates point
Syntax
0107: [var] = create_object [int] at [flt1] [flt2] [flt3]
Parameter
[int]
Model index as defined in the IDE file; also acceptable is model's DFF name with a hash character
[flt1]
X-coordinate
[flt2]
Y-coordinate
[flt3]
Z-coordinate (or ≤-100.0 for ground z)
[var]
Variable to store the handle of the object

This opcode creates an object at the coordinates point. The z-coordinate uses the base rather than the center of the object's bounding box. Use opcode 029B to create an object without this offset. It is not required to load the model (like through opcode 0247) to create the object. The object must already have an entry in the object.dat file in order for them to be stable. Without an entry, the object can become unstable and when that happens the game will crash.

In GTA III and Vice City, there are two models that exhibit unique behaviors when created: money.dff and package1.dff. They will appear just like a regular pickup (rotating, glowing coronas, and emitting light) but they can't be picked up and they have collision.

Example

See 0392#Example

Keywords

create, spawn, object, model

See also

  • GTA III Vice City San Andreas 029B, creates an object without offset