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

      1. St Andrews Cathedral
    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. 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

-ATP-

Anybody knows what things this opcode checks?

 

 

88B4:   not test $390 bit 1 

 

Edited by -ATP-

Share this post


Link to post
Share on other sites
OrionSR

 

88B4:   not test $390 bit 1 

 

 

This opcode will evaluate the specified variable and return the value of TRUE if the 2nd bit is NOT equal to 1.

 

Binary number: 11111111111111111111111111111101, the 2nd bit is NOT 1 -- so the statement is true.

 

Very few routines in San Andreas use bitmask flags. They are used (almost) exclusively by the various dating routines. Global variable $390 is used in the flow control of the dates. $390 bit 1 flags that the GF_Date routine is active -- CJ is on a date.

 

So, as used in the standard script:

 

88B4:if   not test $390 bit 1 jf @POOL_439 0209: [email protected] = random_int_in_ranges 0 2 

 

 

Means that: If CJ is not on a date (if he is then jump to the label @POOL_$439) then set [email protected] to a random number between 0 and 2 and continue.

 

Share this post


Link to post
Share on other sites
Wesser

The meaning of 020D is inverted. It should be:

 

020d=1,  car %1d% unflipped

 

It probably returns true whether a wheel touches the ground. wink.gif

Share this post


Link to post
Share on other sites
Silent
It probably returns true whether a wheel touches the ground. wink.gif

I doubt it, as 09D0 already exist tounge.gif

 

But yeah, 'flipped' opcode returns true when the car is upside down (both in air and on ground), so it may be a inversion of this opcode (...both in air and on ground). Deji will surely update it in v2.

Share this post


Link to post
Share on other sites
ZAZ

 

It probably returns true whether a wheel touches the ground. wink.gif

I doubt it, as 09D0 already exist tounge.gif

 

But yeah, 'flipped' opcode returns true when the car is upside down (both in air and on ground), so it may be a inversion of this opcode (...both in air and on ground). Deji will surely update it in v2.

to make it complete

 

if and01F4:   car [email protected] flipped// --- works like described81F3:   NOT   car [email protected] airborne//--- opposite of 89D0:jf @Flipsub

 

 

 

Edited by ZAZ

Share this post


Link to post
Share on other sites
DK22Pac

I don't know, does anyone else know it, but...

 

016F: create_shadow_type 3 rotation [email protected] size 2.0 intensity 255 RGB 255 0 0 at [email protected] [email protected] [email protected]

 

The second param is an angle in radians.

To convert degrees to radians:

 

0174: [email protected] = car [email protected] Z_anglediv([email protected], 57.2957795) //degrees to radians

 

Share this post


Link to post
Share on other sites
ZAZ

016F: create_particle 1 makes shadow on the ground

Edited by ZAZ

Share this post


Link to post
Share on other sites
DK22Pac

@ZAZ

I do not need help on it. I just noticed that "rotation factor" means angle in radians.

Part of my code, attaching tailight to vehicle:

 

0407: store_coords_to [email protected] [email protected] [email protected] from_car [email protected] with_offset 0.0 [email protected] [email protected]                  // PATCH CSHADOW_RENDER                                                                0A8C: write_memory 0x7079FA size 4 value DistanceToGround virtual_protect true         0A8C: write_memory 0x707A1F size 4 value TextureAdress virtual_protect true            0174: [email protected] = car [email protected] Z_angle                                                              div([email protected], 57.2957795) // DEGREE TO RADIAN                                                050A: [email protected] = distance_between_XYZ [email protected] [email protected] [email protected] and_XYZ [email protected] [email protected] [email protected]                          0087: [email protected] = [email protected]                                                                         0063: [email protected] -= [email protected]                                                                       006B: [email protected] *= RedLimit                                                                  0073: [email protected] /= [email protected]                                                                        0092: [email protected] = float [email protected] to_integer                                                       if                                                                                        [email protected] == true                                                                        then                                                                                      016F: create_shadow_type 3 rot [email protected] size SizeForBike Intensity [email protected] 0 0 at [email protected] [email protected] [email protected]                                                                                      016F: create_shadow_type 3 rot [email protected] size SizeForCar Intensity [email protected] 0 0 at [email protected] [email protected] [email protected] end                                                                                    // DEFAULT                                                                             0A8C: write_memory 0x7079FA size 4 value DefaultDistanceToGround virtual_protect true  0A8C: write_memory 0x707A1F size 4 value DefaultTextureAdress virtual_protect true     

 

