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

    1. GTA Online

      1. The Diamond Casino Heist
      2. Find Lobbies & Players
      3. Guides & Strategies
      4. Vehicles
      5. Content Creator
      6. Help & Support
    2. Red Dead Online

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

      1. Events
    1. Red Dead Redemption 2

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

    1. Grand Theft Auto Series

    2. GTA 6

    3. GTA V

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

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA Chinatown Wars

    6. GTA Vice City Stories

    7. GTA Liberty City Stories

    8. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
    9. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
    10. GTA III

      1. Guides & Strategies
      2. Help & Support
    11. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

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

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    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
    3. Gangs

    1. News

    2. Forum Support

    3. Site Suggestions

Opius

GTA:SA Opcodes

Recommended Posts

Deji

Ahh. Kinda fixed my own problem: http://gtag.gtagaming.com/opcode-database....=browse&cat=all

 

I'm glad to have finally added just about every known opcode and organized them by game. Still need to work on organizing them by type, adding param info, etc... Jeesh, there are so many opcodes in these damn GTA's...

 

... 2625, apparently. Hehe.

 

I might help you with that list... I could only offer the opcodes, param count and game info, though... Since the rest might be too time-consuming for me to convert... Yes, I'm gonna try and make the list using PHP xD Gawd I'm addicted to it.

Share this post


Link to post
Share on other sites
TheJeweleR

hi guys smile.gif I make a cleo mods but i have a some problem smile.gif

 

How can i add this news codes to my sanny builder?

 

Nore:I love your cleo3 library seeman i love you biggrin.gif

 

please use basic english i am not american or english etc. mercie_blink.gif

Share this post


Link to post
Share on other sites
Deji

You want new opcodes for Sanny Builder?

 

http://gtag.gtagaming.com/opcode-database < Download the "sascm.ini" and "opcodes.txt" files.

 

Sanny Builder reads the opcodes from these files.

 

Save them to: "C:\Program Files\Sanny Builder 3\data\sa\"

 

 

Most of the latest found opcodes will be there wink.gif

Share this post


Link to post
Share on other sites
james227uk

Or just download the current release of CLEO4 so you can use those opcodes as well

Share this post


Link to post
Share on other sites
Deji

The opcode database can optionally export CLEO 4/3 opcodes. What's more... The opcodes that come with CLEO 4 are very outdated confused.gif

 

A database is a great substitute for laziness tounge2.gif

Share this post


Link to post
Share on other sites
Wesser

096D has an incorrect param definition. This should be the real one:

 

096D=3,get_car %1d% component_on_slot %2h% model_to %3d% 

 

Share this post


Link to post
Share on other sites
Deji

I return with what I believe to be the final text draw opcode definition:

 

 

0344: unknown_text_draw 1

 

>>

 

0344: text_draw_one_word_per_line 1

 

 

Causes each word of text to be drawn on a seperate line. Never used. I can see why.

 

 

I've been working with text draw a lot recently. For every opcode I could think of as being useful for whatever I'm doing, I've managed to discover one smile.gif Seems Rockstar found them just as useful... With this code maybe being the exception.

 

 

 

Edit

 

 

0344: unknown_text_draw 1

 

>>

 

0344: set_text_draw_linewidth 580.0

 

 

Well, as I was about to update the opcode database with this info, it showed me that in GTA3, the correct data type for this opcode was actually a float, not an integer.

 

For some reason, 0343 is said to be the linewidth. I've had problems getting this opcode to work for that reason.. But it seems these two opcodes were in fact mixed up.

 

Which baffles me as to why it was not used. Maybe 0343 is correct but doesn't work with certain text fonts?

Edited by Deji

Share this post


Link to post
Share on other sites
Deji

And to edit my previous edit:

 

 

0344: set_text_draw_linewidth 580.0

 

>>>

 

0344: set_text_draw_linewidth 580.0 for_centered_text

 

 

Seems there's seperate opcodes for different text alignments. The other linewidth opcode works on normal aligned text smile.gif

 

 

I wanna re-define 0391.

 

 

0391: release_txd_dictionary

 

>>

 

0391: release_textures

 

 

 

It doesn't release the txd file. It releases ALL loaded textures.

Share this post


Link to post
Share on other sites
NTAuthority

 

0875=2,set_object %1d% immune_to_nonplayer %2h%

 

 

Just a tiny one.

Share this post


Link to post
Share on other sites
Deji

@NTAuthority

 

Lol... I have a bit of a bone to pick with yeh...

 

 

09EC: set_garages_leave_camera_alone 1

 

 

While that is what it does, for the sake of my peace of mind I'd like to mention that it caused me a whole lot of problems when creating a camera movement script.

 

It seems that whenever the set_camera_target_position opcode was used, the camera would automatically start moving in the position the camera is pointing IF the camera target position collides with anything.

 

I think it's handy to know... And can lead to more understanding of a wider use on that opcode.

Share this post


Link to post
Share on other sites
Deji

I feel I should try getting the snowball rolling again...

 

 

0915: release_weather_instantly

 

 

The other release weather opcode allows the weather to gradually change. What I noticed with this opcode is it reverting to what the weather was before I used the set_weather opcode.

 

 

