Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!   (86,140 visits to this link)

    2. News

    1. GTA Online

      1. Find Lobbies & Players
      2. Guides & Strategies
      3. Vehicles
      4. Content Creator
      5. Help & Support
    2. Crews

      1. Events
      2. Recruitment
    1. Grand Theft Auto Series

    2. GTA Next

    3. GTA V

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

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA 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 Mods
    9. GTA Vice City

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

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

      1. GTA Advance
      2. GTA 2
      3. GTA
    12. 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

    2. Red Dead Redemption

    3. 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. Forum Support

    2. Site Suggestions

Sign in to follow this  
jackusCTB

[SA] 0818 doesn't work properly with parachute

Recommended Posts

jackusCTB

Hello, writing this little snippet I could observe that the opcode 0818 doesn't return true (1 in the snippet) when the player is freefalling with a parachute.

As you can see, it returns false, 0 in this case.

user posted image

 

{$CLEO .cs}0000: NOPwhile true   wait 0       if        0818:   actor $PLAYER_ACTOR in_air           then            [email protected] = 1           else            [email protected] = 0       end        01E5: show_text_1number_highpriority GXT 'NUMBER' number [email protected] time 1 flag 1  // ~s~You need $~1~ to compete.end

 

Share this post


Link to post
Share on other sites
jackusCTB

-bump-

Share this post


Link to post
Share on other sites
aStiffSausage

Yep. Seems to do so.

 

There could be cheap workarounds for this, for example checking player's current animation played. Though, knowing what your aim is, would help a lot. smile.gif

Share this post


Link to post
Share on other sites
toonskull

hmm... 0818 is a new one on me. Is that in Cleo 4? I never bothered to upgrade, too lazy I suppose.

Edit: My bad 0818 is there had my SB3 set on VC and forgot. tounge2.gif

 

Because I have this;

 

0819: [email protected] = actor $PLAYER_ACTOR distance_from_ground

 

try this;

 

{$CLEO .cs}0000: NOPwhile true  wait 00819: [email protected] = actor $PLAYER_ACTOR distance_from_ground       if       [email protected] > 0.0           then           [email protected] = 1          else           [email protected] = 0      end       01E5: show_text_1number_highpriority GXT 'NUMBER' number [email protected] time 1 flag 1  // ~s~You need $~1~ to compete.end

 

 

I am here to upload my brother's old scripts today. You can find them here open that archive and look for the one called Flying Elvis. That shows how to do a whole skydive routine without the parachute.

 

---addendum---

 

After looking at how the main.scm uses this 0818 opcode, I would have called it;

0818: actor $PLAYER_ACTOR is_airborne or maybe is_falling?

 

Because you have to remember that these "definitions" are made by modders for other modders. They are stored in the Sanny Builder's data files under the SASCM.INI

 

0818: $PLAYER_ACTOR - is how the machine reads this and those additional words are for our benefit. wink.gif I applaud the fact that so many people figured this out so I would not have to do it myself.

 

it first appears in the casino mission "Saint Mark's Bistro" used as a check to see if you are flying to Liberty City and again back to San Andreas. It is used in the parachute mission to set a global variable. Also the global variable "$FreeFall_Stage" has multiple stages of falling. This opcode might be a checking for CJ to be in one of those stages.

Edited by toonskull

Share this post


Link to post
Share on other sites
jackusCTB

Thanks but you know 01E5 can only display integer values, didn't you?

I already tried this work-around but it's not really accurate.

That's the fixed version of your snippet:

 

{$CLEO .cs}0000: NOPwhile truewait 00819: [email protected] = actor $PLAYER_ACTOR distance_from_ground0092: [email protected] = float [email protected] to_integer   if    [email protected] > 1        then        [email protected] = 1       else        [email protected] = 0   end          01E5: show_text_1number_highpriority GXT 'NUMBER' number [email protected] time 1 flag 1end

 

Share this post


Link to post
Share on other sites
toonskull

What?! mercie_blink.gif What exactly are you trying to do here? ???

 

You submitted a script that gives a binary switch for the variable [email protected] to show us that the opcode 0818 is false when CJ is wearing a parachute....

 

I assumed you needed a binary switch, so I tell you not to use that code, but opcode 0819 and show you working code as well. Then complicate the code with a float to integer conversion? WHY? You added an extra line for conversion and another variable for no reason. So I am now scratching my head trying to understand what you are trying to do other than confuse people.

 

 

 

 

Share this post


Link to post
Share on other sites
jackusCTB
Thanks but you know 01E5 can only display integer values, didn't you?

I already tried this work-around but it's not really accurate.

That's the fixed version of your snippet:

 

{$CLEO .cs}0000: NOPwhile truewait 00819: [email protected] = actor $PLAYER_ACTOR distance_from_ground0092: [email protected] = float [email protected] to_integer   if    [email protected] > 1        then        [email protected] = 1       else        [email protected] = 0   end          01E5: show_text_1number_highpriority GXT 'NUMBER' number [email protected] time 1 flag 1end

 

That

Share this post


Link to post
Share on other sites
Wesser

I managed to create some codes to check whether the player is in air even if it is playing an animation (I hope that's the point of your topic):

  • Method 1 (unrecommended, because of third party scripts which may assign an animation to the player while he is in air:

     

    if or   $FREEFALL_STAGE > 00818:  actor $PLAYER_ACTOR in_airthen   // Player is in air.else   // Player isn't in air.end

     

     

  • Method 2 (unrecommended, as it causes a performance loss if compared to the method below):

     

    0A96: [email protected] = actor $PLAYER_ACTOR struct0A8E: [email protected] = [email protected] + 0x46C // CPed.m_uiCheckFlag0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0if08B4:  test [email protected] bit 9 // CHECK_FLAG_IN_AIRthen   goto @in_airendif88B4:  not test [email protected] bit 0 // CHECK_FLAG_IN_VEHICLEthen   0A8E: [email protected] = [email protected] + 0x470   0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0   if and   88B4:  not test [email protected] bit 4   88B4:  not test [email protected] bit 31   then       goto @not_in_air   end:in_air   // Player is in air.else:not_in_air   // Player isn't in air.end

     

     

  • Method 3 (recommended):

     

    // Disable animation playing check.0A8C: write_memory 0x00473CFD size 1 value 0xE9 virtual_protect 00A8C: write_memory 0x00473CFE size 4 value 0x00000238 virtual_protect 0if0818:  actor $PLAYER_ACTOR in_airthen   // Player is in air.else   // Player isn't in air.end// Enable animation playing check.0A8C: write_memory 0x00473CFD size 1 value 0x8B virtual_protect 00A8C: write_memory 0x00473CFE size 4 value 0x00047C87 virtual_protect 0

     

Share this post


Link to post
Share on other sites
jackusCTB

Thanks Wesser, accurate as always.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

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