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 IV Mods
    5. GTA Chinatown Wars

    6. GTA Vice City Stories

    7. GTA Liberty City Stories

    8. GTA San Andreas

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

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

      1. Guides & Strategies
      2. Help & Support
      3. GTA III Mods
    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

    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

xchg

Damn i jumped the gun that opcode doesnt work as i initially thought

Edited by xchg

Share this post


Link to post
Share on other sites
Seemann

Some corrections of the opcodes being named wrong:

 

 

0099: [email protected] = random_int_in_ranges_0_to_3276706DE: [email protected] = get_train [email protected] last_carriage_handle 078A: [email protected] = get_train [email protected] carriage 1 handle 

 

 

The maximum number 0099 can return is one less than upper limit (so = 32766), just like any "random" opcodes.

 

Share this post


Link to post
Share on other sites
Seemann

 

0912: set_text_priority 1 leftmargin 75 maxwidth 250

 

Sets some properties for every priority text being shown (00BC, 01E4, etc). First parameter is a flag, set it to 0 to disable the effect of these properties. Leftmargin is a space between the CENTER of the text and the left screen border.

 

Screens:

 

Before: After:
user posted image user posted image

 

 

 

0A2C: hide_priority_text_while_fading 0

 

Same as 0A2D but for priority texts.

 

user posted image

 

Share this post


Link to post
Share on other sites
OrionSR

I'm pretty new at this, so my confidence is fairly low on the format of this report.

 

 

0A17=2,set_parked_car_generator %1d% flag %2h%

 

 

This command will set the 8 bit on the flag byte in the vehicle generator record. When set, CJ will not earn a wanted level if he enters the vehicle within view of the police. Standard vehicles with this flag include Sweet's Greenwood, Ryder's Picador, the custom plate GF cars, and vehicles parked at Wang's.

 

I have found a few references to Flag 1 as the player owns flag, but it has been difficult to determine which flag needs to be set. The description below may more accurately communicate the purpose of this code. The wording was chosen to indicate true/false, or 0/1 settings for this flag.

 

 

0A17=2,set_parked_car_generator %1d% to_player_owned %2h%

 

 

The other flag commonly confused with the player owns flag is the field after the colors and before the alarm. When this flag is set (1, -1, odd) the 2 bit is set in the vehicle generator record and this will force the vehicle to spawn more reliably. Mission reward and mission critical vehicles usually have this flag set, but ambulances, firetrucks, and most export vehicles do not.

 

The force_spawn flag may cause vehicles to suddenly appear, and in some cases they may spawn on top of CJ and crush him, but it is the only way I have found to get the Maverick on top of the LS tower to spawn unless CJ arrives by air. It is nice to finally be able to flag vehicles at the hideouts so they will spawn when the save loads at that location. If too many vehicles are placed in the same area, not all vehicles will appear - the usual limits still apply.

 

The lines below are revised to include known labels, but the line ends up fairly long and can be difficult to manage.

 

 

014b=13,%13d% = init_parked_car_generator %5o% color %6d% %7d% force_spawn %8d% alarm_pct %9d% lock_pct %10d% ipl_11 %11d% value %12d% at %1d% %2d% %3d% angle %4d%

 

 

 

09E2=14,%14d% = parked_car_generator_w_numberplate %5o% color %6d% %7d% force_spawn %8d% alarm_pct %9d% lock_pct %10d% ipl_11 %11d% value %12d% plate %13h% at %1d% %2d% %3d% angle %4d%

 

 

ipl_11: I still can't figure out what this does, but the word can be set with the 11th field of a text IPL vehicle, so that's the best description I can come up with. Always (except the early SF Maverick which was probably supposed to be locked) 0 for standard vehicles.

 

value: Assumed to be the monetary value of the vehicle; it's always 10,000 for default vehicles, even the export vehicles.

Edited by OrionSR

Share this post


Link to post
Share on other sites
Seemann

 

0396: pause_timer 1

 

pauses current timer (opcode 014E)

0 - resume

1 - pause

 

 

059C: enable_status_text $6705 flashing 0 // global_variable

 

when set to 0, new status text won't flash when appear on screen (1 is by default)

 

 

0890: enable_sound_when_timer $8007 reach 32 seconds // global_variable

 

when a timer with type 1 (descending timer) reach this time, 'dead count' sound will be enabled. 12 seconds is the default value.

 

 

09EE: set_status_text_stay_on_screen 1

 

makes status texts and timers do not disappear when a styled text is shown. Normally, when the game displays a styled text of some kind (for example, 01E3 with style = 5), it hides all status texts. This opcode changes it, so status texts stay on screen anyway.

 

 

Edited by Seemann

Share this post


Link to post
Share on other sites
Seemann

 

0800:  in_two_players_mode

 

returns true if both $PLAYER_CHAR and $SECOND_PLAYER players exist (like in multiplayer missions on PS2 version).

 

corrections:

 

08F7: get_player $PLAYER_CHAR bodypart $2511 textureCRC_to $2542 modelCRC_to $2543

 

stores CRC32 values of texture and model names for specified bodypart (the names are those strings passed in 087B)

 

 