078F: unknown_actor_task -1 flag 1

 

 

I think it's another one of those task opcodes.

 

In the .scm, it seems to often be used after the actor has done another action. Only used once for the player and used after a stay_idle command in a lot of cases. Could have something to do with task switching. It's often used before 07BC.

Share this post


Link to post
Share on other sites
Deji

If only everyone has the enthusiasm I have when it comes to finding these opcodes tounge.gif

 

 

04F9: set_interior 1 color_to 0

 

 

It seems to me that, despite the fact the use of it in the main.scm would show otherwise, these parameters are in the wrong order... I've been using it for interior 0 in order to cause low draw distance (high FPS) and pretty "weather bugs". Unless the "color_to" flag is set to 0, there is no effect. The interior param changes colour as usual.

 

The main.scm would indicate that the interior ID comes first due to it being used when in certain interiors, however I think this was a heavy assumption...

 

 

07FB: set_interior 'CARMOD3' access 0  // Wheel Arch Angels[...]07B0: get_active_shop_name_to s$CURRENT_SHOP_GXT_NAME // 8-byte string 04F9: set_interior 4 color_to 0

 

 

Interior 4 does not contain a mod shop of any kind. Furthermore, the "color_to" parameter is never changed by the main.scm.

 

Parameters description switched.

 

04F9: set_color 1 of_interior 0

 

 

Yes, parameter order (in order to keep sources valid) takes priority over "conventional function naming" here.

Share this post


Link to post
Share on other sites
Seemann

 

It seems to me that, despite the fact the use of it in the main.scm would show otherwise, these parameters are in the wrong order... I've been using it for interior 0 in order to cause low draw distance (high FPS) and pretty "weather bugs". Unless the "color_to" flag is set to 0, there is no effect. The interior param changes colour as usual.

 

You're right. But the second parameter is not an interior ID. It's a flag (0/1) meaning where this opcode should work: inside any interior (0) or outside (1). I would rename it so:

 

 

04F9: set_outside_color_to 1 world_flag 0

 

Share this post


Link to post
Share on other sites
spaceeinstein

The last time I tested that in VC, the only effect I saw with the last param is fade. I forgot which values but one value fades into the color while the other instantly changes into the color. The first param is the color that corresponds to the extracolors lines in the timecyc file. The opcode is not interior-specific at all. I have this named in VC INI like this

04F9=2,set_extracolors %1h% fade %2h%

Edited by spaceeinstein

Share this post


Link to post
Share on other sites
Deji

@Seemann

 

Thanks. I did wonder why the param was always 0 in the main.scm... And I did start doubting whether it was even an interior ID due to the way it was used. I figured that any colour applied to interior 0 applied to all other interiors (the light that shines through the window) but this does make more sense smile.gif

 

@spaceeinstein

 

Surprisingly, opcodes change a bit according to game. Which I find many times when I try to edit something in the opcode database... It unfortunately means that I'm having to recode the whole database in order to have better support for VC and III. And especially for support with the VC/III CLEO and such. Should be done in a month or maybe longer. I'm also adding a whole load more fixes and features.

 

See 0099 And 041E.

 

Not even the param count matches with 041E confused.gif

 

edit

 

Hehe, actually.. The sky colour does do a little fade change when the flag is set to 1. The opcode applies to all interiors regardless of the flag. This more useful for me than I thought! smile.gif

 

I'm gonna try and document/screencap each ID. There seems to be over 20 of them.

Edited by Deji

Share this post


Link to post
Share on other sites
Deji

Ah yes... Of course...

 

Just like the set_weather opcode, with 04F9 there are up to 65535 possible ID's which all generate their own weird and wacky sky colours. They change the sun and quite possibly the moon and edit the draw distance.

 

I also got one that showed the REAL border of San Andreas.

 

user posted image

 

It also gave the game insane draw distance... Which my computer cannot handle, of course smile.gif These will be a useful alternate to setting the weather for me. It doesn't seem to cause flying trees and such, no weather specific traits.

Share this post


Link to post
Share on other sites
spaceeinstein

Do the valid values correspond to the timecyc extracolors lines like in VC? It would be even more useful if the sky can be customized like that.

Share this post


Link to post
Share on other sites
Deji

I have no idea... The timecyc.dat file confuses me more than any heap of ASM tounge.gif

 

But I doubt it, or they'd look similar to the set_weather ID's... But check out ID 0, for example: [image].

 

With set_weather, it's the standard Sunny Day... Nothing like the randomness going on there.

 

 

Not much changes with the time except the sun, I don't think.

Share this post


Link to post
Share on other sites
spaceeinstein

It's not meant to change with time. The extracolors section is meant to be completely separate from the usual weather cycles. Each line in the extracolors section corresponds to the ID for the opcode. I forgot which values go to which lines but an example would be ID 0 would be line 1 in the extracolors section, ID 1 would be line 2, etc. The sky should stay the same as long as 04FA is not called.

Share this post


Link to post
Share on other sites
Deji

