Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
      4. Frontier Pursuits
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. Diamond Casino & Resort
      2. DLC
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA 6

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA IV Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA SA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA VC Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA III Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. News

    2. Forum Support

    3. Site Suggestions

Opius

Opcodes for Bartons Editor (GTA3 + VC)

Recommended Posts

spaceeinstein

VICESCM.INI update

This update should be compatible to scripts decompiled with Sanny Builder's old revision of the INI file. The update was done all by hand so there may be mistakes in the file. So far, there doesn't seem to be any errors. Here is a list of major changes and additions since the 04.01.11 revision.

• Almost all "GTA 3 only" opcodes are commented out to allow documentation of III's opcodes without obstructions

• 009D removed because VC and III never supported that in the first place

 

• Changed opcode descriptions

009F: set_actor [char handle] objective_idle

020F: actor [char handle] rotate_to_player [player handle]

0210: player [player handle] rotate_to_actor [char handle]

0336: set_player [player handle] visibility [int]

0350: set_actor [char handle] maintain_position [int]

0377: set_actor [char handle] objective_steal_any_car

0381: set_object [object handle] velocity [flt1] [flt2] [flt3]

039C: set_car [car handle] watertight [int]

03AE: remove_particles_from_cube [flt1] [flt2] [flt3] [flt4] [flt5] [flt6]

03C8: set_camera_in_front_of_player

03D3: get_closest_car_node_at [flt1] [flt2] [flt3] with_heading [var1] [var2] [var3] [var4]

0411: set_actor [char handle] use_pednode_seek [int]

0418: set_object [object handle] draw_last [int]

0428: set_car [car handle] avoid_level_transitions [int]

04E3: set_player [player handle] mood [int1] duration [int2]

054B: attach_object [object handle] to_car [car handle]

 

• "GTA 3 only" changed opcode descriptions

00AC: car [car handle] alive

015E: car [car handle] in_air

023E: set_car [car handle] flash [int]

0240: set_object [object handle] flash [int]

029C: car [car handle] boat

02A1: message_wait [int1] [int2]

0344: set_text_draw_center_size [int]

0367: init_rampage_headshot

03f8: get_body_cast_health [var]

0438: set_actor [char handle] avoid_level_transitions [int]

0447: player [player handle] lifting_phone

044f: make_car [car handle] bit_stronger [int]

045E: place_object [object handle] relative_to_object [object handle] offset [flt1] [flt2] [flt3]

 

• "GTA 3 only" added opcodes

0195: set_actor [char handle] guard_area [flt1] [flt2] [flt3] [flt4]

021F: set_all_taxi_lights [int]

023F: set_actor [char handle] flash [int]

0246: set_player [player handle] walk_style_to [int]

02C4: save_player_coords

02D6: actor [char handle] firing_weapons_in_rectangle [flt1] [flt2] [flt3] [flt4] [int]

031B: car [car handle] primary_color [int]

031C: car [car handle] secondary_color [int]

0328: get_random_car_in_zone [string] model [int] store_to [var]

0338: set_car [car handle] visibility [int]

033D: put_out_fire_on_player [player handle]

0413: set_player [player handle] get_out_of_jail_free [int]

046A: get_random_law_enforcement_in_zone [string] store_to [var]

 

EDIT:

Ooo, new opcode for GTA III

 

045D: get_object_at [flt1] [flt2] [flt3] radius [flt4] model [int] store_to [var]

 

This grabs an object of specified model at a location within a radius and stores it into a variable. It only works with dynamic objects. This was never used in the default script.

I can add blips to nearby traffic lights with this!

user posted image

Edited by spaceeinstein

Share this post


Link to post
Share on other sites
Silent

 

The SCM from the mobile version seems formatted exactly the same as the PC version, but with two extra opcodes:

 

03A8 - 1 parameter03A9 - 0 parameter

 

Add these to Sanny Builder's SCM.INI file if you want it to decompile correctly:

 

03A8=1,03A9=0,

 

According to real SCM source, the opcodes are:

 

 

03a8=1,save_float_to_debug_file %1d%03a9=0,save_newline_to_debug_file

 

 

I bet they are NOPs in final build though.

Share this post


Link to post
Share on other sites
spaceeinstein

 

0323: ANCHOR_BOAT [car handle] [int]

 

Can anyone explain to me how is this suppose to work? I first learned this from Towncivilian and R*'s GTA III source code confirms this, but I have been testing this extensively and found no apparent effect in VC. It is always used with boats. If anchor is suppose to mean not being able to move, this opcode doesn't do that. I can still push boats, drive them, and have NPCs drive them.

Share this post


Link to post
Share on other sites
Deji

It is a bit of a weird one... I'd identified it as being that before even the III source code but was never sure of what the actual effects were. I'll try and check the SA IDB again tomorrow and see if I can find out if it's even used. Bad programmer-mission coder communication seems to be a likely culprit of many weird SCM phenomenons.

 

In SA, it's used mainly in the mission where you plant a bug on a boat and CJ explains his unfortunate encounter with a condom (Amphibious Assault?).

 

