Difference between revisions of "0213"

From GTAMods Wiki
Jump to navigation Jump to search
m
(San Andreas)
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
{{TocRight}}
 
{{TocRight}}
{{Icon|trilogy}} '''CREATE_PICKUP'''
+
{{OpCode
<hr />
+
| games      = {{Icon|t}}
'''Description'''
+
| command    = CREATE_PICKUP
: Creates a [[pickup]]
+
| description = Creates a [[pickup]]
'''Syntax'''
+
| syntax1    = 0213: [''var''] = create_pickup [''int1''] type [''int2''] at [''flt1''] [''flt2''] [''flt3'']
: 0213: [''var''] = create_pickup [''int1''] type [''int2''] at [''flt1''] [''flt2''] [''flt3'']
+
| syntax2    = Pickup.Create( [''var''], [''int1''], [''int2''], [''flt1''] [''flt2''] [''flt3''] )
: Pickup.Create( [''var''], [''int1''], [''int2''], [''flt1''] [''flt2''] [''flt3''] )
+
| p1t        = [''int1'']
'''Parameter'''
+
| p1d        = Valid model index as defined in the [[IDE]] file; also acceptable is model's [[DFF]] name with a hash character
: [''var'']
+
| p2t        = [''int2'']
:: Variable to store the handle of the pickup
+
| p2d        = Type ([[#Pickup types|see below]])
: [''int1'']
+
| p3t        = [''flt1'']
:: Valid object model ID number as defined in the [[IDE]] file; also acceptable is model's [[DFF]] name identified by a hash character
+
| p3d        = X-coordinate
: [''int2'']
+
| p4t        = [''flt2'']
:: [[#Pickup types|Type]]
+
| p4d        = Y-coordinate
: [''flt1'']
+
| p5t        = [''flt3'']
:: X-coordinate
+
| p5d        = Z-coordinate (or &le;''-100.0'' for [[02CE|ground z]] + 0.5 units)
: [''flt2'']
+
| p6t        = [''var'']
:: Y-coordinate
+
| p6d        = Variable to store the handle of the pickup
: [''flt3'']
+
| native      = [[CREATE_PICKUP]]
:: Z-coordinate
+
}}
'''Native analog'''
 
: [[CREATE_PICKUP]]
 
  
This opcode spawns a pickup at a coordinates point that can be "collected" by the player.
+
This opcode spawns a pickup at the coordinates point that can be "collected" by the player.
  
 
The maximum number of pickups that can be spawned in GTA III and Vice City is 336 and in San Andreas is 620. Passing the limit will no longer spawn anymore pickups but the game will not crash.
 
The maximum number of pickups that can be spawned in GTA III and Vice City is 336 and in San Andreas is 620. Passing the limit will no longer spawn anymore pickups but the game will not crash.
Line 29: Line 27:
 
== Example ==
 
== Example ==
 
The following example, using Sanny Builder, will spawn a type 2 adrenaline pickup close to the player character.
 
The following example, using Sanny Builder, will spawn a type 2 adrenaline pickup close to the player character.
<syntaxhighlight lang="scm">
+
{{Pre|class=sb-code|1=
// set constants
+
<span class="c1">// set constants</span>
const
+
<span class="k">const</span>
PICKUP_MODEL = #ADRENALINE
+
PICKUP_MODEL = <span class="nt">#ADRENALINE</span>
PICKUP_HANDLE = 0@
+
PICKUP_HANDLE = <span class="nv">0@</span>
X_POS = 1@
+
X_POS = <span class="nv">1@</span>
Y_POS = 2@
+
Y_POS = <span class="nv">2@</span>
Z_POS = 3@
+
Z_POS = <span class="nv">3@</span>
end
+
<span class="k">end</span>
  
// spawn pickup
+
<span class="c1">// spawn pickup</span>
00A0: store_actor $PLAYER_ACTOR position_to X_POS Y_POS Z_POS
+
00A0: store_actor <span class="nv">$PLAYER_ACTOR</span> position_to X_POS Y_POS Z_POS
X_POS += 4.0
+
X_POS += <span class="m">4.0</span>
0213: PICKUP_HANDLE = create_pickup PICKUP_MODEL type 2 at X_POS Y_POS Z_POS
+
0213: PICKUP_HANDLE = create_pickup PICKUP_MODEL type <span class="m">2</span> at X_POS Y_POS Z_POS
</syntaxhighlight>
+
}}
  
 
== Pickup types ==
 
== Pickup types ==
 
This is a list of all available types of pickups.
 
This is a list of all available types of pickups.
 
=== GTA III ===
 
=== GTA III ===
{| class="wikitable"
+
{| class="wikitable center-col-1"
! Value
+
! Type
 
! Enum
 
! Enum
 
! Type
 
! Type
Line 55: Line 53:
 
|-
 
|-
 
| 1
 
| 1
| PICKUP_IN_SHOP
+
| PICKUP_<wbr>IN_<wbr>SHOP
 
| weapon/item pickup with cost
 
| weapon/item pickup with cost
| respawn time ~5s, see [[#GTA III 2|below]] for cost
+
| respawn time ~5s, ([[#GTA III 2|see below]] for cost)
 
|-
 
|-
 
| 2
 
| 2
| PICKUP_ON_STREET
+
| PICKUP_<wbr>ON_<wbr>STREET
 
| weapon/item pickup
 
| weapon/item pickup
 
| respawn time ~30s, respawn distance ~15m
 
| respawn time ~30s, respawn distance ~15m
 
|-
 
|-
 
| 3
 
| 3
| PICKUP_ONCE
+
| PICKUP_<wbr>ONCE
 
| weapon/item pickup
 
| weapon/item pickup
 
| one-time pickup, does not respawn
 
| one-time pickup, does not respawn
 
|-
 
|-
 
| 4
 
| 4
| PICKUP_ONCE_TIMEOUT
+
| PICKUP_<wbr>ONCE_<wbr>TIMEOUT
| weapon/item pickup  
+
| weapon/item pickup
 
| one-time pickup, does not respawn, disappears in 20s
 
| one-time pickup, does not respawn, disappears in 20s
 
|-
 
|-
 
| 5
 
| 5
| PICKUP_COLLECTABLE1
+
| PICKUP_<wbr>COLLECTABLE1
| [[hidden package]] pickup  
+
| [[hidden package]] pickup
 
| behaves exactly like a package including stat update and money reward
 
| behaves exactly like a package including stat update and money reward
 
|-
 
|-
 
| 6
 
| 6
| PICKUP_IN_SHOP_OUT_OF_STOCK
+
| PICKUP_<wbr>IN_<wbr>SHOP_<wbr>OUT_<wbr>OF_<wbr>STOCK
| out of stock pickup  
+
| out of stock pickup
 
| object model darkened, unpickable
 
| object model darkened, unpickable
 
|-
 
|-
 
| 7
 
| 7
| PICKUP_MONEY
+
| PICKUP_<wbr>MONEY
| money pickup  
+
| money pickup
| no money actually added but money sound plays, one-time pickup, does not respawn, disappears in 30s
+
| no money actually added but money sound plays (money can be added using [[032B]]), one-time pickup, does not respawn, disappears in 30s
 
|-
 
|-
 
| 8
 
| 8
| PICKUP_MINE_INACTIVE
+
| PICKUP_<wbr>MINE_<wbr>INACTIVE
| proximity bomb
+
| inactive mine
| selfdestructs in ~10s if player is in vehicle, explodes upon contact with player vehicle
+
| not interactive with anything if player is on foot, pickup type changes to 9 once the player is in any vehicle
 
|-
 
|-
 
| 9
 
| 9
| PICKUP_MINE_ARMED
+
| PICKUP_<wbr>MINE_<wbr>ARMED
| proximity bomb
+
| armed mine
| selfdestructs in ~10s if player is in vehicle, explodes upon contact with player vehicle
+
| any pickup spawned with this type automatically changes to type 8, this type applies only when pickup type changes from 8 to 9 &mdash; selfdestructs in ~10s, explodes upon contact with any vehicle, does not respawn
 
|-
 
|-
 
| 10
 
| 10
| PICKUP_NAUTICAL_MINE_INACTIVE
+
| PICKUP_<wbr>NAUTICAL_<wbr>MINE_<wbr>INACTIVE
| proximity bomb  
+
| proximity bomb
 
| selfdestructs in ~10s, explodes upon contact with player vehicle, can float above water but weapon halo doesn't float with object, does not respawn
 
| selfdestructs in ~10s, explodes upon contact with player vehicle, can float above water but weapon halo doesn't float with object, does not respawn
 
|-
 
|-
 
| 11
 
| 11
| PICKUP_NAUTICAL_MINE_ARMED
+
| PICKUP_<wbr>NAUTICAL_<wbr>MINE_<wbr>ARMED
| proximity bomb  
+
| proximity bomb
 
| selfdestructs in ~10s, explodes upon contact with player vehicle, can float above water but weapon halo doesn't float with object, does not respawn
 
| selfdestructs in ~10s, explodes upon contact with player vehicle, can float above water but weapon halo doesn't float with object, does not respawn
 
|-
 
|-
 
| 12
 
| 12
| PICKUP_FLOATINGPACKAGE
+
| PICKUP_<wbr>FLOATINGPACKAGE
| vehicle pickup  
+
| vehicle pickup
 
| drive through it to pick it up, can't be picked up on foot, object model sinks through ground, can only float on water, does not respawn (opcode [[035B]])
 
| drive through it to pick it up, can't be picked up on foot, object model sinks through ground, can only float on water, does not respawn (opcode [[035B]])
 
|-
 
|-
 
| 13
 
| 13
| PICKUP_FLOATINGPACKAGE_FLOATING
+
| PICKUP_<wbr>FLOATINGPACKAGE_<wbr>FLOATING
| vehicle pickup  
+
| vehicle pickup
 
| drive through it to pick it up, can't be picked up on foot, can float on water, does not respawn
 
| drive through it to pick it up, can't be picked up on foot, can float on water, does not respawn
 
|-
 
|-
 
| 14
 
| 14
| PICKUP_ON_STREET_SLOW
+
| PICKUP_<wbr>ON_<wbr>STREET_<wbr>SLOW
 
| weapon/item pickup
 
| weapon/item pickup
 
| respawn time ~30s, respawn distance ~15m
 
| respawn time ~30s, respawn distance ~15m
Line 126: Line 124:
  
 
===Vice City===
 
===Vice City===
{| class="wikitable"
+
{| class="wikitable center-col-1"
! Value
+
! Type
! Enum
+
! [[SCM language III/VC definitions#PICKUP|Enum]]
 
! Type
 
! Type
 
! Notes
 
! Notes
 
|-
 
|-
 
| 1
 
| 1
| PICKUP_IN_SHOP
+
| PICKUP_<wbr>IN_<wbr>SHOP
 
| weapon/item pickup with cost
 
| weapon/item pickup with cost
| respawn time ~5s
+
| respawn time ~5s, ([[#Vice City 2|see below]] for cost)
 
|-
 
|-
 
| 2
 
| 2
| PICKUP_ON_STREET
+
| PICKUP_<wbr>ON_<wbr>STREET
 
| weapon/item pickup
 
| weapon/item pickup
 
| respawn time ~30s, respawn distance ~15m
 
| respawn time ~30s, respawn distance ~15m
 
|-
 
|-
 
| 3
 
| 3
| PICKUP_ONCE
+
| PICKUP_<wbr>ONCE
 
| weapon/item pickup
 
| weapon/item pickup
 
| one-time pickup, does not respawn
 
| one-time pickup, does not respawn
 
|-
 
|-
 
| 4
 
| 4
| PICKUP_ONCE_TIMEOUT
+
| PICKUP_<wbr>ONCE_<wbr>TIMEOUT
 
| weapon/item pickup
 
| weapon/item pickup
 
| one-time pickup, does not respawn, disappears in 20s
 
| one-time pickup, does not respawn, disappears in 20s
 
|-
 
|-
 
| 5
 
| 5
| PICKUP_ONCE_TIMEOUT_SLOW
+
| PICKUP_<wbr>ONCE_<wbr>TIMEOUT_<wbr>SLOW
 
| weapon/item pickup
 
| weapon/item pickup
 
| one-time pickup, does not respawn, disappears in 120s
 
| one-time pickup, does not respawn, disappears in 120s
 
|-
 
|-
 
| 6
 
| 6
| PICKUP_COLLECTABLE1
+
| PICKUP_<wbr>COLLECTABLE1
 
| [[hidden package]] pickup
 
| [[hidden package]] pickup
 
| behaves exactly like a package including stat update and money reward
 
| behaves exactly like a package including stat update and money reward
 
|-
 
|-
 
| 7
 
| 7
| PICKUP_IN_SHOP_OUT_OF_STOCK
+
| PICKUP_<wbr>IN_<wbr>SHOP_<wbr>OUT_<wbr>OF_<wbr>STOCK
 
| out of stock pickup
 
| out of stock pickup
 
| object model darkened, unpickable
 
| object model darkened, unpickable
 
|-
 
|-
 
| 8
 
| 8
| PICKUP_MONEY
+
| PICKUP_<wbr>MONEY
 
| money pickup
 
| money pickup
| no money actually added but money dialogue and sound plays, one-time pickup, does not respawn, disappears in 30s
+
| no money actually added but money dialogue and sound plays (money can be added using [[032B]]), one-time pickup, does not respawn, disappears in 30s
 
|-
 
|-
 
| 9
 
| 9
| PICKUP_MINE_INACTIVE
+
| PICKUP_<wbr>MINE_<wbr>INACTIVE
| proximity bomb
+
| inactive mine
| selfdestructs in ~10s if player is in vehicle, explodes upon contact with player vehicle
+
| not interactive with anything if player is on foot, pickup type changes to 10 once the player is in any vehicle
 
|-
 
|-
 
| 10
 
| 10
| PICKUP_MINE_ARMED
+
| PICKUP_<wbr>MINE_<wbr>ARMED
| proximity bomb
+
| armed mine
| selfdestructs in ~10s if player is in vehicle, explodes upon contact with player vehicle
+
| any pickup spawned with this type automatically changes to type 9, this type applies only when pickup type changes from 9 to 10 &mdash; selfdestructs in ~10s, explodes upon contact with any vehicle, does not respawn
 
|-
 
|-
 
| 11
 
| 11
| PICKUP_NAUTICAL_MINE_INACTIVE
+
| PICKUP_<wbr>NAUTICAL_<wbr>MINE_<wbr>INACTIVE
 
| proximity bomb
 
| proximity bomb
 
| selfdestructs in ~10s, explodes upon contact with player vehicle, can float above water but weapon halo doesn't float with object, does not respawn
 
| selfdestructs in ~10s, explodes upon contact with player vehicle, can float above water but weapon halo doesn't float with object, does not respawn
 
|-
 
|-
 
| 12
 
| 12
| PICKUP_NAUTICAL_MINE_ARMED
+
| PICKUP_<wbr>NAUTICAL_<wbr>MINE_<wbr>ARMED
 
| proximity bomb
 
| proximity bomb
 
| selfdestructs in ~10s, explodes upon contact with player vehicle, can float above water but weapon halo doesn't float with object, does not respawn
 
| selfdestructs in ~10s, explodes upon contact with player vehicle, can float above water but weapon halo doesn't float with object, does not respawn
 
|-
 
|-
 
| 13
 
| 13
| PICKUP_FLOATINGPACKAGE
+
| PICKUP_<wbr>FLOATINGPACKAGE
 
| vehicle pickup
 
| vehicle pickup
 
| drive through it to pick it up, can't be picked up on foot, object model sinks through ground, can only float on water but weapon halo doesn't float with object, does not respawn
 
| drive through it to pick it up, can't be picked up on foot, object model sinks through ground, can only float on water but weapon halo doesn't float with object, does not respawn
 
|-
 
|-
 
| 14
 
| 14
| PICKUP_FLOATINGPACKAGE_FLOATING
+
| PICKUP_<wbr>FLOATINGPACKAGE_<wbr>FLOATING
 
| vehicle pickup
 
| vehicle pickup
 
| drive through it to pick it up, can't be picked up on foot, can float on water but weapon halo doesn't float with object, does not respawn
 
| drive through it to pick it up, can't be picked up on foot, can float on water but weapon halo doesn't float with object, does not respawn
 
|-
 
|-
 
| 15
 
| 15
| PICKUP_ON_STREET_SLOW
+
| PICKUP_<wbr>ON_<wbr>STREET_<wbr>SLOW
 
| weapon/item pickup
 
| weapon/item pickup
 
| respawn time ~30s, respawn distance ~15m
 
| respawn time ~30s, respawn distance ~15m
 
|-
 
|-
 
| 16
 
| 16
| PICKUP_ASSET_REVENUE
+
| PICKUP_<wbr>ASSET_<wbr>REVENUE
 
| property pickup
 
| property pickup
 
| unpickable
 
| unpickable
 
|-
 
|-
 
| 17
 
| 17
| PICKUP_PROPERTY_LOCKED
+
| PICKUP_<wbr>PROPERTY_<wbr>LOCKED
 
| property pickup
 
| property pickup
 
| unpickable
 
| unpickable
 
|-
 
|-
 
| 18
 
| 18
| PICKUP_PROPERTY_FORSALE
+
| PICKUP_<wbr>PROPERTY_<wbr>FORSALE
 
| property pickup
 
| property pickup
| press the ACTION button to pick it up; if on a [[0180|mission]] pressing ACTION will show a help box with GXT string <code>PROP_2</code> and prevents you from picking it up
+
| press the ACTION button to pick it up; if on a [[0180|mission]] pressing ACTION will show a help box with GXT key <code>PROP_2</code> and prevents you from picking it up
 
|}
 
|}
  
 
===San Andreas===
 
===San Andreas===
{| class="wikitable"
+
{| class="wikitable center-col-1"
! Value
+
! Type
 +
! Enum
 
! Description
 
! Description
 +
|-
 +
| 0
 +
| PICKUP_NONE
 +
| none
 
|-
 
|-
 
| 1
 
| 1
 +
| PICKUP_IN_SHOP
 
| pickups with cost, unpickable for most
 
| pickups with cost, unpickable for most
 
|-
 
|-
 
| 2
 
| 2
 +
| PICKUP_ON_STREET
 
| item pickup, respawn time 30s, respawn distance 15m
 
| item pickup, respawn time 30s, respawn distance 15m
 
|-
 
|-
 
| 3
 
| 3
 +
| PICKUP_ONCE
 
| item pickup, does not respawn.
 
| item pickup, does not respawn.
 
|-
 
|-
 
| 4
 
| 4
 +
| PICKUP_ONCE_TIMEOUT
 
| item picked-up, does not respawn.
 
| item picked-up, does not respawn.
 
|-
 
|-
 
| 5
 
| 5
 +
| PICKUP_ONCE_TIMEOUT_SLOW
 
| item pickup, does not respawn.
 
| item pickup, does not respawn.
 
|-
 
|-
 
| 6
 
| 6
 +
| PICKUP_COLLECTABLE1
 
| unpickable
 
| unpickable
 
|-
 
|-
 
| 7
 
| 7
 +
| PICKUP_IN_SHOP_OUT_OF_STOCK
 
| unpickable
 
| unpickable
 
|-
 
|-
 
| 8
 
| 8
 +
| PICKUP_MONEY
 
| item picked-up, does not respawn.
 
| item picked-up, does not respawn.
 
|-
 
|-
 
| 9
 
| 9
 +
| PICKUP_MINE_INACTIVE
 
| proximity bomb?, selfdestruct when player driving in proximity 20m, explodes upon contact with vehs
 
| proximity bomb?, selfdestruct when player driving in proximity 20m, explodes upon contact with vehs
 
|-
 
|-
 
| 10
 
| 10
 +
| PICKUP_MINE_ARMED
 
| proximity bomb?, selfdestruct when player driving in proximity 20m, explodes upon contact with vehs
 
| proximity bomb?, selfdestruct when player driving in proximity 20m, explodes upon contact with vehs
 
|-
 
|-
 
| 11
 
| 11
 +
| PICKUP_NAUTICAL_MINE_INACTIVE
 
| proximity bomb?, selfdestruct when player driving in proximity 20m, explodes upon contact with vehs
 
| proximity bomb?, selfdestruct when player driving in proximity 20m, explodes upon contact with vehs
 
|-
 
|-
 
| 12
 
| 12
 +
| PICKUP_NAUTICAL_MINE_ARMED
 
| proximity bomb?, selfdestruct when player in proximity 40m, explodes upon contact with vehs
 
| proximity bomb?, selfdestruct when player in proximity 40m, explodes upon contact with vehs
 
|-
 
|-
 
| 13
 
| 13
 +
| PICKUP_FLOATINGPACKAGE
 
| item photo-op, fake pickup drops slowly down, real visible when photographed.
 
| item photo-op, fake pickup drops slowly down, real visible when photographed.
 
|-
 
|-
 
| 14
 
| 14
 +
| PICKUP_FLOATINGPACKAGE_FLOATING
 
| vehicle pickup, drive thru it to make it dissapear, does not respawn.
 
| vehicle pickup, drive thru it to make it dissapear, does not respawn.
 
|-
 
|-
 
| 15
 
| 15
 +
| PICKUP_ON_STREET_SLOW
 
| item pickup, respawns after time.
 
| item pickup, respawns after time.
 
|-
 
|-
 
| 16
 
| 16
 +
| PICKUP_ASSET_REVENUE
 
| unpickable, (originally property)
 
| unpickable, (originally property)
 
|-
 
|-
 
| 17
 
| 17
 +
| PICKUP_PROPERTY_LOCKED
 
| shows cancel popup. (originally property)
 
| shows cancel popup. (originally property)
 
|-
 
|-
 
| 18
 
| 18
 +
| PICKUP_PROPERTY_FORSALE
 
| paycash pickup, pay amount to make it dissapear. (originally property)
 
| paycash pickup, pay amount to make it dissapear. (originally property)
 
|-
 
|-
 
| 19
 
| 19
 +
| PICKUP_MONEY_DOESNTDISAPPEAR
 
| getcash pickup, get amount to make it dissapear.
 
| getcash pickup, get amount to make it dissapear.
 
|-
 
|-
 
| 20
 
| 20
 +
| PICKUP_SNAPSHOT
 
| snapshot pickup, photograph it to make it dissapear, adds 1 snapshot collected.
 
| snapshot pickup, photograph it to make it dissapear, adds 1 snapshot collected.
 
|-
 
|-
 
| 21
 
| 21
 +
| PICKUP_2P
 
| 2nd player pickup, press second controller to make it dissapear.
 
| 2nd player pickup, press second controller to make it dissapear.
 
|-
 
|-
 
| 22
 
| 22
 +
| PICKUP_ONCE_FOR_MISSION
 
| invisible
 
| invisible
|-
 
| 23
 
| unpickable
 
 
|}
 
|}
  
 
== Weapons ==
 
== Weapons ==
This opcode can create weapon pickups with a set amount of ammo. To have a custom ammo count, use opcode [[032B]]. All these values are [[hardcoded]].
+
When this opcode is used with [[weapon]] models, it creates a weapon pickup with predefined ammo count depending on the type of pickup. To have a custom ammo count, use opcode [[032B]]. The "Ammo" column applies to types PICKUP_IN_SHOP, PICKUP_ONCE, PICKUP_ONCE_TIMEOUT, and PICKUP_ONCE_TIMEOUT_SLOW. The "Ammo on street" column applies to types PICKUP_ON_STREET and PICKUP_ON_STREET_SLOW. The "Cost" column applies to type PICKUP_IN_SHOP. All these values are [[hardcoded]] and their locations in memory are referenced below.
 +
 
 
=== GTA III ===
 
=== GTA III ===
Ammo count applies to all but types 2 and 14. For types 2 and 14, divide the ammo count by five. Cost applies to only type 1.
+
{|class="wikitable sortable"
{| class="wikitable"
+
!Weapon ||Ammo{{ref|1}} ||Ammo on<br>street{{ref|2}} ||Cost{{ref|3}}
! Pickup
+
|-
! Ammo
+
|Bat ||1 ||1 ||$10
! Cost
 
 
|-
 
|-
| Armor
+
|Pistol ||45 ||9 ||$250
| none
 
| $3,000
 
 
|-
 
|-
| Bat
+
|Uzi ||125 ||25 ||$800
| none
 
| $10
 
 
|-
 
|-
| Pistol
+
|Shotgun ||25 ||5 ||$1500
| 45
 
| $250
 
 
|-
 
|-
| Uzi
+
|AK47 ||150 ||30 ||$3000
| 125
 
| $800
 
 
|-
 
|-
| Shotgun
+
|M16 ||300 ||60 ||$5000
| 25
 
| $1,500
 
 
|-
 
|-
| AK47
+
|Sniper Rifle ||25 ||5 ||$10000
| 150
 
| $3,000
 
 
|-
 
|-
| M16
+
|Rocket Launcher ||5 ||1 ||$25000
| 300
 
| $5,000
 
 
|-
 
|-
| Sniper Rifle
+
|Flamethrower ||250 ||50 ||$25000
| 25
 
| $10,000
 
 
|-
 
|-
| Flamethrower
+
|Molotov Cocktail ||5 ||1 ||$2000
| 25
 
| $25,000
 
 
|-
 
|-
| Molotov Cocktail
+
|Grenade ||5 ||1 ||$2000
| 5
 
| $2,000
 
 
|-
 
|-
| Grenade
+
|Armor ||- ||- ||$3000
| 5
 
| $2,000
 
 
|}
 
|}
 +
# {{note|1}} For US v1.0, the array containing this data starts at 0x5ED8D4.
 +
# {{note|2}} For US v1.0, the array containing this data starts at 0x5ED8FC.
 +
# {{note|3}} For US v1.0, the array containing this data starts at 0x5ED924.
  
 
=== Vice City ===
 
=== Vice City ===
Ammo count applies to all but types 2 and 15. For types 2 and 15, divide the ammo count by two. Cost applies to only type 1.
+
{|class="wikitable sortable"
{| class="wikitable"
+
!Weapon ||Ammo{{ref|4}} ||Ammo on<br>street{{ref|5}} ||Cost{{ref|6}}
! Pickup
+
|-
! Ammo
+
|Brass Knuckle ||1 ||1 ||$10
! Cost
+
|-
 +
|Screw Driver ||1 ||1 ||$10
 +
|-
 +
|Golf Club ||1 ||1 ||$10
 +
|-
 +
|Night Stick ||1 ||1 ||$10
 +
|-
 +
|Knife ||1 ||1 ||$10
 +
|-
 +
|Baseball Bat ||1 ||1 ||$10
 +
|-
 +
|Hammer ||1 ||1 ||$10
 +
|-
 +
|Cleaver ||1 ||1 ||$10
 +
|-
 +
|Machete ||1 ||1 ||$10
 +
|-
 +
|Katana ||1 ||1 ||$10
 
|-
 
|-
| Health
+
|Chainsaw ||1 ||1 ||$10
| none
 
| $20
 
 
|-
 
|-
| Armor
+
|Grenade ||8 ||4 ||$1000
| none
 
| $10
 
 
|-
 
|-
| Adrenaline
+
|Detonator Grenade ||8 ||4 ||$1000
| none
 
| $10
 
 
|-
 
|-
| All melee weapons
+
|Tear Gas ||8 ||4 ||$1000
| none
 
| $10
 
 
|-
 
|-
| Grenade
+
|Molotov ||8 ||4 ||$500
| 8
 
| $1,000
 
 
|-
 
|-
| Detonator Grenade
+
|Missile ||8 ||4 ||$8000
| 8
 
| $1,000
 
 
|-
 
|-
| Tear Gas
+
|Colt .45 (Pistol) ||68 ||34 ||$250
| 8
 
| $1,000
 
 
|-
 
|-
| Molotov Cocktail
+
|Python (.357) ||24 ||12 ||$400
| 8
 
| $500
 
 
|-
 
|-
| Missile
+
|Chrome Shotgun ||32 ||16 ||$1200
| 8
 
| $8,000
 
 
|-
 
|-
| Pistol
+
|Spaz Shotgun (S.P.A.S. 12) ||28 ||14 ||$1250
| 68
 
| $250
 
 
|-
 
|-
| .357
+
|Stubby Shotgun ||20 ||10 ||$1250
| 24
 
| $400
 
 
|-
 
|-
| Shotgun
+
|Tec-9 ||200 ||100 ||$800
| 32
 
| $1,200
 
 
|-
 
|-
| S.P.A.S. 12
+
|Uzi 9mm (Uz-I) ||120 ||60 ||$800
| 28
 
| $1,250
 
 
|-
 
|-
| Stubby Shotgun
+
|Ingram Mac 10 ||120 ||60 ||$650
| 20
 
| $1,250
 
 
|-
 
|-
| Tec 9
+
|MP5 (MP) ||120 ||60 ||$1200
| 200
 
| $800
 
 
|-
 
|-
| Uz-1
+
|M4 ||120 ||60 ||$5000
| 120
 
| $800
 
 
|-
 
|-
| Mac
+
|Ruger (Kruger) ||120 ||60 ||$400
| 120
 
| $650
 
 
|-
 
|-
| MP
+
|Sniper Rifle ||40 ||20 ||$10000
| 120
 
| $1,200
 
 
|-
 
|-
| M4
+
|PSG-1 (.308 Sniper) ||28 ||14 ||$10000
| 120
 
| $5,000
 
 
|-
 
|-
| Kruger
+
|Rocket Launcher ||8 ||4 ||$8000
| 120
 
| $400
 
 
|-
 
|-
| Rocket Launcher
+
|Flame Thrower ||300 ||150 ||$8000
| 8
 
| $8,000
 
 
|-
 
|-
| Flame Thrower
+
|M60 ||200 ||100 ||$8000
| 30
 
| $8,000
 
 
|-
 
|-
| M60
+
|Minigun ||1000 ||500 ||$10000
| 200
 
| $8,000
 
 
|-
 
|-
| Minigun
+
|Camera ||36 ||36 ||$500
| 1,000
 
| $10,000
 
 
|-
 
|-
| Sniper Rifle
+
|Health ||- ||- ||$20
| 40
 
| $10,000
 
 
|-
 
|-
| .308 Sniper
+
|Armor ||- ||- ||$10
| 28
 
| $10,000
 
 
|-
 
|-
| Camera
+
|Adrenaline ||- ||- ||$10
| 36
 
| $500
 
 
|}
 
|}
Any other pickups will display a cost of $0.
+
<ol start="4">
 +
<li>{{note|4}} For US v1.0, the array containing this data starts at 0x687F68.</li>
 +
<li>{{note|5}} For US v1.0, the array containing this data starts at 0x687FB4.</li>
 +
<li>{{note|6}} For US v1.0, the array containing this data starts at 0x688000.</li>
 +
</ol>
 +
Any other pickups will display a cost of $0. When a character dies and drops a weapon, it uses the ammo count on street. In Vice City, divide that count by 2, unless it has a count of 1, then it uses the non-street ammo count.
  
 
==Unique objects==
 
==Unique objects==
Line 497: Line 468:
 
| no
 
| no
 
| yes
 
| yes
|  
+
|
 
|-
 
|-
 
| health
 
| health
Line 507: Line 478:
 
| no
 
| no
 
| yes
 
| yes
|  
+
|
 
|-
 
|-
 
| bribe
 
| bribe
Line 517: Line 488:
 
| no
 
| no
 
| yes
 
| yes
|  
+
|
 
|-
 
|-
 
| camerapickup
 
| camerapickup
Line 527: Line 498:
 
| no
 
| no
 
| no
 
| no
|  
+
|
 
|-
 
|-
 
| pickupsave
 
| pickupsave
 
| no
 
| no
 
| no
 
| no
|  
+
|
 
|-
 
|-
 
| property_locked
 
| property_locked
 
| no
 
| no
 
| no
 
| no
|  
+
|
 
|-
 
|-
 
| property_fsale
 
| property_fsale
 
| no
 
| no
 
| no
 
| no
|  
+
|
 
|-
 
|-
 
| clothesp
 
| clothesp
 
| no
 
| no
 
| no
 
| no
|  
+
|
 
|-
 
|-
 
| barrel1
 
| barrel1
Line 748: Line 719:
 
== External link ==
 
== External link ==
 
* {{GTAF|205020|Generic SA SCM Documentation}}
 
* {{GTAF|205020|Generic SA SCM Documentation}}
 
[[Category:OpCodes]]
 

Latest revision as of 08:25, 15 August 2022

GTA III Vice City San Andreas CREATE_PICKUP


Description
Creates a pickup
Syntax
0213: [var] = create_pickup [int1] type [int2] at [flt1] [flt2] [flt3]
Pickup.Create( [var], [int1], [int2], [flt1] [flt2] [flt3] )
Parameter
[int1]
Valid model index as defined in the IDE file; also acceptable is model's DFF name with a hash character
[int2]
Type (see below)
[flt1]
X-coordinate
[flt2]
Y-coordinate
[flt3]
Z-coordinate (or ≤-100.0 for ground z + 0.5 units)
[var]
Variable to store the handle of the pickup
Native analog
CREATE_PICKUP

This opcode spawns a pickup at the coordinates point that can be "collected" by the player.

The maximum number of pickups that can be spawned in GTA III and Vice City is 336 and in San Andreas is 620. Passing the limit will no longer spawn anymore pickups but the game will not crash.

Example

The following example, using Sanny Builder, will spawn a type 2 adrenaline pickup close to the player character.

// set constants
const
PICKUP_MODEL = #ADRENALINE
PICKUP_HANDLE = 0@
X_POS = 1@
Y_POS = 2@
Z_POS = 3@
end

// spawn pickup
00A0: store_actor $PLAYER_ACTOR position_to X_POS Y_POS Z_POS
X_POS += 4.0
0213: PICKUP_HANDLE = create_pickup PICKUP_MODEL type 2 at X_POS Y_POS Z_POS

Pickup types

This is a list of all available types of pickups.

GTA III

Type Enum Type Description
1 PICKUP_IN_SHOP weapon/item pickup with cost respawn time ~5s, (see below for cost)
2 PICKUP_ON_STREET weapon/item pickup respawn time ~30s, respawn distance ~15m
3 PICKUP_ONCE weapon/item pickup one-time pickup, does not respawn
4 PICKUP_ONCE_TIMEOUT weapon/item pickup one-time pickup, does not respawn, disappears in 20s
5 PICKUP_COLLECTABLE1 hidden package pickup behaves exactly like a package including stat update and money reward
6 PICKUP_IN_SHOP_OUT_OF_STOCK out of stock pickup object model darkened, unpickable
7 PICKUP_MONEY money pickup no money actually added but money sound plays (money can be added using 032B), one-time pickup, does not respawn, disappears in 30s
8 PICKUP_MINE_INACTIVE inactive mine not interactive with anything if player is on foot, pickup type changes to 9 once the player is in any vehicle
9 PICKUP_MINE_ARMED armed mine any pickup spawned with this type automatically changes to type 8, this type applies only when pickup type changes from 8 to 9 — selfdestructs in ~10s, explodes upon contact with any vehicle, does not respawn
10 PICKUP_NAUTICAL_MINE_INACTIVE proximity bomb selfdestructs in ~10s, explodes upon contact with player vehicle, can float above water but weapon halo doesn't float with object, does not respawn
11 PICKUP_NAUTICAL_MINE_ARMED proximity bomb selfdestructs in ~10s, explodes upon contact with player vehicle, can float above water but weapon halo doesn't float with object, does not respawn
12 PICKUP_FLOATINGPACKAGE vehicle pickup drive through it to pick it up, can't be picked up on foot, object model sinks through ground, can only float on water, does not respawn (opcode 035B)
13 PICKUP_FLOATINGPACKAGE_FLOATING vehicle pickup drive through it to pick it up, can't be picked up on foot, can float on water, does not respawn
14 PICKUP_ON_STREET_SLOW weapon/item pickup respawn time ~30s, respawn distance ~15m

Vice City

Type Enum Type Notes
1 PICKUP_IN_SHOP weapon/item pickup with cost respawn time ~5s, (see below for cost)
2 PICKUP_ON_STREET weapon/item pickup respawn time ~30s, respawn distance ~15m
3 PICKUP_ONCE weapon/item pickup one-time pickup, does not respawn
4 PICKUP_ONCE_TIMEOUT weapon/item pickup one-time pickup, does not respawn, disappears in 20s
5 PICKUP_ONCE_TIMEOUT_SLOW weapon/item pickup one-time pickup, does not respawn, disappears in 120s
6 PICKUP_COLLECTABLE1 hidden package pickup behaves exactly like a package including stat update and money reward
7 PICKUP_IN_SHOP_OUT_OF_STOCK out of stock pickup object model darkened, unpickable
8 PICKUP_MONEY money pickup no money actually added but money dialogue and sound plays (money can be added using 032B), one-time pickup, does not respawn, disappears in 30s
9 PICKUP_MINE_INACTIVE inactive mine not interactive with anything if player is on foot, pickup type changes to 10 once the player is in any vehicle
10 PICKUP_MINE_ARMED armed mine any pickup spawned with this type automatically changes to type 9, this type applies only when pickup type changes from 9 to 10 — selfdestructs in ~10s, explodes upon contact with any vehicle, does not respawn
11 PICKUP_NAUTICAL_MINE_INACTIVE proximity bomb selfdestructs in ~10s, explodes upon contact with player vehicle, can float above water but weapon halo doesn't float with object, does not respawn
12 PICKUP_NAUTICAL_MINE_ARMED proximity bomb selfdestructs in ~10s, explodes upon contact with player vehicle, can float above water but weapon halo doesn't float with object, does not respawn
13 PICKUP_FLOATINGPACKAGE vehicle pickup drive through it to pick it up, can't be picked up on foot, object model sinks through ground, can only float on water but weapon halo doesn't float with object, does not respawn
14 PICKUP_FLOATINGPACKAGE_FLOATING vehicle pickup drive through it to pick it up, can't be picked up on foot, can float on water but weapon halo doesn't float with object, does not respawn
15 PICKUP_ON_STREET_SLOW weapon/item pickup respawn time ~30s, respawn distance ~15m
16 PICKUP_ASSET_REVENUE property pickup unpickable
17 PICKUP_PROPERTY_LOCKED property pickup unpickable
18 PICKUP_PROPERTY_FORSALE property pickup press the ACTION button to pick it up; if on a mission pressing ACTION will show a help box with GXT key PROP_2 and prevents you from picking it up

San Andreas

Type Enum Description
0 PICKUP_NONE none
1 PICKUP_IN_SHOP pickups with cost, unpickable for most
2 PICKUP_ON_STREET item pickup, respawn time 30s, respawn distance 15m
3 PICKUP_ONCE item pickup, does not respawn.
4 PICKUP_ONCE_TIMEOUT item picked-up, does not respawn.
5 PICKUP_ONCE_TIMEOUT_SLOW item pickup, does not respawn.
6 PICKUP_COLLECTABLE1 unpickable
7 PICKUP_IN_SHOP_OUT_OF_STOCK unpickable
8 PICKUP_MONEY item picked-up, does not respawn.
9 PICKUP_MINE_INACTIVE proximity bomb?, selfdestruct when player driving in proximity 20m, explodes upon contact with vehs
10 PICKUP_MINE_ARMED proximity bomb?, selfdestruct when player driving in proximity 20m, explodes upon contact with vehs
11 PICKUP_NAUTICAL_MINE_INACTIVE proximity bomb?, selfdestruct when player driving in proximity 20m, explodes upon contact with vehs
12 PICKUP_NAUTICAL_MINE_ARMED proximity bomb?, selfdestruct when player in proximity 40m, explodes upon contact with vehs
13 PICKUP_FLOATINGPACKAGE item photo-op, fake pickup drops slowly down, real visible when photographed.
14 PICKUP_FLOATINGPACKAGE_FLOATING vehicle pickup, drive thru it to make it dissapear, does not respawn.
15 PICKUP_ON_STREET_SLOW item pickup, respawns after time.
16 PICKUP_ASSET_REVENUE unpickable, (originally property)
17 PICKUP_PROPERTY_LOCKED shows cancel popup. (originally property)
18 PICKUP_PROPERTY_FORSALE paycash pickup, pay amount to make it dissapear. (originally property)
19 PICKUP_MONEY_DOESNTDISAPPEAR getcash pickup, get amount to make it dissapear.
20 PICKUP_SNAPSHOT snapshot pickup, photograph it to make it dissapear, adds 1 snapshot collected.
21 PICKUP_2P 2nd player pickup, press second controller to make it dissapear.
22 PICKUP_ONCE_FOR_MISSION invisible

Weapons

When this opcode is used with weapon models, it creates a weapon pickup with predefined ammo count depending on the type of pickup. To have a custom ammo count, use opcode 032B. The "Ammo" column applies to types PICKUP_IN_SHOP, PICKUP_ONCE, PICKUP_ONCE_TIMEOUT, and PICKUP_ONCE_TIMEOUT_SLOW. The "Ammo on street" column applies to types PICKUP_ON_STREET and PICKUP_ON_STREET_SLOW. The "Cost" column applies to type PICKUP_IN_SHOP. All these values are hardcoded and their locations in memory are referenced below.

GTA III

Weapon Ammo[1] Ammo on
street[2]
Cost[3]
Bat 1 1 $10
Pistol 45 9 $250
Uzi 125 25 $800
Shotgun 25 5 $1500
AK47 150 30 $3000
M16 300 60 $5000
Sniper Rifle 25 5 $10000
Rocket Launcher 5 1 $25000
Flamethrower 250 50 $25000
Molotov Cocktail 5 1 $2000
Grenade 5 1 $2000
Armor - - $3000
  1. ^ For US v1.0, the array containing this data starts at 0x5ED8D4.
  2. ^ For US v1.0, the array containing this data starts at 0x5ED8FC.
  3. ^ For US v1.0, the array containing this data starts at 0x5ED924.

Vice City

Weapon Ammo[4] Ammo on
street[5]
Cost[6]
Brass Knuckle 1 1 $10
Screw Driver 1 1 $10
Golf Club 1 1 $10
Night Stick 1 1 $10
Knife 1 1 $10
Baseball Bat 1 1 $10
Hammer 1 1 $10
Cleaver 1 1 $10
Machete 1 1 $10
Katana 1 1 $10
Chainsaw 1 1 $10
Grenade 8 4 $1000
Detonator Grenade 8 4 $1000
Tear Gas 8 4 $1000
Molotov 8 4 $500
Missile 8 4 $8000
Colt .45 (Pistol) 68 34 $250
Python (.357) 24 12 $400
Chrome Shotgun 32 16 $1200
Spaz Shotgun (S.P.A.S. 12) 28 14 $1250
Stubby Shotgun 20 10 $1250
Tec-9 200 100 $800
Uzi 9mm (Uz-I) 120 60 $800
Ingram Mac 10 120 60 $650
MP5 (MP) 120 60 $1200
M4 120 60 $5000
Ruger (Kruger) 120 60 $400
Sniper Rifle 40 20 $10000
PSG-1 (.308 Sniper) 28 14 $10000
Rocket Launcher 8 4 $8000
Flame Thrower 300 150 $8000
M60 200 100 $8000
Minigun 1000 500 $10000
Camera 36 36 $500
Health - - $20
Armor - - $10
Adrenaline - - $10
  1. ^ For US v1.0, the array containing this data starts at 0x687F68.
  2. ^ For US v1.0, the array containing this data starts at 0x687FB4.
  3. ^ For US v1.0, the array containing this data starts at 0x688000.

Any other pickups will display a cost of $0. When a character dies and drops a weapon, it uses the ammo count on street. In Vice City, divide that count by 2, unless it has a count of 1, then it uses the non-street ammo count.

Unique objects

There are objects that have unique properties when used with this opcode. An example would be the object "bribe" that can only be picked up when the player has a wanted level. The uniqueness of the object is based mostly on the model name of the object, independent of the ID number of the object with the exception of weapons. Here is a list of all unique objects.

Vice City

By default, objects have concentric halos when used as a pickup, similar to the halos seen around weapon pickups but not around health pickups. Also by default, when an object gets picked up, it produces a sound. Some objects can have a unique sound, different from generic objects.

Model Concentric
halos?
Unique
sound?
Other properties
briefcase no no unique glow, shows no price when used as type 1
adrenaline no no creates slow motion and super strength effects when picked up, shows no price when used as type 1
bodyarmour yes yes gives the player full armor when picked up
info no yes
health no yes gives the player full health when picked up, shows no price when used as type 1
bonus no yes
bribe no yes lowers the player's wanted level by one for most types when picked up, can usually be picked up for most types only when the player has a wanted level
killfrenzy no yes
camerapickup no no can only be picked up while driving, doesn't self destruct for types 9 to 12
bigdollar no no
pickupsave no no
property_locked no no
property_fsale no no
clothesp no no
barrel1 no no unique glow, shows no price when used as type 1
barrel2 no no unique glow, shows no price when used as type 1
package1 no no unique glow, shows no price when used as type 1
money no no unique glow, shows no price when used as type 1
brassknuckle yes no gives the player Brass Knuckles when picked up
screwdriver yes no gives the player a Screwdriver when picked up, light teal halos
golfclub yes no gives the player a Golf Club when picked up, light teal halos
nitestick yes no gives the player a Nightstick when picked up, light teal halos
knifecur yes no gives the player a Knife when picked up, light teal halos
bat yes no gives the player a Bat when picked up, light teal halos
hammer yes no gives the player a Hammer when picked up, light teal halos
cleaver yes no gives the player a Meat Cleaver when picked up, light teal halos
machete yes no gives the player a Machete when picked up, light teal halos
katana yes no gives the player a Katana when picked up, light teal halos
chnsaw yes no gives the player a Chainsaw when picked up, light teal halos
grenade yes no gives the player Grenades when picked up, light blue halos
teargas yes no gives the player a Tear Gas when picked up, light blue halos
molotov yes no gives the player Molotov Cocktails when picked up, light blue halos
missile no no gives the player a Missile when picked up
colt45 yes no gives the player a Pistol when picked up, light green halos
python yes no gives the player a .357 when picked up, light green halos
ruger yes no gives the player a Kruger when picked up, orange halos
chromegun yes no gives the player a Shotgun when picked up, green halos
shotgspa yes no gives the player a S.P.A.S. 12 when picked up, green halos
buddyshot yes no gives the player a Stubby Shotgun when picked up, green halos
m4 yes no gives the player an M4 when picked up, orange halos
tec9 yes no gives the player a Tec 9 when picked up, yellow halos
uzi yes no gives the player an Uz-1when picked up, yellow halos
ingramsl yes no gives the player a Mac when picked up, yellow halos
mp5lng yes no gives the player an MP when picked up, yellow halos
sniper yes no gives the player a Sniper Rifle when picked up, pink halos
laser yes no gives the player a .308 Sniper when picked up, pink halos
rocketla yes no gives the player a Rocket Launcher when picked up, purple halos
flame yes no gives the player a Flame Thrower when picked up, purple halos
m60 yes no gives the player an M60 when picked up, purple halos
minigun yes no gives the player a Minigun when picked up, contains two models within one pickup (minigun and minigun2), purple halos
bomb yes no gives the player Detonator Grenades when picked up, light blue halos
camera yes no gives the player Camera when picked up

Keywords

create, pickup, weapon

See also

External link