Mmm... Maybe so, but I find that the draw distance changes with time. E.G while having a wacky colour applied to the sky, you can be playing around for ages and then bam! The draw distance rapidly lowers and you're looking at nothing but redness or whatever colour is in effect.

 

That's why I've always avoided the other set_weather ID's, but the interior_colors one should work better. I've actually not tested it across a timescale yet, but I have noticed ID's for this thing where the draw distance is very low... So maybe it applies here aswell.

 

 

Hmm.. Now I have no idea what 04FA does.. It seems to not be having any effect on the sky color I've set.

Edited by Deji

Share this post


Link to post
Share on other sites
TheSiggi

0446: set_actor  [email protected] immune_to_headshots 0

 

 

that code is very irritating:

 

0446

 

0446=2,%1d% %2d%

Description: Sets the actor's ability to be decapitated

Parameter 1: Actor handle

Parameter 2: Flag

Supports: GTA3, Vice City, San Andreas

Flags

 

Flag 0: Disables decaptitation

Flag 1: Enables decaptitation

 

since the flag is a boolean I would rename the code to:

 

0446: set_actor [email protected] prone_to_headshots  0/1

 

TRUE - actor is prone to headshots = one shot and the dude is history (1)

FALSE - actor is not prone to headshots = tough guy (0)

 

chhers icon14.gif

 

Share this post


Link to post
Share on other sites
james227uk

I'm surprised this has not been changed yet. It is very annoying indeed for first-time users.

Share this post


Link to post
Share on other sites
spaceeinstein

It should be better to generalize it to

0446=2,set_actor %1d% dismemberment_possible %2d%

The opcode exists in GTA III but was never used. GTA III was the only game where you can shoot off the limbs. This opcode prevents the limbs from being shot off.

Share this post


Link to post
Share on other sites
Kriskers

What is the opcode for adding a specific actor to your gang automatically? So you wouldnt need to recruit him.

Share this post


Link to post
Share on other sites
TheSiggi

use opcode search tool confused.gif

 

0631:

Share this post


Link to post
Share on other sites
Deji

After about an hour of running checks on the few missions that use this and figuring out what the hell the ASM does... I came to the conclusion that 068C ALWAYS returns false...

 

 

068C:   NOP_player_check $PLAYER_CHAR

 

 

And now to bore people.. and to figure out whether my wide guesses in ASM are right, I'll ask if this assumption is correct...

 

 

0F8 mov     ecx, dword ptr _players.pPed[eax]; player data0F8 mov     eax, [ecx+71Ch]0F8 mov     byte ptr [esp+0F8h+Y], 00F8 test    eax, eax0F8 jmp     loc_495745

 

 

It tests the value of the memory pPed+0x71... Yet still sets 0 as the condition result.

 

Alas, it's either completely useless or broken tounge2.gif

 

Now may the genius' tell me what they think?

 

EDIT: Yay! Post #800 of this topic (was the first post). I also bumped it a few pages... Your welcome.

Edited by Deji

Share this post


Link to post
Share on other sites
Deji

 

015B: unknown_shake_player_controller %1h% time %2d% unknown_intensity %3d%

 

 

Again, going by the IDB... Anyone have a rumble controller to test this thing with?

 

It seems fitting. It is used in all the places where the joypad rumbles on PS2 (like the GYMBIKE script).

Share this post


Link to post
Share on other sites
Seemann

 

After about an hour of running checks on the few missions that use this and figuring out what the hell the ASM does... I came to the conclusion that 068C ALWAYS returns false...

 

 

068C:   NOP_player_check $PLAYER_CHAR

 

 

And now to bore people.. and to figure out whether my wide guesses in ASM are right, I'll ask if this assumption is correct...

 

 

0F8 mov     ecx, dword ptr _players.pPed[eax]; player data0F8 mov     eax, [ecx+71Ch]0F8 mov     byte ptr [esp+0F8h+Y], 00F8 test    eax, eax0F8 jmp     loc_495745

 

 

It tests the value of the memory pPed+0x71... Yet still sets 0 as the condition result.

 

Alas, it's either completely useless or broken tounge2.gif

 

Now may the genius' tell me what they think?

 

EDIT: Yay! Post #800 of this topic (was the first post). I also bumped it a few pages... Your welcome.

No. The opcode result is equal to the Ped.0x71C. If it's 0 then the result is false, otherwise it's true (see jmp loc_495745).

Share this post


Link to post
Share on other sites
Deji

Ahh I see... loc_495745 is shared and is used by other conditions to set whether the return is true/false based on the previous bit of code? smile.gif

 

I'll mess around with the flag.

Share this post


Link to post
Share on other sites
Wesser

I think test gives the comparison result between CPed+0x71C and 0, then jmp redirect the code onto "loc_495745" and jz checks if it returned true or false. If so, it jumps to "loc_49574C" and push 0 as the result param of _CScriptThread__setCondResult, otherwise it sets the byte to 1 and does the last thing I mentioned. smile.gif

 

However, I've already seen that still unknown offset for CPed: I discovered it while viewing the CCamera__process and it's used like a check. As I remember, if it's 0 it checks for CPed+0x488. Dunno what they're useful for. confused.gif

Edited by Wesser

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.

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.