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

GTA:SA Opcodes

Recommended Posts

Deji

Less exciting:

 

 

09FC:   unknown_object_check $OBJ

 

 

->

 

 

09FC:   anything_entered_objects_position $OBJ

 

 

Seems to trigger "true" when something is colliding with it... Even if it's destroyed?

 

It then stays true for some reason.

 

 

When it was used in the main.scm, things were raised whenever it returned true (either by setting the velocity upwards or teleporting it upwards).

 

And only during the craziness that is the only fun Zero mission, New Model Army.

 

It's used to control the Barrels after you drop em... And to check if some objects are allowed to be dropped. Still not quite sure about the specifics of this opcode.

 

I'm on a roll!

 

 

"It's 3AM in the mornin... My dog is laying on my bed on the floor and... I don't know why I'm awake but at least I've found opcodes.. opcodes..."

 

 

 

 

 

UPDATE:

 

 

0161: [email protected] = create_marker_above_car [email protected] unknown 4 radar_mode 2

 

 

It lies!

 

 

0161: [email protected] = create_marker_above_car [email protected] unknown 4 visibility 2

 

 

Although I'll leave this unchanged and up for debate... Dunno how it could be confused.

 

0 = don't show

1 = show

2 = don't show

 

No... I don't know what the unknown one is cryani.gif

Edited by Deji

Share this post


Link to post
Share on other sites
Deji

O-M-G!

 

 

0078=2,%1d% += tripled_random_float_in_range_0_to %2d%;; floating-point values

 

 

(From the VCSCM.INI).

 

 

Does this apply to SA too?!

 

 

0078=2,%1d% += unknown_float * %2d%; (float)

 

 

 

I thought we'd never find out what these mean... There are about 10 of these math opcodes that are "unknown"... And all along they've been defined in another .ini file?

 

 

But I wanted confirmation before I applied the update to the other GTA's in the opcode database...

 

 

C'mon people... contribute to this topic smile.gif We might have just found 12 more opcodes... And I'm still testing with a load of others and getting interesting results.

 

Surely I'm not the only sad person who won't give up?

 

 

EDIT

 

The opcode database now has the ability to provide you with the sascm.ini and opcodes.txt but exclude the CLEO ones. Which may be helpful for some.

Edited by Deji

Share this post


Link to post
Share on other sites
Deji

How many years have loads of people left opcodes been unfound?

 

 

0A43: unknown

 

 

->

 

 

0A43: unknown_disable_prostitute_invitations

 

 

It seems to work when in a loop... It may also do more things than that... But that's what I've found.

 

 

Was only used during the dates with girlfriends... Which is what gave me the idea to look around that area. I also noticed it crashed when I activated it during a prostitute invitation and made the pro get out if I activated it after she had got in the car.

 

It's also the second-to-last opcode in San Andreas smile.gif I'd love to find out what the last opcode does. Something similar, probably..

 

 

Oh yeah... I'd like a few confirmations on this opcode too... And I'm leaving it with "unknown" status until either more info is found or it turns out that is all it does.

Share this post


Link to post
Share on other sites
NTAuthority

 

It's also the second-to-last opcode in San Andreas smile.gif I'd love to find out what the last opcode does. Something similar, probably..

Not nearly, there's also more than 0A44 outside of CLEO! (EDIT3: but it's the second-to-last unknown)

 

 

Oh yeah... I'd like a few confirmations on this opcode too... And I'm leaving it with "unknown" status until either more info is found or it turns out that is all it does.

 

 

It only sets a bit in a CTask/CPedIntelligence/something structure, not much more. However, I think it could more likely be 'disable_current_prostitute_invitation', since MTA documents the CPed it changes the data for as either m_pCurrentProstitutePed or m_pLastProstituteShagged.

 

(EDIT4: GET_RID_OF_PLAYER_PROSTITUTE)

 

Flag 0A44 defaults to '1', and is checked by various opcodes, such as:

 

- 03E5: show_text_box

- 0512: show_permanent_text_box

- 0513: show_text_box_1number

 

Also, opcode 09BD sets the same flag, but combines it with another flag. The other flag from 09BD is used for the same opcodes. This flag seems to do something disabling text boxes, and could possibly be something like 'disallow this script from making text boxes' or 'disallow other scripts from making text boxes'. I'll test it, and will edit this post once/if I find it. smile.gif

 