Share this post


Link to post
Share on other sites
ZAZ

 

@ZAZ

I do not need help on it. I just noticed that "rotation factor" means angle in radians.

Part of my code, attaching tailight to vehicle:

 

0407: store_coords_to [email protected] [email protected] [email protected] from_car [email protected] with_offset 0.0 [email protected] [email protected]                  // PATCH CSHADOW_RENDER                                                                0A8C: write_memory 0x7079FA size 4 value DistanceToGround virtual_protect true         0A8C: write_memory 0x707A1F size 4 value TextureAdress virtual_protect true            0174: [email protected] = car [email protected] Z_angle                                                              div([email protected], 57.2957795) // DEGREE TO RADIAN                                                050A: [email protected] = distance_between_XYZ [email protected] [email protected] [email protected] and_XYZ [email protected] [email protected] [email protected]                          0087: [email protected] = [email protected]                                                                         0063: [email protected] -= [email protected]                                                                       006B: [email protected] *= RedLimit                                                                  0073: [email protected] /= [email protected]                                                                        0092: [email protected] = float [email protected] to_integer                                                       if                                                                                        [email protected] == true                                                                        then                                                                                      016F: create_shadow_type 3 rot [email protected] size SizeForBike Intensity [email protected] 0 0 at [email protected] [email protected] [email protected]                                                                                      016F: create_shadow_type 3 rot [email protected] size SizeForCar Intensity [email protected] 0 0 at [email protected] [email protected] [email protected] end                                                                                    // DEFAULT                                                                             0A8C: write_memory 0x7079FA size 4 value DefaultDistanceToGround virtual_protect true  0A8C: write_memory 0x707A1F size 4 value DefaultTextureAdress virtual_protect true     

 

ups, was confused, i tried something with

0174: [email protected] = car [email protected] Z_angle

div([email protected], 57.2957795) // DEGREE TO RADIAN

but got only weired values

 

I would like to see what you mean but your script snippet have to much unknown variables

Share this post


Link to post
Share on other sites
DK22Pac

@ZAZ

Try this, must work.

 

{$CLEO .cs}0000:while true   if       player.Defined(0)   then       if           actor.Driving($player_actor)       then           0811: [email protected] = actor $player_actor car_nosave           0407: store_coords_to [email protected] [email protected] [email protected] from_car [email protected] with_offset 0.0 -3.0 0.0           // change offset_ShadExp to offset_Handman           0A8C: write_memory 0x707A1F size 4 value 0xC40404 virtual_protect true           0174: [email protected] = car [email protected] Z_angle           div([email protected], 57.2957795)           016F: create_shadow_type 3 rotation [email protected] size 1.0 255 0 255 0 at [email protected] [email protected] [email protected]       end   end   003D:end

 

Share this post


Link to post
Share on other sites
ZAZ

 

@ZAZ

Try this, must work.

 

{$CLEO .cs}0000:while true   if       player.Defined(0)   then       if           actor.Driving($player_actor)       then           0811: [email protected] = actor $player_actor car_nosave           0407: store_coords_to [email protected] [email protected] [email protected] from_car [email protected] with_offset 0.0 -3.0 0.0           // change offset_ShadExp to offset_Handman           0A8C: write_memory 0x707A1F size 4 value 0xC40404 virtual_protect true           0174: [email protected] = car [email protected] Z_angle           div([email protected], 57.2957795)           016F: create_shadow_type 3 rotation [email protected] size 1.0 255 0 255 0 at [email protected] [email protected] [email protected]       end   end   003D:end

 

amazing cookie.gifcookie.gifcookie.gif which file contains the handman?

Share this post


Link to post
Share on other sites
Wesser

It's the particle.txd file. This may be fix the lag with no other glitches (I believe).

Share this post