0784: set_player $PLAYER_CHAR textureCRC $2542 modelCRC $2543 bodypart 17

 

same as 087B, bus uses the CRC32 values for texture/model name instead of strings. The values can be obtained with 08F7. If zero is passed, the bodypart leaves without clothes (need to rebuild player with 070D as well).

Edited by Seemann

Share this post


Link to post
Share on other sites
Pixels^

How can I set an actor to run.

Share this post


Link to post
Share on other sites
ceedj

Not the right topic for this.

 

@Seemann: Good GAWD those are great! Thanks muchly!

Share this post


Link to post
Share on other sites
Wesser

Hi,

 

How can I set an actor to run.

The familiar opcode is 05D3 that you can set the actor's run direction and the speed mode (the maximum value to set is 7).

 

05D3=6,AS_actor %1h% goto_3D_coord %2d% %3d% %4d% mode %5h% timelimit %6d%;; versionA05D3: AS_actor [email protected] goto_3D_coord 0.0 0.0 0.0 mode 7 timelimit -2 // versionA 

 

Follow the suggestion of @ceedj. This is the wrong topic to post your problems. Post them in the mission coding section.

 

Bye Bye

user posted image

Share this post


Link to post
Share on other sites
Seemann

 

0A4C:  mouse_not_inverted_vertically

 

returns true, if the mouse does not inverted vertically (Invert Mouse Vertically is off at the Mouse Settings). False if it's inverted.

Share this post


Link to post
Share on other sites
pdescobar

 

corrections:

 

08F7: get_player $PLAYER_CHAR bodypart $2511 textureCRC_to $2542 modelCRC_to $2543

 

stores CRC32 values of texture and model names for specified bodypart (the names are those strings passed in 087B)

 

 

0784: set_player $PLAYER_CHAR textureCRC $2542 modelCRC $2543 bodypart 17

 

same as 087B, bus uses the CRC32 values for texture/model name instead of strings. The values can be obtained with 08F7. If zero is passed, the bodypart leaves without clothes (need to rebuild player with 070D as well).

If I use 087B to set the player's clothes and then follow it with

0793: save_player_shopping_items

the items appear in the wardrobe select menu as if they have been bought.

 

However, if I use 0784 to set the clothes, 0793 doesn't seem to"purchase" the clothing, even if I explicitly rebuild the char first with 070D. Is there an alternate version of 0793 to use or are the two clothes-setting opcodes just slightly different in that way?

Share this post


Link to post
Share on other sites
Seemann

Opcodes 08B7 and 0784 are same, except the fact 0784 gets as parameters CRC values (the integer numbers) directly, and 08B7 gets the string names (but anyway converts them to CRC values). The player structure contains a pointer to another structure (I call it ClothesInfo), where these CRC are stored.

And I see no reason how it can influence on whether there are the clothes in the wardrobe or not, after 0793. 0793 just copies the player's ClothesInfo data to another memory block, while 0794 just reads it back. So, these opcodes are only used as the temporary storage manipulating commands, to save the current player' clothes, and restore it back, if needed. There's nothing to do with wardrobe. It's certainly handled by other opcodes in the Wardrobe|Shops external scripts.

 

 

 

more opcodes to correct:

 

 

0793: save_player_clothes 0794: restore_player_clothes

 

saves/restores player clothes data as described above.

 

 

0760: store_shopping_data_index $9597 textureCRC_to $TEXTURE_CRC

 

stores texture CRC value for specified shopping item (not sure about first parameter yet)

 

 

0761: get_shopping_item_with_textureCRC $TEXTURE_CRC price_to $AMMU_WEAPON_COST0783: get_shopping_item_with_textureCRC $TEXTURE_CRC flag 0 store_to $SHOPPINGITEM_MODELCRC // 0: get modelCRC, 1: get bodypart078C: get_shopping_item_with_textureCRC $TEXTURE_CRC name_to [email protected] // 8-byte string0790: charge_money_for_shopping_item_with_textureCRC $TEXTURE_CRC08C8: set_shopping_item_with_textureCRC $TEXTURE_CRC price_to 300

 

all these opcodes deal with shopping items (weapons, clothes) using texture CRC value (from 0760).

 

 

09A9: get_string "TSHIRTLOCGREY" CRC32_to $10031 // 16-byte strings

 

this opcode used for the shopping items too, it converts any passed string to the CRC32 value.

 

 

Edited by Seemann

Share this post


Link to post
Share on other sites
silvermanblue

Did anybody find the op code that has opposing gangs attacking you're or npc gangs cars.

Share this post


Link to post
Share on other sites
Midnightz

Do these "mutal" related opcodes have any effect on CJ singing when he's idle?

http://www.gtaforums.com/index.php?showtop...0entry4120462