If I'd have to guess, I'd say it does make the boat stick to a position (even if not keeping completely still, like the "make char stay in kinda the same position" opcode), but probably not under the circumstances that you tested it in. Did you try getting the handles of a random (or just the closest) boat and using the opcode? It may have more of an effect, since the boat doesn't have a goal of sailing to a particular spot, it's just cruising. 00A8 is CAR_WANDER_RANDOMLY if you want to make a vehicle cruise. No idea if it works on boats, though.

 

 

I've listed most of the III command names, as well as related IV ones, in the v2 Opcode Database. I can provide you with a generated list, if you want.

 

 

EDIT

 

Couldn't help myself. I had a quick look. The most striking thing is that the flag which is set doesn't stop the boat from doing something. A small amount of code is run if the flag is set. So the flag makes more happen, not less. Kinda the opposite of what the name would make out. I can't yet make much of this very undocumented (absolutely nothing in CBoat is documented) code, but I'll try documenting some stuff later and see if it's any clearer. Still, the code does mess with the boats matrix a lot... and it seems that if one of that float member values is -99999 (or w/e) the boat will only turn on the spot. So the command name almost definitely isn't lying.

Edited by Deji

Share this post


Link to post
Share on other sites
spaceeinstein

00A8 does work on boats; boats correctly search for boat paths. Still doesn't anchor though. I think I can guess why this opcode doesn't work the way I tested it. Boat anchor seems to be set at +0x2F5. Using this opcode in a loop suppose to set the byte value to 1. It works for cars but it never works for boats. Somewhere within the game is forcing the boat to never be anchored. Can it be safely concluded that this opcode is basically useless?

Share this post


Link to post
Share on other sites
Deji

Nah. Well, it appears used in SA anyway. When I repair my SA installation (it currently relies on VJ and the VJ source needs a bit of a fixup) I should be able to see for sure whether it's used, using R*'s code.

Share this post


Link to post
Share on other sites
spaceeinstein

With more testing and thinking, I found out how this opcode works. The boat must NOT be occupied for the effect to work. When a boat is anchored, it cannot move when being pushed, though push hard enough and it will slowly move. Gravity still have the normal effect. Once the boat is occupied, it is automatically unanchored. Boats are anchored by default when they are spawned without anyone inside it. This works even when boats are grounded.

Share this post


Link to post
Share on other sites
Deji

Interesting. Having all boats "anchored" when on ground would add realism, since CJ seems strong enough to push boats all the way across SA tounge.gif

Share this post


Link to post
Share on other sites
spaceeinstein

CustomVariables.ini for GTA III

The CustomVariables.ini controls the labeling of global variables when decompiling the main.scm. The labels contained in this list are obtained from the partial source code of GTA III from gtamodding.ru. It is far from complete but it's much better than ones released previously. I will periodically update the list using the same link and will not be posting anymore notices after this unless it's necessary.

Share this post


Link to post
Share on other sites
Deji

Ahhh, I started working on the same thing, but hadn't had much time to spend completing it. Good work smile.gif

Share this post


Link to post
Share on other sites
Wesser

Whereas we were talking about the native SCM sintax some posts above, I decided to show in this topic the source (yeah, it's really a code) of GTAIII's american.gxt, available here.

Share this post


Link to post
Share on other sites
Silent

Looks like "THIS LABEL NEEDS TO BE HERE!!!" mystery is solved now tounge.gif

 

How does it organize stuff in tables though? I can't see their definitions anywhere.

Oh, III lacks tables. My bad.

Edited by SilentPL

Share this post


Link to post
Share on other sites
Silent

0439 is a pretty fun opcode. It's never used in III (and it's III-only opcode), and it gets the SCM handle of chase scene vehicles. This way, I could try my best on kidnapping Old Oriental Gentleman by myself:

 

user posted image

 

Native name for it is probably TURN_CHASE_CAR_INTO_SCRIPT_CAR, thus opcode is

 

0439: turn_chase_car %1d% into_script_car %2d%

 

Edited by SilentPL

Share this post


Link to post
Share on other sites
spaceeinstein

It looks like ALL the opcodes' names and constant names have been discovered. Onto documenting the behavior of all the opcodes!

 

For 018C (ADD_ONE_OFF_SOUND) in Vice City, I have found all the possible values that can play a sound and their behaviors. I have recorded the sounds of almost all of them for you to listen. A lot of the sounds are combinations of sound effects and have different frequency so you cannot rely solely on listening to the sounds in sfx.raw/sdt.

[table]

Value Coord-independent Notes Listen 1 Yes blip 3 No metal gate 5 No garage door finished open/close 7 Yes blip [/td] [/tr] 8 Yes blip 9 Yes blip 10 Yes high pitch blip 12 No bullet hit ground 13 Yes successful select 14 Yes unsuccessful select 16 Yes Demolition Man and Trojan Voodoo arm bomb 18 No No Escape? card swipe 19 No intermittent male pain 20 No intermittent female pain [tr][td]35No Dildo Dodo low fuel ping 52-54 No bullet hit ground see 12 56 No ringing phone 57 No glass breaking 58 No glass breaking 59 No glass breaking 60 No glass breaking 61 No boxes destroyed 62 No boxes destroyed 63 No metal sheet explosion 64 No tire hit ground 65 No beach ball 66 No bullet shell dropping [/table]

