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. Los Santos Summer Special
      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

Sign in to follow this  
Markk

Checking Handling?

Recommended Posts

Adler

-.-

 

 

And you should copy this in .fxt-file:

 

 

SPEED ~1~SPEED1 MPH:

 

Do what he ^ said.

 

 

CLEO4

 

0ADF: add_dynamic_GXT_entry "SPEED" text "~1~"0ADF: add_dynamic_GXT_entry "SPEED1" text "MPH:"

 

 

or what he ^ said.

Share this post


Link to post
Share on other sites
Markk

SPEED ~1~

SPEED1 MPH:

 

Crashes when I get inside any car.

 

Second code is for CLEO 4, not 3. Thus, when compiling I get an error saying unknown opcode.

Share this post


Link to post
Share on other sites
Adler

In fireguy's script, replace $2 (AKA $PLAYER_CHAR) with a different global var. Check Sanny Builder 3/data/sa/CustomVariables.ini to find one that you can use with minimal interference as to its usage in the original main.scm.

Share this post


Link to post
Share on other sites
Markk

Uhm... what? In case you didn't read way back I have absolutely no knowledge of CLEO scripting.

Share this post


Link to post
Share on other sites
Adler

Yeah sorry I didn't read the first few posts since I got a lot on my mind. Just to clarify: you want the time it takes for your car to get from 0 to 60 mph, correct?

 

EDIT

 

Re-read the first post and it seems like you want the car speed from 0 to 60 sec. Misunderstood lol.

 

... wait some of your other posts seem to say something else. I don't understand this! blush.gif

 

ANOTHER EDIT

 

Yeah I wrote a script for 0 to 60 mph but I didn't know if that's what you wanted or not... plus I don't know if the units are right. I based it off another speedometer mod so I'm trusting it for accuracy.

Edited by Adler

Share this post


Link to post
Share on other sites
Markk

I just want a script that measure how long it takes (in seconds) for the vehicle my character is in to get from 0 mph to 60 mph. The speedometer isn't needed but would be a great bonus.

 

I'm apologize for any confusion. I hope this post has made my request clear. Thanks.

Share this post


Link to post
Share on other sites
fireguy109

*sigh* [email protected] is the player's car. $1 is the speed. $2 is the time.

 

// This file was decompiled using scm.ini published by GtaForums.com on 25.11.05{$VERSION 1.1.0000}{$CLEO .cs}//-------------MAIN---------------03A4: name_thread 'SPEED' :SPEED_100001: wait 50 ms 00D6: if 0256:   player $PLAYER_CHAR defined 004D: jump_if_false @SPEED_10 00D6: if 00DF:   actor $PLAYER_ACTOR driving004D: jump_if_false @SPEED_100 03C1: [email protected] = player $PLAYER_CHAR car 02E3: $1 = car [email protected] speed 0011: $1 *= 1.8125 // floating-point values  0002: jump @SPEED_1000 :SPEED_11008C: $1 = float_to_integer $1 03C4: set_status_text $1 type 0 GXT 'SPEED'  // ~1~ <----- This is why you need to add it to the GXT file!008D: $1 = integer_to_float $1 0002: jump @SPEED_10:SPEED_1000151: remove_status_text $1 0002: jump @SPEED_10 :SPEED_100000D6: if and0042:   $1 == 0 // float values 00E1:   player 0 pressed_key 19 // sub-mission key004D: jump_if_false @SPEED_11 0005: $2 = 0 // float values:SPEED_10010001: wait 0 ms00D6: if and0256:   player $PLAYER_CHAR defined 00DF:   actor $PLAYER_ACTOR driving 004D: jump_if_false @SPEED_1000001: wait 0 ms // this is when you floor it!00D6: if0020:   $1 > 0 // floating-point values 004D: jump_if_false @SPEED_1001 014E: set_timer_to $2 type 0:SPEED_100000001: wait 0 ms00D6: if and0256:   player $PLAYER_CHAR defined 00DF:   actor $PLAYER_ACTOR driving004D: jump_if_false @SPEED_10000D6: if0042:   $1 == 60.0 // float values 004D: jump_if_false @SPEED_10000014F: stop_timer $203C4: set_status_text $2 type 0 GXT 'SPEED'  // this is your 0-60 time <----- you need speed in the gxt file!0001: wait 10000 ms // wait 10 seconds0151: remove_status_text $2 0002: jump @SPEED_10

 

You NEED to have "SPEED" in the gxt file for this script. If you absolutely cannot add it, replace the lines with the arrows next to them with something else.

Edited by fireguy109

Share this post


Link to post
Share on other sites
Adler

Here's the script that I wrote yesterday (it's been tested and it's working):

 

 