EDIT: if my possibility is correct, 09BE could be DOES_THIS_MINIGAME_SCRIPT_ALLOW_NON_MINIGAME_HELP_MESSAGES, and 09BD could be DISPLAY_NON_MINIGAME_HELP_MESSAGES (with 1 being 'no' and 0 being 'yes'). smile.gif

 

EDIT2: OPCODE PASSED! $5000

 

For an example, see these two test CLEO cases:

 

minigamehelp1.cs

 

{$CLEO}const   ENABLED = [email protected]::MainLoopwait 250if   00E1: 0 11then   if       ENABLED == 1   then       ENABLED = 0       09BD: 0       03E5: 'CHEATOF'   else       ENABLED = 1       09BD: 1       03E5: 'CHEATON'           endendif   00E1: 0 8then   03E5: 'HELP101'endjump @MainLoop

 

 

minigamehelp2.cs

 

{$CLEO}0000::MainLoopwait 250if   00E1: 0 9then   03E5: 'HOSP_1'endjump @MainLoop

 

 

Test procedure:

 

1. Start the game.

2. Press (default) G. The help message HELP101 (about respect) should appear.

3. Press (default) H. The help message HOSP_1 (about the hospital) should appear.

4. Press (default) Y. The message 'Script debug mode ON' should appear, though this is not a test case.

5. Press G again. The help message HELP101 should still appear.

6. Press H again. Note that no help message appears.

7. Press Y again.

8. Press H. The hospital help message should be functional again.

 

I still haven't tested 0A44, but it could be 0A44 is a temporary override for 09BD.

 

EDIT5: the unknown flag 0A3F is a NOP flag. it does nothing, likely used for debugging.

EDIT6:

 

 

0A37=1,disable_vehicle_lights %1d%

 

 

This opcode disables all vehicle lights from being rendered if enabled, including sirens, tail lights, headlights and brake lights.

 

As always, a test case:

 

 

{$CLEO}const   ENABLED = [email protected]::MainLoopwait 25000C0: 0 0if   00E1: 0 10then   if       ENABLED == 1   then       ENABLED = 0       0A37: 0       03E5: 'CHEATOF'   else       ENABLED = 1       0A37: 1       03E5: 'CHEATON'           endendjump @MainLoop

 

 

1. Get near a vehicle.

2. Press N (default). The lights of the vehicle should turn off.

3. Press N again. The lights should be enabled again.

 

EDIT7:

 

0A33 gets the vehicle named by the following entry in CPhysical:

 

 

CEntitySAInterface * pAttachedEntity;

 

 

As such, I'd like to rename these to the following:

 

 

0A32=1,unknown_actor %1d% attached_to_car0A33=2,unknown_get_actor %1d% attached_car_to %2d%

 

 

For the .sc freaks, 0A32 is likely IS_PED_ATTACHED_TO_ANY_CAR, and GET_CAR_PED_IS_ATTACHED_TO (does not exist in IV, but is a likely name, right?)

 

Oddly, this attachment is not possible from script, and is either done a) hardcoded, b) from some DAT files or c) from the external script setting.

 

EDIT8:

 

 

09EC=1,set_garage_leave_camera_alone %1d%

 

 

Rockstar's official name is SET_GARAGE_LEAVE_CAMERA_ALONE, and fits the description perfectly.

 

Test case (09ec.cs):

 

 

{$CLEO}const   ENABLED = [email protected]::MainLoopwait 250if   00E1: 0 10then   if       ENABLED == 1   then       ENABLED = 0       09EC: 0       03E5: 'CHEATOF'   else       ENABLED = 1       09EC: 1       03E5: 'CHEATON'           endendjump @MainLoop

 

 