Coord-independent means that you can hear the sound regardless of location. Those with more than one sounds means that the sounds will be randomly chosen to play. GTAModding.com will have more information about this opcode.

Edited by spaceeinstein

Share this post


Link to post
Share on other sites
Wesser

It's likely you haven't followed GTAModding's changes for a while. :p Thanks to the iOS version of III which supplied us all the .sc script includes except the main part, an article has been built concerning what's been known about the GTA3script language, roughly called SCM language. In the footer, you can find the link of the language definitions, including enumerations, extrapolated from the official GTA3 Script Compiler V413 left into the Android version of VC. Getting to the point, defines.h provides the aszSounds array which lists the sounds you documented by hand till the ID 51 with the native nomenclature.

Share this post


Link to post
Share on other sites
spaceeinstein

Wow, those are amazingly detailed documentation. I am surprised at how much of the original source was released.

Edited by spaceeinstein

Share this post


Link to post
Share on other sites
Craig Kostelecky

I am surprised at how much of the original source was released.

 

Me too. In fact, I rewrote nearly the entire LC script to use Rockstar's variable names and to give it nice if/while loops. Check it out when you get a chance :) There's even some stuff that R* commented out that I put back in (this can be easily disabled with a master variable.

 

And welcome back! We missed you :D

Edited by Craig Kostelecky

Share this post


Link to post
Share on other sites
spaceeinstein

:) It's great to be back. There is so much catching up to do. I'm only free for the moment unfortunately. Real life has been keeping me very busy.

 

EDIT: A note for 00E1, buttons 5 and 7 are not zoom in and out, buttons 14 and 16 are zoom in and out.

 

I've been going on a contribution spree at GTAModding. Check out the newly updated and created pages! There are extremely detailed descriptions for these.

Edited by spaceeinstein

Share this post


Link to post
Share on other sites
spaceeinstein

Can someone help me confirm something weird that is happening to me in Vice City? Opcode 02AB's first proof is bullet proof:

 

02AB: set_actor $PLAYER_ACTOR immunities 1 0 0 0 0
But it does not protect me against damage from the Colt Python!

 

01B2: give_actor [email protected] weapon 18 ammo 999901CB: actor [email protected] kill_actor $PLAYER_ACTOR
Edited by spaceeinstein

Share this post


Link to post
Share on other sites
Seemann

 

0136: camera_shake 100 at x y z
Valid for GTA 3. Shakes the camera same as 0003, but also accepts a point coordinates. From a quick test I see no difference between 0003 and 0136, but in fact the 0136's function is used for all hardcoded camera shakes after vehicles detonations, blow ups, tank shots, etc, so its possibly a point that has to be viewable by the player for the shake to have an effect. Edited by Seemann

Share this post


Link to post
Share on other sites
spaceeinstein