(he never shuts up on PS2 version but he's never sang even once on PC for me)

 

@Seemann, which opcode will actually save (permanently) CJ's current clothes to wardrobe (as if purchased)? It seems only Binco item names will be displayed in the wardrobe at the start of the game.

 

EDIT: I am hoping to add/remove "owned" items at will.

 

Edited by Midnightz

Share this post


Link to post
Share on other sites
ceedj

Nifty trick for this:

 

05BF=3,AS_actor %1d% look_at_actor %2d% timelimit %3d%

 

since this

 

DEFINE_OPCODE(stop_actor_looking, 0x022F, "v");

 

doesn't work in SA. Have a timelimit of -1, then give a wait between 500 and 750. Now do the exact same code, but with a 250-450 timelimit (350 works for me); this is best done in a loop. What happens is the second opcode continues from the "look at" position and will turn back to the start. So why do this if the opcode already HAS a timer? Well, suppose you have a situation where you want your actor to look for an undefined period of time, while the player has to do something. When that something occurs, you can fire off the second iteration of the opcode to make the transition back smoother.

 

It's nothing earth-shattering, but if you are programming any of what I like to call "mini-cutscenes" (the boys ordering from the Cluckin' Bell and the scene right before "Drive By" are examples), moving a head to the direction of another actor goes a long way in masking some of the obvious limitations doing a cutscene through SCM has.

 

EDIT: This also works with the similar look_at_vehicle and look_at_object opcodes.

 

EDIT2: Another trick; I'd ask for a name change, but I don't want to start another war. tounge.gif

 

00DF=1, actor %1d% driving

 

Works for passengers too, so it might be closer to say 00DF=1, actor %1d% in_any_car

Edited by ceedj

Share this post


Link to post
Share on other sites
_VaNkAtA_

Here is an opcodes witch enebles music it zone witch you chosed:

 

 

0917: audio_zone "The zone" enable_sound (parameter 1)

 

 

Example:

 

 

0917: audio_zone "BEACH' " enable_sound 1

 

 

I still didn't test it monocle.gif

Share this post


Link to post
Share on other sites
DeeZire

Hes telling you that the 0917: opcode was already known and was discovered and documented 6 months ago sigh.gif

Share this post


Link to post
Share on other sites
sbaniel

HI ALL!!! A question, how can I find scj in "Main.scm" for modify super cj? turn.gif help me please ! I was reading all file but it is crazy ! can you help me?

Share this post


Link to post
Share on other sites
sbaniel

hi how can i modify the speed flight of super cj?? cryani.gif

Share this post


Link to post
Share on other sites
Midnightz

 

HI ALL!!! A question, how can I find scj in "Main.scm" for modify super cj? turn.gif help me please ! I was reading all file but it is crazy ! can you help me?

 

 

hi how can i modify the speed flight of super cj?? cryani.gif

sbaniel

Do you not realize this topic is for opcode discoveries/descriptions/discussion and not for mods?

Ask the author of the SCJ mod in the actual MOD TOPIC. sigh.gif

Share this post


Link to post
Share on other sites
sbaniel

thanks colgate.gif

Share this post


Link to post
Share on other sites
OrionSR

New - I think: previously unknown

 

09B7: set_zone 'GAN1' disable_footcops TRUE 

 

Clarification: previously Ped Wealth

 

076A: set_zone 'CHC1A' dealer_density_to 4 

 

Repeated clarification: no stars if cops see CJ use the vehicle

 

0A17: set_parked_car_generator $2786 to_player_owned 1

 

Logic conflicts: lose instead of keep so True/False logic works

 

08DD: lose_stuff_after_wasted 0 08DE: lose_stuff_after_busted 0

 

Share this post


Link to post
Share on other sites
OrionSR

 

Clarification: previously Ped Wealth

 

076A: set_zone 'CHC1A' dealer_density_to 4 

 

 

So, 076B should be

 

076B: get_zone [email protected] dealer_density_to [email protected]

?

That would seem like a logical conclusion, but I have not tested opcode 076B. Opcode 076A will put drug dealers in zones which have dealers in the popcycle, and a ped path for them to tread on. The Biker Dealer can be seen fairly consistently in San Fierro zones. I had the Hispanic Dealer in El Que (after rezoning) and Las Venturas, but now I can't get him to appear again.

 

I'm confused on the code below. In my limited test it seems to have the opposite effect as the one intended.

 

07F7: toggle_object $2721 indestructible 1

 

With this setting I can break the wall using a SWAT Van. It seems backwards, but perhaps this is a special case.

 

Did you happen to confirm the GTAIII opcode 021D: set_free_bomb_shop_to 1 for use in San Andreas?

 

Which reminds me: we've got

0331: set_player $PLAYER_CHAR fast_reload 1 // * may cause increasing driveby ammo

as working in San Andreas for rockets and rifles, but on some executables this causes the uzi ammo to increase when fired from a vehicle.

Edited by OrionSR

Share this post


Link to post
Share on other sites
Seemann

 

Did you happen to confirm the GTAIII opcode 021D: set_free_bomb_shop_to 1 for use in San Andreas?

No, this one is unsupported in SA.

Share this post


Link to post
Share on other sites
spaceeinstein
I'm sorry about the way I named the opcodes. Back then I didn't know that 0=off and 1=on. I've never code outside GTA before so I don't know anything about the naming formats. You can recheck/reconfirm/reedit all the opcodes that I posted. 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.

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.