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

    1. GTANet.com

    1. GTA Online

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

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

    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. Grand Theft Auto Series

    2. GTA VI

      1. St. Andrews Cathedral
    3. GTA V

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

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

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

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

      1. Guides & Strategies
      2. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. 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. Design Your Own Mission
      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. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

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

    1. Announcements

    2. Support

    3. Suggestions

Opius

GTA:SA Opcodes

Recommended Posts

ceedj

This one is semi known, but not really documented...

 

0159: set_camera_on_ped $Actor, flag 1, flag 2

 

Flag 1:

0 - Locks camera 45 degrees to right, player control as if still straight (With flag 2 set to 2, just locks camera)

1,2 - Flys the camera in a far away land. wow.gif

3 - Locks camera, removes player

4 - Locks camera slightly behind player

5 - See 1

6 - See 1

7 - Puts camera on ped, overly close

8 - Puts camera into Rocketlauncher view

9-13 - See 1

14 - Puts camera on ped, camera tilts slowly back and forth at a 45 degree angle.

15 - Puts camera on ped, moves when ped moves, relative to placement

16 - Locks camera, removes player

17 - Crashes game

18 - Locks camera

19 - See 1

20 - See 1

21 - See 1

22 - Locks the camera

23-28 - See 1

29 - Wasted cam; travels up

30 - See 1

31 - See 1

32 - Busted cam, text (does not erase; needs another opcode to clear the text)

33 - Locks camera

34 - Puts camera into Rifle mode

35 - Puts camera on ped, moves as ped moves, very cinematic

36 - See 1

37 - See 1

38 - See 1

39 - Camera on ped, 1st person, very glitchy.

40 - See 8

41 - See 39, camera slightly rotated

42 - See 34

43 - See 39

44 - See 1, but different area/angle

45 - See 34

46 - See 7

47 - Crashes game

48 - Crashes game

49 - Locks camera and puts a small, spinning orange recticle on the center of the screen (an older version perhaps?)

50 - Crashes game

51 - Puts camera into Heatseeking Rocketlauncher view

52 - See 8

53-65 - Locks camera

66-80 - See 44

90,100 - See 44

 

Flag 2:

1 - "Flies" camera to ped

2 - Puts camera on ped immediately

Share this post


Link to post
Share on other sites
Bigun

^Mmm, nice! Thanks for these, can come quite in handy. smile.gif

Share this post


Link to post
Share on other sites
bond_007

Is there is a script for making trains goes on both rails(tracks)?

Please,if any one know some scripts for that please tell me about it?

Some one told me I can do it from "SA.exe",other one told that I can do it from "main.scm"

 

Share this post


Link to post
Share on other sites
Demarest
This is a pinned dedicated thread. Please don't dilute it for something you've already made a topic for. Especially when it's already been answered.

Share this post


Link to post
Share on other sites
K-Dawgg007
Are you properly loading the model that you're trying to change your character to before changing him?

dozingoff.gif No, I just stuck the code in the beginning on the "init1" mission. Alright, I'll try that.

Share this post


Link to post
Share on other sites
BBumper
06E1:

 

--P4--

 

(25) - Vehicle follows player and stops

(50) - Vehicle appears to drive around aimlessly on the nearst vehicle path

 

--Previously Discovered---

 

When I left my vehicle the AI Car didnt follow me instead it stuck by the target vehicle also if the target vehicle is out of range the AI Car it wil act a little loopy as its trying to re-acquire the target.

 

(29) - Vehicle maintains left position of target vehicle

(30) - Vehicle maintains rigt position of target vehicle

(31),- Vehicle maintains back position of target vehicle

(32) - Vehicle maintains front position of target vehicle

(52) & (53) - Vehicle follows target vehicle but not the player

(64) - Vehicle drive around aimlessly

 

Anything above 68 does not work on the vehicle I tested

These codes seem to have different effects if the vehicle is moving or just spawned. If the car is moving with 10 the vehicle will go in reverse and with 50 the driver will exit the vehicle and stand still but if the vehicle just spawned 10 will have no effect and 50 will make the vehicle drive around randomly.