For those who aren't updated on the new pages at GTAModding.com, here are the most interesting opcode-related articles since my last list in January.

  • List of statistics in GTA III, a full and complete list (Seemann)
  • Collectibles (Seemann)
  • 035B CREATE_FLOATING_PACKAGE (Seemann)
  • III/VC script definitions, entirely organized (Wesser)
  • Pickups
  • List of statistics in Vice City, a full and complete list
  • 014E DISPLAY_ONSCREEN_TIMER

     

    This opcode displays an onscreen timer. In GTA III the timer only counts down but since Vice City timers can also count up. You must use a global variable. Using an integer constant crashes the game and a local variable produces no timer. The value of the global variable is stored in milliseconds but the format of the display is MM:SS. The value of the global variable will be constantly updated by the timer and the timer itself can be updated by assigning a value to the global variable. When counting down, at 10 seconds the timer will produce a noise every second, specifically SFX 336 for GTA III and 370 for Vice City. Once the timer finishes counting down, it will be cleared from the screen. Only one timer can be displayed at a time. Attempting to display another timer while the current timer is in effect will not produce an additional timer. Due to the limitation of the format of the timer, the timer will not display properly above 99:99 but will still keep accurate count. In GTA III and Vice City, switching widescreen on will hide the timer from view. In Vice City, it will also mute the 10-second countdown noise.

     

  • 0168 CHANGE_BLIP_SCALE

     

    This opcode changes the scale of the specified blip. It has no effect on blips that use sprites. Most opcodes that can create a blip defaults the scale to 3. The original script uses values between 1 and 3 but values between 0 and 65535 can be used. Legacy documentation uses the description "show on radar" for the opcode.

     

  • 018B CHANGE_BLIP_DISPLAY

     

    This opcode changes the display of the specified blip.

    [table]

     

     

    Display

     

    Enum

     

    Notes

     

     

     

    0

     

    NEITHER

     

    Hide all

     

     

     

    1

     

    MARKER_ONLY

     

    Show only the arrow/sphere in the world

     

     

     

    2

     

    BLIP_ONLY

     

    Show only the blip/sprite on the map

     

     

     

    3

     

    BOTH

     

    Show all

     

    [/table]

     

  • 018C ADD_ONE_OFF_SOUND

    The audible ranges of all sounds are documented.

  • 018D ADD_CONTINUOUS_SOUND

    All of GTA III is complete (there were so many!) and the audible ranges of all sounds are documented.

  • 01E1 SET_CHAR_OBJ_FOLLOW_ROUTE

     

    This opcode sets the character's objective to walk along a route created by opcode 01E2. If the path is obstructed, the character cannot complete the route. When used on the player character, the player character becomes uncontrollable as it follows the route. Entering a vehicle, getting wasted, or getting busted regains control of the player character. Assigning certain objectives or clearing it using opcode 011C will stop any character from following the route.

    [table]

     

     

    Mode

     

    Enum

     

    Notes

     

     

     

    0

     

    FOLLOW_ROUTE_INVALID

     

    Walks straight to the center of the map (0,0)

     

     

     

    1

     

    FOLLOW_ROUTE_ONCE

     

    Follows the route once, then walks straight to the center of the map (0,0)

     

     

     

    2

     

    FOLLOW_ROUTE_BACKFORWARD

     

    Follows the route in loop, when reaches the end walks back, e.g. 1,2,3,4,3,2,1,2,3,...

     

     

     

    3

     

    FOLLOW_ROUTE_LOOP

     

    Follows the route in loop, when reaches the end starts at the beginning, e.g. 1,2,3,4,1,2,3,4,1,...

     

    [/table]

     

  • 020C ADD_EXPLOSION

    More details have been documented.

  • 02C3 START_PACMAN_RACE

    All pickup locations listed and mapped

  • 02E7 START_CUTSCENE

     

    This opcode starts a cutscene loaded by opcode 02E4. Cutscenes must be properly ended using opcode 02EA otherwise the game will be stuck in an uncontrollable state when the cutscene ends playing or is skipped.

    In GTA III and Vice City, widescreen is switched on while the cutscene plays. Most cutscenes can be started without loading anything other than cutscene data but it would look really weird. The minimum to view cutscenes properly is to set the position of the cutscene, create cutscene objects and assign them an animation, and, in GTA III, create cutscene heads and assign them an animation. Subtitles are generally shown using opcode 00BC timed to appear using 02E8 along with the cutscene.

     

  • 034A INDUSTRIAL_PASSED
  • 034B COMMERCIAL_PASSED
  • 039D ADD_MOVING_PARTICLE_EFFECT

     

    This opcode adds a moving particle effects at the specified location for a duration of time. Particle effects must be in range of the player (about 95 units) when adding them into the world; they will not appear when added outside the range. Particle effects that have been added will disappear when the player moves out of range regardless of duration.

    Using a particle ID outside the range listed on the page produces unpredictable results and may crash the game. The colors red, green, and blue only affect particle 14 in GTA III and particle 16 in Vice City and has no effect on anything else. Some particles do not obey the duration and are noted in the page. If the duration is set to 0, particles that obey duration will loop forever; using opcode 03AE or moving outside the range of the particle can remove a particle effect stuck in a loop. The strength represents the direction and length of movement of the particle. Some particles look meaningless or weird absence of the strength. Ones that are affected by gravity can be seen arcing towards the ground if an X or Y strength is set. Some particles do not obey the strength and are noted in the page. Particle effects created with this opcode is saved in block 14 of the save file in GTA III and block 15 in Vice City.

     

  • 042C SET_TOTAL_NUMBER_OF_MISSIONS

     

    In GTA III, this opcode sets right value of the "Missions passed" stat (GXT string FEST_MP). The left value is affected by 0318. The stat initially starts with a value of 0. That stat does not exist in Vice City so the opcode has no practical effect there. The value set with this opcode is saved in block 17 of the save file in GTA III and block 19 in Vice City.

     

  • 042E REGISTER_FASTEST_TIME

    The extended stats section is simplified and clarified (check out a fancy use of this here).

  • 042F REGISTER_HIGHEST_SCORE

    The extended stats section is simplified and clarified.

  • 0434 START_CREDITS

    Entire list of all GXT strings along with properties of the text from the end credits (different languages show different line separations :O)

  • 058D SET_SHORTCUT_PICKUP_POINT

     

    This opcode sets the starting location of restart mission taxis. The destination and most of the behavior of the restart taxi is set using opcode 058E. The taxi requires a ground to spawn on, otherwise it would not spawn at all. A maximum number of 16 points can be set before the game disallows anymore points to be set. The original script used eight, one in front of each hospital and police station. The point set with this opcode is saved in block 3 of the save file.

     

EDIT 1: The list has been updated to include full descriptions for some of the opcodes for your convenience.