Link to post
Share on other sites
DK22Pac

@Wesser

I used your code for making tailight)

user posted image

user posted image

Works fine, but sometimes camera is "jigging" (like when you are stand at car and start run to it).

Edit: OK. Maybe it caused because of other scripts which manipalated camera.

Edited by DK22Pac

Share this post


Link to post
Share on other sites
radioman
@Wesser

I used your code for making tailight)

user posted image

user posted image

Works fine, but sometimes camera is "jigging" (like when you are stand at car and start run to it).

Edit: OK. Maybe it caused because of other scripts which manipalated camera.

Uh, just a friendly heads up, but this is the wrong section-we have a seperate section for IV modding(this one is for III modding ONLY). You posted screenshots of IV, which means it needs to be in the IV Modding section.....

Share this post


Link to post
Share on other sites
Silent

Haha, it's SA mod xP

Share this post


Link to post
Share on other sites
fireguy109

 

Haha, it's SA mod xP

user posted image

 

I would never have guessed, that's fr*cking amazing.

 

EDIT that gif sucks on this skin tounge.gif

Share this post


Link to post
Share on other sites
fastman92

Part of opcode 823:

 

    case 0x823:     CScriptThread__getNumberParams((CScriptThread *)a2, 4u);     v167 = PedPool;     v165 = (int)CPool_CPed___atHandle(PedPool, opcodeParameters[0]);     v166 = (int)CPool_CPed___atHandle(v167, opcodeParameters[1]);     v207 = opcodeParameters[2];     v164 = CTask__operator new(120);     v216 = v164;     v247 = 7;     if ( v164 )     {       LODWORD(v212.x) = 0;       LODWORD(v212.y) = 0;       LODWORD(v212.z) = 0;       v168 = CTask_87078C__constructor(                (void *)v164,                "COMMAND_TASK_GREET_PARTNER",                v166,                1,                v207,                opcodeParameters[3],                0,                0,                0);

 

Look at COMMAND_TASK_GREET_PARTNER

There is GTA IV native: http://www.gtamodding.com/index.php?title=TASK_GREET_PARTNER

TASK_GREET_PARTNER

Share this post


Link to post
Share on other sites
Midnightz

The behavior of opcode:

 

 

83D9:   not save_done

 

 

...is such that it checks if the player has exited the save menu (after saving or cancelling regardless).

 

Is there a method/opcode/hack to check if the game was actually saved or just canceled - to determine which?

 

Thanks,

-Midnightz

 

Share this post


Link to post
Share on other sites
ZAZ
The behavior of opcode:

 

 

83D9:   not save_done

 

 

...is such that it checks if the player has exited the save menu (after saving or cancelling regardless).

 

Is there a method/opcode/hack to check if the game was actually saved or just canceled - to determine which?

 

Thanks,

-Midnightz

i assume it checks only for one time, like this meaning: "if user ever made a save"

i don't know any way to check if a save was done again but the save script of origin main.scm make the player first frozen which can be checked

Share this post


Link to post
Share on other sites
fastman92

 

The behavior of opcode:

 

 

83D9:   not save_done

 

 

...is such that it checks if the player has exited the save menu (after saving or cancelling regardless).

 

Is there a method/opcode/hack to check if the game was actually saved or just canceled - to determine which?

 

Thanks,

-Midnightz

i assume it checks only for one time, like this meaning: "if user ever made a save"

i don't know any way to check if a save was done again but the save script of origin main.scm make the player first frozen which can be checked

It returns true always when user came back from Menu >> Save game, because it`s really set up by 03D8 opcode.

03D8 - set menu.isSaveDone, pause game, go to "save game" menu

03D9 - should happen when the game is resumed, user came back from "save game" menu. It doesn`t determine whether user made a save, but whether 03D8: show_save_screen was executed currently.

The game automatically resets menu.isSaveDone to 0 after the first processing SCM scripts.

 

 

    case 0x3D8:     if ( getPlayerPed(-1) )     {       v132 = getPlayerPed(-1)->PedFlags.Flags1;       if ( !(BYTE1(v132) & 1) )       {         menu.isSaveDone = 1;         v133 = (CPhysical *)getPlayerPed(-1);         CPhysical__setSpeed(v133, 0.0, 0.0, 0.0);         v134 = getPlayerPed(-1);         sub_45AFB0(v134, 0, 0, 0);       }     }     return 0;   case 0x3D9:     if ( menu.bIsActive || (v151 = 1, menu.isSaveDone) )       v151 = 0;     CScriptThread__setCondResult(a2, v151);     return 0;

 

Share this post


Link to post
Share on other sites
Waltzing Mouse

Technically converting degrees to radians is (x*pi)/180 but 180/pi is ~57.29 so you can use that to some extent, though in pure mathematics the result is incorrect after a certain number of decimal places.

Share this post


Link to post
Share on other sites
Midnightz

Thanks for the replies and help guys. smile.gif

 

fastman92, if I'm reading that code right, it's just checking if the game reset 03D8 to 0, correct?

 

I'm not trying to intercept the original script to determine if the save menu was opened. I need some way of checking if an actual save was made or if the player canceled from the save menu.

 

Why: I've written a code similar to the original for a new savepoint. My code advances time 6 hours, the same as any other save works. The problem is that I have no way of determining if a save was made or saving was canceled and my code, without that type of check, advances time for both scenarios.

 

 

EDIT: I guess a better way to put it is this... How can I determine what the player selected in the save menu? A Save Slot OR Cancel.

Edited by Midnightz

Share this post


Link to post
Share on other sites
fastman92

I have no time for this. It is possible when you patch some menu routine.

Share this post


Link to post
Share on other sites
DK22Pac

 

03ED: set_car [email protected] enable_taxi_light true

 

Isn't it?

Edited by DK22Pac

Share this post


Link to post
Share on other sites
Deji

If yeh wanna check if the game has been saved, you could compare the save path: 0xC15F60

Or the save file handle: 0xC16EF0

Share this post


Link to post
Share on other sites
stanesicmario

Hi I need help I am new in the gta sa multiplayer and I had buy the server but i need the scripter-peoples to work for me but it need to wright on the croatian languages??? Is anyone here the scripter who can help me please ???? And yess of course I will pay you with paypal ...thx to all for scripting mods smile.gifwink.gif

Share this post


Link to post
Share on other sites
Adler
Hi I need help I am new in the gta sa multiplayer and I had buy the server but i need the scripter-peoples to work for me but it need to wright on the croatian languages??? Is anyone here the scripter who can help me please ???? And yess of course I will pay you with paypal ...thx to all for scripting mods smile.gifwink.gif

You're in the wrong topic, and it'd be best not to ask for help without first showing proof of progress so people would be inclined to help you.

 

And payment, I'm sure, isn't enough to entice people to help you out as most modders are intrinsically motivated to create mods, and adding money as a factor in this only complicates matters.

Share this post


Link to post
Share on other sites
thelink2012

Opcode 0876 created birds, but it is written a bit wrong internally, oh R* programmers...

 

user posted image

Ignore the bird color in red tounge.gif

 

 

0876: create_birds_at 0 0 0 destination 0 0 0 birds_count 3 bird_type 0

 

 

 

04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 3.0 2.0008C: [email protected] = float_to_integer [email protected]: [email protected] = float_to_integer [email protected]: [email protected] = float_to_integer [email protected]: create_birds_at [email protected] [email protected] [email protected] destination -2630 1411 28 birds_count 3 bird_type 0

 

 

The opcode expects integers instead of floats in the coordinates params, If you see in main.scm the opcode send floats as coordinates and then the bird will be spawned in some crazy place (and then removed since it's too far from the camera).

 

Destination only serves to describe the bird angle...

 

 

EDIT: I was wrong about topic title ok, Topic title shouldn't change whatsthat.gif

Edited by Link2012

Share this post


Link to post
Share on other sites
Deji

Haha. Fun find (I'm sure this was supposed to be in the SA opcode topic, though tounge2.gif). I actually thought it was to block birds in a specified area, but had doubts due to the integer params and thought it might block more than one thing. Never bothered to actually test it, though. Just theorized a lot tounge.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.

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.