Share this post


Link to post
Share on other sites
bond_007

hi,

I have just receve this text it is about san andreas trains:

" The main problem is that the first track is only for random trains and another only for scripted trains. Try to use scripts. I have been learning scripting for 2 years. I started from the Vice City. It is not a one day process, you know... You need some knowleage about it. Maybe in future I will write an article about using train opcodes in scripting."

 

 

what is train opcodes?and,How can I edit it?

Share this post


Link to post
Share on other sites
Demarest
This is a pinned dedicated thread. Please don't dilute it for...

...learning how to SCM. We have the entire forum for that. For that last time: trains already use both tracks! Load up an SA save where LV's already unlocked and save at the Doherty garage like you want to play the Freight mission. Keep reloading and you'll find trains approach the station across the street from both directions. Furthermore, there are places along the track where there is only one track.

 

If you're not willing to learn to SCM, that's understandable; it's not for anybody. But this is a pinned thread with a specific role and it loses its value when we allow such repeated off-topicness to take place in it. Thank you.

Share this post


Link to post
Share on other sites
bond_007

Hi Demarest,

 

"trains already use both tracks! Load up an SA save where LV's already unlocked and save at the Doherty garage like you want to play the Freight mission. Keep reloading and you'll find trains approach the station across the street from both directions. Furthermore, there are places along the track where there is only one track"

 

what do u mean the above?

 

also,what dou mean by "Keep reloading and you'll find trains approach the station across the street from both directions"

Share this post


Link to post
Share on other sites
5kedone

lol @ demarest don't dilute the thread i just had to put up with a 2 page essay to get to any info when a simple pm or 1 post would have done

 

p.s im not having a go just had to be said and before u start no i have made no contribution to the scene but that is coz i could not keep up with u guys any way i have a family a job and i am on a few training course

Share this post


Link to post
Share on other sites
Seemann

 

09D4: suspend_wanted_level

 

 

The wanted level cleared and the stars flashed like after respray done. Maybe there's more correct name for that, don't know.

 

edit:

Y_Less; well, let it be so.

Edited by Seemann

Share this post


Link to post
Share on other sites
Y_Less

Demarest found a similar OpCode to test if they were like that and called it is_wanted_level_suspended, it may be better to keep the convention for ease sake and call it something like suspend_wanted_level.

 

And thank you, I had hoped this code existed for a LONG time!

Share this post


Link to post
Share on other sites
Seemann

 

0A0F:   is_new_language_set

 

 

Returns true if you set a new language via menu.

In original game it's used commonly to change the panel texts that were already shown.

 

 

 

09FA:   is_menu_closed

 

 

returns true if player has closed the menu and returned to the game.

 

Edited by Seemann

Share this post


Link to post
Share on other sites
Seemann

 

0A29:  player $PLAYER_CHAR climbing

 

 

Returns true while player is climbing onto/over a wall, fence or similar. Never used in original game.

 

 

0A14: disable_respray_garages 1

 

 

Disable all respray garages in game. Used in Driver School to prevent the car repairing.

 

 

0A1B:   actor [email protected] touched_by_actor $PLAYER_ACTOR

 

 

Returns true if actor has been touched by another actor (also work when the second actor is driving, so touch him with car).

 

 

0A06:   train [email protected] next_station_unlocked

 

 

Returns true if the next station for the train is unlocked, ie. is present in the city which is available for the player (in accordance with stat 181). Used to prevent a train teleporting in the unavailable cities.

 

Edited by Seemann

Share this post


Link to post
Share on other sites
PARADOXON

colgate.gif Hello all...

 

nervous.gif I need a script for MINIGUN_BASE to set on my own position and i want to use this. Please help me. THANX

suicidal.gif I found a script on ZERO - Mission and when i set the minigun, my game will crashed!!!

Share this post


Link to post
Share on other sites
BBumper
colgate.gif Hello all...

 