{$CLEO .cs}const   PLAYER_CAR = [email protected]   CAR_SPEED  = [email protected]::Startwhile true   wait 250   if        Actor.Driving($PLAYER_ACTOR)   then       03C0: PLAYER_CAR = actor $PLAYER_ACTOR car       break   endend:Timerwhile true   wait 0   if and       01C1:   car PLAYER_CAR stopped       00E1:   player 0 pressed_key 19   then       [email protected] = 0       repeat           wait 0           if               Actor.Driving($PLAYER_ACTOR)           then               02E3: CAR_SPEED = car PLAYER_CAR speed               CAR_SPEED *= 2.356               0092: [email protected] = float CAR_SPEED to_integer               0513: show_text_box_1number "NUMBER" number [email protected]  // ~1~           else               jump @Start           end       until  CAR_SPEED >= 60.0       0513: show_text_box_1number "NUMBER" number [email protected]  // ~1~       wait 3000       03E6: remove_text_box       jump @Start   endend

 

 

Press the Submission key and a text box will display your current speed. When you reach 60 mph, the text box will display the time (in milliseconds) it took you to get there.

 

Btw @Fireguy: I'm sure that using $2 would certainly cause problems, namely since that's the global that handles the player's character ($PLAYER_CHAR) in SA's main.scm.

 

EDIT

 

Yeah and just replace the 60.0 in the line if you want different speeds than 60 mph (remember to keep the .0 so the compiler knows it's a float):

 

 

until  CAR_SPEED >= 60.0

 

 

I've based the accuracy of this script on this speedometer.

Edited by Adler

Share this post


Link to post
Share on other sites
fireguy109

Oh, okay. I don't have SA so I don't really know how it works. smile.gif

Share this post


Link to post
Share on other sites
Markk

Adler your script works but the the time it displays is in the thousands. Also it doesn't seem to be consistent. One time it's 4000, another 4170, another 4500, but it's still generally in the 4000's. Anyways how do I interpret the time?

 

Also once I compiled the script then decompile the script it gives me a different code.

Edited by Eurolite

Share this post


Link to post
Share on other sites
Kweckzilber

 

Adler your script works but the the time it displays is in the thousands. Also it doesn't seem to be consistent. One time it's 4000, another 4170, another 4500, but it's still generally in the 4000's. Anyways how do I interpret the time?

That time is in milliseconds, so it will be very accurate, just divide it by a thousand.

 

 

Also once I compiled the script then decompile the script it gives me a different code.

Yeah, the code will be different when compiled and decompiled because Sanny (and most others) generate thread-labels-wise code with jumps when decompiling, rather than the kind of code Adler has written, if you can see the difference.

 

EDIT: I don't know why timers aren't consistent. Maybe you tried on a non-flat surface. Maybe you use a joystick. If the timers aren't consistent at all, try it on some of the airport runways. Remember to floor it. Full throttle.

 

----------------

 

50-50 on topic: Can I use Sanny without having SA installed? I searched, but didn't find anything relevant.

Edited by Kweckzilber

Share this post


Link to post
Share on other sites
fireguy109

^ Not really. You need to have III/VC/SA installed, otherwise it won't let you do anything when you first install it.

Share this post


Link to post
Share on other sites
Adler
EDIT: I don't know why timers aren't consistent. Maybe you tried on a non-flat surface. Maybe you use a joystick. If the timers aren't consistent at all, try it on some of the airport runways. Remember to floor it. Full throttle.

It's probably not consistent due to human error, especially in the lag between pressing the Submission key and just beginning to accelerate. Given that the testing location is constant then that could be the only error that could account for the time differences.

Share this post


Link to post
Share on other sites
Kweckzilber

I added another repeat to make sure the timer starts only after the car starts to accelerate. I think it should work. I hope you won't mind, Adler?

 

Code removed. See post below.

 

And fireguy109, thanks for the info.

Edited by Kweckzilber

Share this post


Link to post
Share on other sites
Adler

 

I added another repeat to make sure the timer starts only after the car starts to accelerate. I think it should work. I hope you won't mind, Adler?

No problem dude! I haven't thought of that. This is why open-source is so great lol. biggrin.gif

Share this post


Link to post
Share on other sites
Kweckzilber

 

No problem dude! I haven't thought of that. This is why open-source is so great lol. biggrin.gif

Cheers mate. I was hoping you'd say that. Appreciate it.

 

I wrote a script to check 0-60 (using 'No' key) and 0-120 (using 'Yes/Trip Skip' key). I think it'd be better converted to km/h, since 120mph is hard to attain. Here's the script in PasteBin. I hope it works.

Edited by Kweckzilber

Share this post


Link to post
Share on other sites
Markk

To get to 120 should be no problem, I have downloaded a custom track that's just a straight road.

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.

Sign in to follow this  

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