EDIT 2: July update! Check out all the interesting script-related documentation.

  • We're in the process of renaming all "threads" to "scripts", their correct names.
  • CustomVariables.ini

    All named variables from the source has been completed as far as I can tell.

  • Ped type

    Table updated to be more better to use.

  • Crane, and all their related opcodes
  • 01EE ACTIVATE_CRANE

     

    This opcode grabs and activates a crane that can lift any car within the pickup zone and move it to the drop off point. The crane's arm will rotate towards the center point of the pick up zone. If the crane has a magnet, it is lowered towards the same point and can be used to pick up the car. The car must be stationary for the crane's hook to attach to the car. When the car gets attached to the crane's hook whether it is a magnet or not, it becomes non-solid. At the drop off point, the car is released and becomes solid again. If you stand underneath the drop off point, the crane will not drop off the car until you move away. If the car becomes destroyed while in transit (but not before), the crane will still continue moving it. The crane moves back to its initial state afterwards and can be reused again.

     

  • 02FB ACTIVATE_CRUSHER_CRANE

     

    This opcode grabs and activates a crane that accepts vehicles for the crusher. The crane behaves similarly to ones activated by opcode 01EE with the following differences. If the crane have a magnet, the height of the magnet is lowered. When you deliver a vehicle model it does not accept, GXT string CR_1 ("Crane cannot lift this vehicle.") is displayed and the crane refuses the vehicle. The following vehicle models based on their IDE values are rejected by cranes activated with this opcode:

    • 97 (Firetruck)
    • 98 (Trashmaster)
    • 102 (Blista)
    • 118 (Securicar)
    • 121 (Bus)
    • 122 (Rhino)
    • 126 (Dodo)
    The crusher itself is separate from the crane and is not tied to this restriction or the crane.

     

  • 0368 ACTIVATE_MILITARY_CRANE

     

    This opcode grabs and activates a crane that accepts emergency vehicles for exporting. Fans generally call this crane the emergency vehicle crane (or EV crane) because the vehicles it accepts are all the emergency vehicles in the game. The crane behaves similarly to ones activated by opcode 01EE with the following differences. When you deliver a vehicle model it does not accept at all, GXT string GA_19 ("We're not interested in that model.") is displayed and the crane refuses the vehicle. The following vehicle models based on their IDE values are accepted by cranes activated with this opcode:

    • 97 (Firetruck)
    • 106 (Ambulance)
    • 107 (Fbi Car)
    • 116 (Police)
    • 117 (Enforcer)
    • 122 (Rhino)
    • 123 (Barracks OL)
    When the crane drops off the vehicle, the vehicle disappears immediately. On all but the seventh and last vehicle, you are then rewarded $1,500 and GXT string GA_10 ("Nice one. Here's your $1500") is displayed. Regardless of order, the last vehicle delivered yields nothing. The crane accepts vehicles of the same model only once. If you attempt to deliver it again, GXT string GA_20 ("We got more of these than we can shift. Sorry man, no deal.") is displayed and the crane refuses the vehicle. This refusal applies globally if you have more than one military cranes. Opcode 03EC can be used to check if all vehicles have been collected by the crane.

     

  • 03A0 IS_CRANE_LIFTING_CAR

     

    This opcode returns true if a crane at the location is lifting the specified vehicle. Somewhat misleadingly, state 3 (moving upwards from pick up) of the crane is ignored; only states 2 (moving to destination) and 4 (moving downwards to drop off) are detected.

     

  • 03EC HAS_MILITARY_CRANE_COLLECTED_ALL_CARS

     

    This opcode returns true if the military crane has collected all of the following vehicle models, listed based on their IDE values:

    • 97 (Firetruck)
    • 106 (Ambulance)
    • 107 (Fbi Car)
    • 116 (Police)
    • 117 (Enforcer)
    • 122 (Rhino)
    • 123 (Barrack OL)

     

  • 021F SET_ALL_TAXI_LIGHTS

     

    This opcode allows all taxis to spawn with their roof lights turned on. Anything that can spawn a taxi like 00A5, 014B, or natural traffic, is affected. Taxis that are already spawned are not affected by this opcode. This opcode was never called in the original script of GTA III.

     

  • 03B6 SWAP_NEAREST_BUILDING_MODEL

     

    This opcode swaps a map model with another map model nearest to the center of the search area. The collision model and time property (TOBJ) of the model to swap to are also swapped with the model to swap from. The position and rotation of the model to swap from are preserved. Take note on not forgetting about its LOD model. Attempting to swap from a breakable object yields no effect and swapping to a breaking object does not preserve its ability to break. Data of the swapped model is saved in block 0 of the save file in GTA III, block 0 in Vice City, and block 1 in San Andreas, as long as the model is swapped; if the model is swapped back to the original model, the game no longer save that information. The game can swap and save a maximum of 25 map models.

     

  • 039D ADD_MOVING_PARTICLE_EFFECT

    All particles complete with images

  • 0415 IS_CAR_DOOR_CLOSED

     

    This opcode returns true if the car component of the car is closed. If the component is damaged and cannot be closed shut, the opcode can still return true if the component rotates into the closing position.

    [table]

     

     

    ID

     

    Enum

     

    Notes

     

     

     

    0

     

    BONNET

     

    bonnet, hood

     

     

     

    1

     

    BOOT

     

    boot, trunk, tailgate

     

     

     

    2

     

    FRONT_LEFT_DOOR

     

    front left door

     

     

     

    3

     

    FRONT_RIGHT_DOOR

     

    front right door

     

     

     

    4

     

    REAR_LEFT_DOOR

     

    rear left door

     

     

     

    5

     

    REAR_RIGHT_DOOR

     

    rear right door

     

    [/table]

     

  • 0421 FORCE_RAIN

     

    This opcode allows raindrops to display in cull zones with flag 8 when raining. Normally entering zones with this flag do not display raindrops. The opcode has no effect on the rain itself. The original script called this opcode only once, during the introduction sequence.

     

  • 049F SET_OBJECT_PATH_POSITION

    Includes a code snippet to recreate removed opcode 04A0, GET_OBJECT_DISTANCE_ALONG_PATH.

  • 04FC GET_WHEELIE_STATS

     

    This opcode gets the data of two wheels, wheelie, and stoppie stunts. After the opcode is called, all the stunt data are immediately set 0. The two wheels or stoppie stunt must be performed for more than two seconds or the wheelie stunt for more than five seconds in order to be able to get any data for those stunts the three stunts are independent of each other but the duration and distance of each stunt are dependent on the stunt. Interestingly the game does not use this opcode to register stunt data into the statistics; it registers them regardless of this opcode. This opcode is primarily used to display stunt data onscreen in the stunt jump script in the original script.

     

  • 04F9 SET_EXTRA_COLOURS

    Includes full table for Vice City.

  • 0523 HAS_GLASS_BEEN_SHATTERED_NEARBY

     

    This opcode returns true if a glass map object has been shattered near the specified location. The opcode detects any glass within a 20-unit radius to the center of the glass. If there are more than one glass within the radius, glass that is closest to the coordinates point takes the highest priority. The original script called this opcode during "Shakedown."

     

  • 0598 CREATE_DUST_EFFECT_FOR_CUTSCENE_HELI

     

    This opcode creates a helicopter dust particle effect around an object, behaving almost exactly as the one created by helicopters. The opcode must be placed within a loop, preferably with a wait of 0, in order to constantly create the particle effect. The radius parameter is the distance between the center of the object and the particles surrounding it at ground level. The density is capped at 8; any value higher than 8 is treated as 8. The player character must be within about 500 units of the object in order for the particle effect to be created. Pilotable helicopters in the game has a radius of 10.0 and density of about 9. The original script used this opcode on Lance's cutscene helicopter in the introduction scene.

     