nervous.gif I need a script for MINIGUN_BASE to set on my own position and i want to use this. Please help me. THANX

suicidal.gif I found a script on ZERO - Mission and when i set the minigun, my game will crashed!!!

Your post doesn't belong in here please make your own topic.

 

Thank You.

Share this post


Link to post
Share on other sites
Seemann

 

0488:  model %1o% exists

 

Returns true if such model id is defined in the IDE files and could be loaded

(you can check it with the models list appearing in Sanny Builder).

 

For example, in San Andreas

 

0488:   model 1 exists

 

works, but

 

0488:   model 2 exists

 

don't.

Negative ids don't work too. Also works in Vice City.

 

 

 

04C1: remove_references_to_roadblocks

 

The roadblocks won't be recreated and will be removed when player goes away from them.

 

Btw, the limit for the roadblocks created by 04C0 is 16.

 

Edited by Seemann

Share this post


Link to post
Share on other sites
Seemann

 

0904=5,store_color %1h% rgb_values %2d% %3d% %4d% and_alpha %5d%

 

 

returns RGB and alpha values for some of pre-defined colors

 

Colors:

 

0 - red

1 - green

2 - blue

3 - aqua

4 - white

5 - black

6 - gold

7 - violet

8 - silver

9 - maroon

10 - dark green

11 - light yellow

12 - gray

13 - dark blue

14 - yellow

Opcode 0904 was found by me, but named not correctly enough. It stores RGBA values of the interface element specified with the first parameter.

 

Parameter 1 is from 0 to 14.

 

0 - health bar

1 - hud money color

2 - unknown

3 - SA style font color (all texts using fonts.txd, including wanted stars and breath meter)

4 - GTA3 style fonts (hud time, text_box msgs, armour bar)

5 - fonts background (it seems only to be used with the menu headers like 'Pause menu', 'Stats')

6 - menu Map coord lines (when moving mouse)

7-14 unknown

 

so the name should be

 

 

0904: get_interface_element 6 color_RGBA_to [email protected] [email protected] [email protected] [email protected]

 

 

Share this post


Link to post
Share on other sites
ceedj
For example, in San Andreas

 

0488:   model 1 exists

 

works, but

 

0488:   model 2 exists

 

don't.

Negative ids don't work too. Also works in Vice City.

Just curious, is this just for defualt.ide entries, or would map entires work as well? For example, my greenscreen object has an ID of 4800. This could be really handy for checking specific map-mods via the scm.

 

And thanks for your work on these. Great job. smile.gif

Share this post


Link to post
Share on other sites
Seemann

ceedj; should work for any model.

Share this post


Link to post
Share on other sites
Seemann

These opcodes were unknown from GTA III and should work in all 3d games: III, VC, SA.

 

I tested it in SA.

 

 

018F:   car [email protected] flipped_for_2_seconds0190: add_car [email protected] to_flipped_check0191: remove_car [email protected] from_flipped_check

 

 

 

0190 adds a car handle to the pool that can store up to 6 handles. Then a game every ms checks if the car was flipped and counts the time that passed from the moment it flipped.

 

018F returns true if the car flipped for more than 2 seconds. It means that the car surely can not be driven anymore and be exploded soon.

 

In original game (VC, SA) this opcode is used mostly in the chases to check if the car flipped and make the driver exit it ("Psycho Driver", "Two Bit Hit" in VC) or restore the car (its handle still could be used even the car exploded).

 

0191 removes the car handle from flipped check pool.

 

 

Any thoughts how to name these opcodes more correctly?

 

Share this post


Link to post
Share on other sites
Seemann

 

0414: toggle_player $PLAYER_CHAR free_treatment_once 1

 

Player will not pay for the treatment if he wasted and his weapon won't be removed. Worked only once.

Edited by Seemann

Share this post


Link to post
Share on other sites
Y_Less

Could you toggle it off after they're wasted then toggle it on again to get the effects again?

Share this post


Link to post
Share on other sites
Seemann

 

Could you toggle it off after they're wasted then toggle it on again to get the effects again?