1. Go near a garage (one that changes the camera, like CJ's house) and spawn a vehicle.

2. Drive the vehicle in the garage and get out. The camera should zoom out from the player.

3. Get in the vehicle, drive out of the garage, and press N.

4. Redo step 2. Note that the camera stays behind the vehicle/player.

Edited by NTAuthority

Share this post


Link to post
Share on other sites
Deji

Verrrry nice..

 

 

0A43: get_rid_of_player_prostitute

 

 

Fits what was happening when I tested it and is a better answer than the idea of it only working in a loop. I used it in a loop.. And so the invitation was disabled before the request was visible to me.

 

 

Did you say

 

0A44: unknown_flag 1

 

is

 

0A44: disable_text 1

 

 

Or some sort of "disable_external_script_text"?

 

 

 

09BD: display_non_minigame_help_text

 

 

0A44, 0A32, 0A33, 0A37, 0A3F, 09EC and 09BD modified... I think.

Share this post


Link to post
Share on other sites
NTAuthority
Verrrry nice..

 

 

0A43: get_rid_of_player_prostitute

 

 

Fits what was happening when I tested it and is a better answer than the idea of it only working in a loop. I used it in a loop.. And so the invitation was disabled before the request was visible to me.

Well, the GTA IV function list + the gta_sa.idb file is a huge help for unknown scripting stuff. tounge.gif

 

 

Did you say

 

0A44: unknown_flag 1

 

is

 

0A44: disable_text 1

 

 

Or some sort of "disable_external_script_text"?

 

 

Well, 0A44 is more 'override_09BD', but I've not tested this completely tounge.gif

 

 

 

09BD: display_non_minigame_help_text

 

 

0A44, 0A32, 0A33, 0A37, 0A3F, 09EC and 09BD modified... I think.

 

 

Your current description for 09BD is a bit off, I'd prefer these names for consistency (it has nothing to do with externals):

 

 

09BD=1,allow_other_threads_to_display_text_boxes %1d%09BE=0,  are_text_boxes_locked_to_any_thread

 

 

Also, 0A44 doesn't seem changed... yet tounge.gif There's an useless space in front of 0A32 currently as well.

 

Another thing is a tiny change to the description of opcode 0A2E:

 

0A2E=7,AS_actor %1d% go_to %2d% %3d% %4d% mode %5h% %6h% ms stop_radius %7d% following_paths

 

 

-- since this is in SA the only opcode where the ped will follow paths.

Share this post


Link to post
Share on other sites
Deji

I can't open gta_sa.idb... I think I couldn't get the program required or something.

 

Also.. Where is this gta_sa.idb file?

 

 

Made those opcode changes...

 

 

Most of these knew opcodes are really complex tounge.gif - Don't think I've found a useful one yet.

 

 

 

Any info on 0078 and similar math opcodes?

 

 

O-M-G!

 

 

0078=2,%1d% += tripled_random_float_in_range_0_to %2d%;; floating-point values

 

 

 

(From the VCSCM.INI).

 

 

Does this apply to SA too?!

 

 

0078=2,%1d% += unknown_float * %2d%; (float)

 

 

 

 

I thought we'd never find out what these mean... There are about 10 of these math opcodes that are "unknown"... And all along they've been defined in another .ini file?

 

 

But I wanted confirmation before I applied the update to the other GTA's in the opcode database...

Share this post


Link to post
Share on other sites
NTAuthority
Any info on 0078 and similar math opcodes?

0078 and the other 'unknown_float *' multiply the 'frame delta time' by the given value. This is useful for things that are updated every frame (as in 'wait 0'), but need to have a consistent time per second, independent of the frame rate.

 

Look in a nearby game programming book for information on usage of delta time. (hint: it's the time elapsed since the last frame in milliseconds/seconds, or so) A possible test case could be a call like 0078: [email protected] += 1.0 and displaying it, with the frame limiter (25 FPS) on, it should return a value like 0.04 or 400 or something.

 

 

I can't open gta_sa.idb... I think I couldn't get the program required or something.

 

Also.. Where is this gta_sa.idb file?

 

 

Even if you had it, it's a bit hard to understand. Harder than C++. wink.gif

 

 

Most of these knew opcodes are really complex  - Don't think I've found a useful one yet.

 

 

The garage one can be useful, with it you won't need to change the IPL anymore!

Share this post


Link to post
Share on other sites
spaceeinstein

I somehow mistakenly posted in this topic. Oh well, can someone confirm 0114 works on foot in SA, too? When I tested it in VC, it adds ammo to my weapon. If the weapon number doesn't match but the weapons' group matches, ammo is still added.

Edited by spaceeinstein

Share this post


Link to post
Share on other sites
NTAuthority
0418=2,set_object %1d% draw_last %2h%

Share this post


Link to post
Share on other sites
Deji
0418=2,set_object %1d% draw_last %2h%

Any possible description of what that means?

Share this post


Link to post
Share on other sites
NTAuthority

 

0418=2,set_object %1d% draw_last %2h%

Any possible description of what that means?

It sets the object to always draw on top of other objects (or similar), this flag's name is taken from the MTA source, and is equal to GTA IV's command name SET_OBJECT_DRAW_LAST.

Share this post


Link to post
Share on other sites
Deji

Hmm... I guess I understand it kinda... Used in the pool script.

 

It seems to be supported by GTA3 and VC although they don't have .ini lines for it.

Share this post


Link to post
Share on other sites
spaceeinstein

The opcode was mainly used in intro custscene in Vice City. If I remembered correctly, I tested it one time used on the helicopter and the only difference I saw was that the blade's alpha transparency was changed.

Edited by spaceeinstein

Share this post


Link to post
Share on other sites
Deji

As far as I know.. In San Andreas interactive objects can get wrongly drawn on top (the balls on the pool table). This opcode was used to make sure the pool cue is always drawn above anything else. Especially useful when the pool cue is colliding with the cue ball.

Share this post


Link to post
Share on other sites
Deji

Hmm...

 

set_weather

and

force_weather

 

Seem to do two different things... With force_weather I notice no change... Is it used to set the next weather or something?

 

set_weather has loads more modes that the Sanny help file doesn't document. I'm looking for the weird colourful ones tounge.gif

Share this post


Link to post
Share on other sites
spaceeinstein

Sanny doesn't document them because there's no practical use for those values, at least for me. It can go up to hundreds and still look like nothing that can be used.

 

force_weather sets the next weather variation, so you have to wait for the current weather to change to your set weather. I don't know how to name it better but IV named them FORCE_WEATHER and FORCE_WEATHER_NOW.

 

It's good that you're testing already described opcodes because there could be unnoticed mistakes. There are already lots of misnamed opcodes in VC so there could be some in SA.

 

On the subject of misnamed opcodes, can someone check 02F6 and 02F7? 02F6 should be sine and 02F7 should be cosine.

02F7: [email protected] = "sine?" 90.0 returns 0.0 so that should have been cosine.

Edited by spaceeinstein

Share this post


Link to post
Share on other sites
Wesser

Some camera opcodes which will be known from now. smile.gif

 

0944=1,restore_camera_before_player %1d%09A3=1,show_siterocket_on_bumper_camera %1h% 

 

Share this post


Link to post
Share on other sites
ZAZ

 

Some camera opcodes which will be known from now. smile.gif

 

0944=1,restore_camera_before_player %1d%09A3=1,show_siterocket_on_bumper_camera %1h% 

 

show_siterocket_on_bumper_camera ? what should it mean?

I had a look in main.scm and found 09A3 only in mission catalyst when player is in turret mode, but don't know why it's used there

I tried it in a little script and noticed that it displays the reticule for a short moment when player is in turret mode with weapon 0

 

04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 5.5 0.3 00A5: [email protected] = create_car #INFERNUS at [email protected] [email protected] [email protected]: release_model #INFERNUS0858: set_player $PLAYER_CHAR scan_horizon_to_angle 225.0 rotation_speed 225.0 0464: put_actor $PLAYER_ACTOR into_turret_on_car [email protected] at_car_offset 0.0 0.0 0.9 position 0 shooting_angle_limit 360.0 with_weapon 0  wait 500 09A3: unknown_camera_flag 1 wait 500 09A3: unknown_camera_flag 1 wait 500 09A3: unknown_camera_flag 1 wait 500 09A3: unknown_camera_flag 1

 

I thought flag 0 would do the opposite and tried to put player on turret with minigun and flag 0 should disable the reticule but it had no effect.

 

 

 

0944=1,restore_camera_before_player %1d%

0944 shows not only the player front

0944: unknown_camera_lock_unknown_actor $PLAYER_ACTOR

it manipulate the aim mode:

the reticule disappear and player don't move in camara direction(mouse move)

 

by insert an actor handle

0944: unknown_camera_lock_unknown_actor [email protected]

the camera get fixed to the last view

 

merging with turret mode and remove from turret mode creates a first person cam

but rocket and sniper don't work

 

04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 5.5 0.3 00A5: [email protected] = create_car #INFERNUS at [email protected] [email protected] [email protected]: release_model #INFERNUS0858: set_player $PLAYER_CHAR scan_horizon_to_angle 225.0 rotation_speed 225.0 0464: put_actor $PLAYER_ACTOR into_turret_on_car [email protected] at_car_offset 0.0 0.0 0.9 position 0 shooting_angle_limit 360.0 with_weapon 0  wait 500 0944: unknown_camera_lock_unknown_actor $PLAYER_ACTOR0465: remove_actor $PLAYER_ACTOR from_turret_mode

 

this camera mode is removable with 0373: and 02EB:

I would 0944: describe with manipulate_weapon_camera

 

 

 

Share this post


Link to post
Share on other sites
Deji

 

0709: set_decision_maker $1230 on_event 36 taskID 1022 unknown 0.0 100.0 chance 0.0 unknown 0.0 1 0 // see *.ped files

 

 

->

 

 

0709: set_decision_maker $1230 on_event 36 taskID 1022 respect 0.0 hate 100.0 chance 0.0 unknown 0.0 in_car 1 on_foot 0

 

 

???

 

The decision makers are set to perform a task dependant on the current situation, so the in_car and on_foot params are almost surely correct. However I really have no clue and I don't even know how these decision makers are supposed to work (what are all these ID's?).

Share this post


Link to post
Share on other sites
NTAuthority

 

(what are all these ID's?).

I've just posted a list of task IDs, event IDs will (I hope) be added later today since I'll have to go through those manually can be found in data\decision\PedEvent.txt. The decision maker IDs refer to the first field of each line in the .ped files, I assume.

 

For instance, your example is triggered with event EVENT_ACQUAINTANCE_PED_HATE (36) on task TASK_SIMPLE_GANG_DRIVEBY (1022).

Edited by NTAuthority

Share this post


Link to post
Share on other sites
Deji

How do you figure these task names? The .ped files simply contain a bunch of numbers (the same ones used in the opcode).

 

If I can find a way to get task names like that along with their ID's, not only are they usable but it'll make it a heck of a lot easier to document many more things.

 

DUH. Tabbed browsing sucks.

 

 

I'll start experimenting.

Edited by Deji

Share this post


Link to post
Share on other sites
Deji

 

08E4=9,  object %1d% in_cube_fll_corner_at %2d% %3d% %4d% fur_corner_at %5d% %6d%   %7d% depth %8d% flag %9h%

 

 

Any clue what this means?

 

 

 

EDIT

 

And why does Sanny list so many integer stats under "floats"... 0-81 doesn't = floats... The id's have nothing to do with it. Some of the others are also floats.

Edited by Deji

Share this post


Link to post
Share on other sites
Seemann

 

08E4=9, object %1d% in_cube_fll_corner_at %2d% %3d% %4d% fur_corner_at %5d% %6d%   %7d% depth %8d% flag %9h%

 

 

Any clue what this means?

fll - front low left?

fur - front up right?

 

 

 

And why does Sanny list so many integer stats under "floats"... 0-81 doesn't = floats... The id's have nothing to do with it. Some of the others are also floats.

just because 0-119 are handled as floats in the exe (using special x86 opcodes) and the others are handled as integers.

Share this post


Link to post
Share on other sites
Kriskers

Could someone say an opcode for the player answering the phone? (So the game would say "Press TAB to pick up the phone")

Share this post


Link to post
Share on other sites
gtasearcher
Could someone say an opcode for the player answering the phone? (So the game would say "Press TAB to pick up the phone")

There is no such opcode.

 

There is a text string in american.gxt, you should find it yourself, and display it as text box.

Share this post


Link to post
Share on other sites
Wesser

Corrections of "AS_kill_actor" opcodes description:

 

0321=1,AS_actor %1d% die_headshoted05BE=1,AS_actor %1d% die

 

Share this post


Link to post
Share on other sites
Deji

Any chance someone has a list of opcodes which don't crash the game on any of the 3 GTA's?

 

So basically opcodes that work for III, VC and SA... Would speed up my job of fixing up the database and allowing vcscm.ini and scm.ini downloads smile.gif

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.


  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

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