EDIT 3: August update! More interesting pages. Edited by spaceeinstein

Share this post


Link to post
Share on other sites
spaceeinstein

I took a brief look at the original PS2 version and the Japanese PS2 version and compared the supported opcodes with the PC version. It looks like there are some differences.

 

[table]

Opcode and Command Original

PS2

Japanese

PS2

PC 038D DRAW_SPRITE ✗ ✗ ✓ 038E DRAW_RECT ✗ ✗ ✓ 038F LOAD_SPRITE ✗ ✗ ✓ 0390 LOAD_TEXTURE_DICTIONARY ✗ ✗ ✓ 0391 REMOVE_TEXTURE_DICTIONARY ✗ ✗ ✓ 0397 SWITCH_CAR_SIREN ✗ ✗ ✓ 03E3 SET_SPRITES_DRAW_BEFORE_FADE ✗ ✗ ✓ 043E SET_PLAYER_HOOKER ✗ ✗ ✓ 0521 IS_CHAR_DROWNING_IN_WATER ✗ ✓ ✓ 059A IS_AUSTRALIAN_GAME ✗ ✓ ✓ 059B DISARM_CAR_BOMB ✗ ✓ ✓ 059C SET_ONSCREEN_COUNTER_FLASH_WHEN_FIRST_DISPLAYED ✗ - ✓ 059C IS_JAPANESE_GAME - ✓ - 059D SHUFFLE_CARD_DECKS ✗ ✗ ✓ 059E FETCH_NEXT_CARD ✗ ✗ ✓ 059F GET_OBJECT_VELOCITY ✗ ✗ ✓ 05A0 IS_DEBUG_CAMERA_ON ✗ ✗ ✓ 05A1 ADD_TO_OBJECT_ROTATION_VELOCITY ✗ ✗ ✓ 05A2 SET_OBJECT_ROTATION_VELOCITY ✗ ✗ ✓ 05A3 IS_OBJECT_STATIC ✗ ✗ ✓ 05A4 GET_ANGLE_BETWEEN_2D_VECTORS ✗ ✗ ✓ 05A5 DO_2D_RECTANGLES_COLLIDE ✗ ✗ ✓ 05A6 GET_OBJECT_ROTATION_VELOCITY ✗ ✗ ✓ 05A7 ADD_VELOCITY_RELATIVE_TO_OBJECT_VELOCITY ✗ ✗ ✓ 05A8 GET_OBJECT_SPEED ✗ ✗ ✓ [/table]