yes. when you are in the hospital, the free treatment flag is zeroed, so to get an effect next time you have to use 0414 once more.

Share this post


Link to post
Share on other sites
Seemann

 

072C: generate_police_bikes 0

 

Toggle generation of the police on the bikes.

Share this post


Link to post
Share on other sites
AleX AciD

 

0937 - draw_box_with_title, leftX, topY, rightX, bottomY, gxt_name, unknown (style?)

 

Draws shaded box with given title.

examples (from sources generated by SADisAsm):

 

0937 53.0, 130.0, 597.0, 410.0, "RACES_0", 3  ; "Races"0937 152.0, 240.0, 490.0, 400.0, "BOAT_75", 3  ; "Results"

 

user posted image user posted image

 

 

07fc - text_draw_time, X, Y, gxt_name, fTime, unknown

 

Draws text with time (used only in BOAT).

imho, integral part of fTime is "printed over" first '~1~' , and fraction over second '~1~' dozingoff.gif

examples:

 

07fc 180.0, 295.0, "BOAT_9", lf0f0, 2  ; "Damage Penalty:"07fc 390.0, 295.0, "BOAT_77", lf0f0, 2  ; "~1~:~1~s"

 

(shown on screenshot above)

Share this post


Link to post
Share on other sites
Seemann

 

088E: set_next_day08CA: reset_zones_info08A3: update_respect_while_on_mission 10844=1,  string %1d% empty // same as 08460845=1,  string %1d% empty // same as 08470846=1,  string %1d% empty // same as 08440847=1,  string %1d% empty // same as 08450970: teleport_in_override_restart // 016Eh - found by Capushon

 

 

ps. I've nearly finished updating Sanny's SASCM.INI with tons of new opcodes and descriptions (most of them I posted already earlier).

 

 

EDIT:

 

08D0:   cutscene_skipped

 

 

returns true if player press [space], [shift], or [enter] to skip annoying mission brief.

 

EDIT:

 

08EA=1,unknown_toggle_gang_traffic %1h%

 

 

It looks like a toggle of the gang car traffic or something related with gang generation. Please, confirm it.

Edited by Seemann

Share this post


Link to post
Share on other sites
Seemann

Fresh updates:

 

 

0960: toggle_player $PLAYER_CHAR stats_box 1

 

enable/disable stat box called by Tab

 

0980: extinguish_all_fires_at -973.759 1077.152 1350.399 radius 200.0

 

 

0989: set_text_box_width 600

 

set text boxes width, 200 by default.

 

099D:  night_vision_enabled

 

 

09A8:   actor [email protected] headshoted

 

Also,

 

 

0974: unknown_emulate_wasted

 

Strange opcode, it used only once in "The Meat Business" mission and make actions very similar to those happened when you wasted/busted: it increase time by 12 hours and clear player weapons.

Any ideas?

Edited by Seemann

Share this post


Link to post
Share on other sites
Seemann

agrrh... It deserves new post.

Look what I found: a strings concatenation! I was always thinking that this impossible through common opcodes, but no.

 

 

098B=3,%3h% = %1h% + %2h% // all string variables098C=3,%3h% = %1h% + %2h% // all string variables

 

 

(note, I swapped parameters order, but as it was never used in original scripts, I think it won't cause any problems)

 

So,

 

 

v$str1 = "string3"v$str2 = "string4"098B: v$newstring = v$str1 + v$str2 // all string variables

 

 

it stores to the variable v$newstring line: string3string4.

 

- New string can contain up to 15 chars (16 bytes) otherwise game crashes.

- Both opcodes are same.

- Shortstrings (8 bytes) are allowed too.

Edited by Seemann

Share this post


Link to post
Share on other sites
Bigun

These are some nifty opcodes! Thanks!

The emulate_wasted opcode is...just that. What else can it be?

It's probably in that part if CJ gets trapped in the freezer, you get insta-killed.

Does that opcode automatically transport you to a hospital too?

Edited by Bigun

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.