Share this post


Link to post
Share on other sites
spaceeinstein

Can someone help figure this out? Opcode 0540 (VC) does not seem to have any effect in the game. It is only used during "Shakedown". The command name is "SET_PLAYER_AUTO_AIM" and old documentations named it "window_washer_credibility". I looked up a video of the PS2 version of the mission and auto-aim still works during the mission so it doesn't seem to be system-dependent.

Share this post


Link to post
Share on other sites
spaceeinstein

Here's a list of opcode-related articles that I feel are interesting over the past year at GTAModding.

  • 057C SET_ALLOW_HURRICANES

     

    This opcode allows hurricane weather. It can choose from the two weather lists available in the game. The value set with this opcode is saved in block 19 of the save file in Vice City.

     

  • 059D SHUFFLE_CARD_DECKS

    Includes algorithm showing how cards are shuffled.

  • 041D SET_NEAR_CLIP

     

    This opcode sets the near clip of the camera. Anything closer to the camera than the specified value will be clipped by the game as seen in the image in the article. The effect of this opcode resets to its default value of 0.9 anytime a cutscene clears. Small values close to or at 0.0 will cause weird graphical glitches and negative values will clip everything that can be clipped so those value are not recommended. The opcode is generally used during cutscenes but it can be used anytime.

     

  • 0165 CHANGE_BLIP_COLOUR

    Includes all available blip colors.

  • 02EC CREATE_COLLECTABLE1
  • 04A6 CREATE_PROTECTION_PICKUP
  • 0517 CREATE_LOCKED_PROPERTY_PICKUP
  • 0518 CREATE_FORSALE_PROPERTY_PICKUP
  • 02F0 DROP_MINE
  • 02F1 DROP_NAUTICAL_MINE
  • 045C FAIL_CURRENT_MISSION

     

    This opcode terminates the active mission by executing its mission cleanup routine. It only affects active missions with a specific structure and has no effect elsewhere. This opcode should not be called during cutscenes because it can skip over opcode 02EA, preventing you from resuming control of your character, unless the opcode is placed in the mission cleanup routine. Names used in alternative documentations include abort_mission and terminate_active_mission. This opcode was never called in the original script of GTA III and Vice City.

     

  • 0331 SET_PLAYER_FAST_RELOAD

     

    This opcode sets the player's ability to reload certain weapons quickly. Only some weapons take full advantage of this ability by skipping the reload sequence completely. They include the Python, sniper rifles, and Rocket Launcher. Other weapons partially take advantage of this by replacing the reload animation with a short pause. They include pistols, sub-machine guns, and rifles. Shotguns do not take advantage of this; they merely silence the reload sound effect. The value set with this opcode is saved in block 16 of the save file in GTA III, block 18 in Vice City, and block 15 in San Andreas. This opcode was never called in the original script of GTA III.

     

  • 0136 SHAKE_CAM_WITH_POINT

     

    This opcode shakes the in-game camera for a while. The higher the integer value is, the more and the longer the camera shakes. The shaking of the camera depends if the camera's location, not the player's location, is within 100 units of the specified coordinates point. The duration and intensity is independent of that point. Leaving or entering the area after the opcode is called does not change the behavior of the shaking. This opcode was never called in the original script of GTA III.

     

  • 015E IS_CAR_IN_AIR

     

    This conditional opcode returns true depending on the drive type of the car under these circumstances. If the car is front-wheel drive, the opcode returns true if both the front wheels are off the ground. If the car is rear-wheel drive, the opcode returns true if both the rear wheels are off the ground. If the car is four-wheel drive, the opcode returns true if all four wheels are off the ground. Oddly for boats, the opcode produces an inconsistent return result. It returns true for some boats and false for others. Legacy documentation incorrectly described this opcode as checking if the car's wheels are on the ground.

     

  • 0354 START_CHASE_SCENE

    Includes table of all cars and their properties created for the scene.

  • 01F9 START_KILL_FRENZY
  • 0374 SET_MOTION_BLUR

    Includes screenshots of all possible effects.

     

    This opcode sets the motion blur primarily by overlaying a color over the camera. It is most effective when the trails option is turned on and the amount of blurriness differs depending on the mode. The effects of this opcode are cleared when the player dies or is arrested. The effects are overridden when the Sniper Rifle is used.

     

  • 010C GIVE_REMOTE_CONTROLLED_CAR_TO_PLAYER

    Includes map of zones in GTA III where the RC Bandit will spontaneously explode.

  • 02BC SET_SWAT_REQUIRED

     

    This opcode sets patrol cars regardless of the wanted level to Police cars and Enforcers, which normally happens when a four-star wanted level is achieved. Everything else behaves normally according to the wanted level like police helicopters, aggression, spawn rate, etc. Roadblocks at wanted levels 5 and 6 retain the usual Fbi Cars and Barracks OL, although this seems to be bugged. It is recommended that the models for the Enforcer and the SWAT be loaded beforehand in order to increase the chance of them spawning in the streets. The effect is reset when the player dies or is arrested. Legacy documentations described this opcode as setting the cop behavior.

     

  • 0319 SET_CHAR_RUNNING

     

    Many actions that require the character to move to a location will make the character walk to its destination. This opcode allows the character to run to its destination instead. It does not seem to work on the player character. Legacy documentations had incorrectly described this opcode as setting the character's wander state.

     

  • 0291 SET_CHAR_HEED_THREATS

     

    A newly spawned character does not react when threatened by most events, e.g. getting punched or about to be run over by a car. This opcode sets the character to heed threats and react to them accordingly, e.g. running away, attacking back, or dodging a car. The game can cause the character to heed threats on its own depending on the conditions. Alternative documentations describe this opcode as setting the character to attack when provoked.

     

  • 032D SET_CAR_BLOCK_CAR

     

    This opcode sets the vehicle to block the target vehicle by driving in front of it. A driver other than the player must be present for the opcode to work. Anytime the vehicle stops, it will reverse and attempt to block the target vehicle again. It is recommended that the driving style and cruise speed be changed to increase the effectiveness of the block. If the vehicle has a siren, the siren will be switched on. Making the vehicle perform some other actions, like making the driver leave the vehicle or making the vehicle drive to someplace else, cancels the effect. The target vehicle must exist -- if it disappears while the blocking is still in effect, the game will crash.

     

  • 016E OVERRIDE_NEXT_RESTART

     

    This opcode creates a restart point that overrides all restart points, which include ones created through opcodes 016C and 016D, only for the next player death or arrest. After the player is wasted or busted, the player will be spawned at the restart point and the override will be disabled, allowing all other restart points to resume. Opcode 01F6 can be used to cancel the override. The override restart point and its status are saved in block 9 of the save file in GTA III, block 10 in Vice City, and block 8 in San Andreas.

     

  • 01F7 SET_POLICE_IGNORE_PLAYER

     

    This opcode sets the police to ignore the player. The police becomes unaggressive to the player and does not chase the player; police vehicles spawn with their siren off; they stop their vehicles when close to the player, exit, and walk away, sometimes taking cover and doing nothing; and the police helicopter will not show up. Everything else related to the police remains the same, like attaining wanted level, police deploying spike strips, and spawn rate of the police. Using a garage to respray your vehicle or fit a car bomb resets this effect and resumes the normal behavior of the police.

     

  • 0324 SET_ZONE_GROUP
  • 059C

    Steam version has this as its last opcode also, a conditional opcode always returning false.

  • 00D8 MISSION_HAS_FINISHED

    Vice City's section should be complete or close to complete.

  • 015C SET_ZONE_PED_INFO
  • 0169 SET_FADING_COLOUR

    Includes table of hardcoded fade colors for Vice City.

  • 02DD GET_RANDOM_CHAR_IN_ZONE

     

    This opcode gets a random non-mission character in the zone based on its ped type and turns it into a mission character. There are three categories that the opcode looks for: civilian (CIVMALE and CIVFEMALE), gang members (GANG1, GANG2, GANG3, GANG4, GANG5, GANG6, GANG7, GANG8, and GANG9), and criminals and prostitutes (CRIMINAL and PROSTITUTE). If it fails to get anything, it returns -1.

     

  • 058E SET_SHORTCUT_DROPOFF_POINT_FOR_MISSION

     

    This opcode sets the taxi shortcut drop-off point for mission. Pick-up points are set using opcode 058D. After the drop-off point is set, when the player dies or gets arrested, a marked Kaufman Cab is spawned at the closest pick-up point. When pressing button 15 near it, controls are disabled and the player character enters it as a passenger. The taxi will drive straight while the screen fades out to black and a big message with GXT key TAXI ("Taxi") is displayed. The taxi then warps to the drop-off point, the screen fades back in, $9 is removed, the player character exits the taxi, and controls are resumed. The taxi is marked as no longer needed and becomes a normal traffic taxi. The destination requires a ground to spawn on, otherwise it spawns in unexpected positions. Only the most recent drop-off point is used.

    This opcode is generally called at the beginning of missions although it is not required to do so. If the player dies or gets arrested during a mission, the taxi can be used as a shortcut to get back to the contact point. The taxi shortcut is disabled if 0318 or 0595 is called, usually when the player passes a mission, or when a rampage is started. An active taxi shortcut can be cleared without riding it by calling opcode 0557 or by setting up another taxi shortcut.

     

  • 0556 SET_UP_TAXI_SHORTCUT
  • 0107 CREATE_OBJECT

    money.dff and package1.dff have unique hardcoded behavior.

  • General article on text drawn on screen
  • Pac-Man pickups information
  • All payphone-related opcodes, including ones that create mini-cutscenes when picking up a payphone
Edited by spaceeinstein

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • 2 Users Currently Viewing
    0 members, 0 Anonymous, 2 Guests

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.