Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

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

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    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. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. 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. Red Dead Redemption 2

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

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

    2. Forum Support

    3. Suggestions

Speedometer needle


aStiffSausage
 Share

Recommended Posts

aStiffSausage

So, I'm retexturing and changing a speedometer script a bit. I've managed to get everything works, except the needle. I've tried with different values on opcode 074B, but it doesn't seem to be helping. Problem is, when I don't move (needle pointing straight down), needle texture seems to be stretched, and needle isn't inside the speedo. It also happens when needle is pointing up, but when it's pointing straight to the left or right, there is no problem.

 

Can someone help me with this? dontgetit.gif

 

 

 

// This file was decompiled using sascm.ini published by Seemann (http://sannybuilder.com/files/SASCM.rar) on 13.10.2007{$VERSION 3.1.0027}{$CLEO .cs}//-------------MAIN---------------0000: NOP 0A95: enable_thread_saving :NONAME_4wait 0 if and  Actor.Driving($PLAYER_ACTOR) $ACTIVE_INTERIOR == 0 84C8:   not actor $PLAYER_ACTOR driving_flying_vehicle 84A7:   not actor $PLAYER_ACTOR driving_boat else_jump @NONAME_4 0811: [email protected] = actor $PLAYER_ACTOR car // versionC 0390: load_txd_dictionary "SPEED" 038F: load_texture "STRELK" as 15 // Load dictionary with 0390 first 038F: load_texture "CIF" as 16 // Load dictionary with 0390 first 038F: load_texture "CIFN" as 17 // Load dictionary with 0390 first 038F: load_texture "STRELKN" as 18 // Load dictionary with 0390 first 038F: load_texture "GLASSC" as 19 // Load dictionary with 0390 firstwait 0 jump @NONAME_125 :NONAME_125wait 0 if and  Actor.Driving($PLAYER_ACTOR) $ACTIVE_INTERIOR == 0 else_jump @NONAME_80100BF: [email protected] = current_time_hours, [email protected] = current_time_minutes if and [email protected] >= 6  20 > [email protected] else_jump @NONAME_463 02E3: [email protected] = car [email protected] speed 02E3: [email protected] = car [email protected] [email protected] *= 1.6 [email protected] *= 2.1 [email protected] += 90.0 [email protected] *= 1.6 [email protected] *= 2.10092: [email protected] = float [email protected] to_integer 03F0: enable_text_draw 1 03E3: set_texture_to_be_drawn_antialiased 1 033F: set_text_draw_letter_size 0.75 2.5 0340: set_text_draw_RGBA 255 255 255 255 045A: draw_text_1number 563.0 373.0 GXT 'NUMBER' number [email protected]  // ~1~03E3: set_texture_to_be_drawn_antialiased 1 038D: draw_texture 16 position 540.0 355.0 size 170.0 170.0 RGBA 255 255 255 255 03E3: set_texture_to_be_drawn_antialiased 1 074B: draw_texture 15 position 540.0 355.0 size 170.0 170.0 angle [email protected] color_RGBA 255 255 255 255 :NONAME_111 if 03C9:   car [email protected] damaged else_jump @NONAME_125 03E3: set_texture_to_be_drawn_antialiased 1 038D: draw_texture 19 position 88.5 385.0 size 262.5 226.0 RGBA 255 255 255 255 jump @NONAME_125 :NONAME_463wait 0 if and  Actor.Driving($PLAYER_ACTOR) $ACTIVE_INTERIOR == 0 else_jump @NONAME_801 00BF: [email protected] = current_time_hours, [email protected] = current_time_minutes if or [email protected] >= 20  6 > [email protected] else_jump @NONAME_125  02E3: [email protected] = car [email protected] speed 02E3: [email protected] = car [email protected] speed [email protected] *= 1.6 [email protected] *= 2.1 [email protected] += 90.0 [email protected] *= 1.6 [email protected] *= 2.10092: [email protected] = float [email protected] to_integer 03F0: enable_text_draw 1 03E3: set_texture_to_be_drawn_antialiased 1 033F: set_text_draw_letter_size 0.75 2.5 0340: set_text_draw_RGBA 255 255 255 255 045A: draw_text_1number 563.0 373.0 GXT 'NUMBER' number [email protected]  // ~1~03E3: set_texture_to_be_drawn_antialiased 1 038D: draw_texture 16 position 540.0 355.0 size 170.0 170.0 RGBA 255 255 255 255 03E3: set_texture_to_be_drawn_antialiased 1 074B: draw_texture 15 position 540.0 355.0 size 170.0 170.0 angle [email protected] color_RGBA 255 255 255 255 :NONAME_999if 03C9:   car [email protected] damaged else_jump @NONAME_463 03E3: set_texture_to_be_drawn_antialiased 1 038D: draw_texture 19 position 90.5 385.0 size 262.5 226.0 RGBA 255 255 255 255 jump @NONAME_463 :NONAME_801wait 0 03F0: enable_text_draw 0 0391: release_txd_dictionary jump @NONAME_4

 

Link to comment
Share on other sites

So, I'm retexturing and changing a speedometer script a bit. I've managed to get everything works, except the needle. I've tried with different values on opcode 074B, but it doesn't seem to be helping. Problem is, when I don't move (needle pointing straight down), needle texture seems to be stretched, and needle isn't inside the speedo. It also happens when needle is pointing up, but when it's pointing straight to the left or right, there is no problem.

 

Can someone help me with this? dontgetit.gif

 

 

 

The cif and cifn textur is displayed oval. It's because you have modified the textur and modified the textur display codes to have it round.

For more help we need your textures.

Link to comment
Share on other sites

aStiffSausage

Ok, here:

 

user posted image

user posted image

 

 

Still making the textures, just need to get the script function well before spending lots of hours on textures tounge.gif

 

But the idea is, that needle goes barely inside the white/blue/black border on speedo, you get the idea when you put those two textures on editing program and spin the needle turn.gif

 

And I would also be grateful for helping me to make the needle stop at 260 km/h, so it would "shake" at that speed but go no further.

Link to comment
Share on other sites

 

Still making the textures, just need to get the script function well before spending lots of hours on textures  tounge.gif

 

But the idea is, that needle goes barely inside the white/blue/black border on speedo, you get the idea when you put those two textures on editing program and spin the needle  turn.gif

 

And I would also be grateful for helping me to make the needle stop at 260 km/h, so it would "shake" at that speed but go no further.

Your cif is also shown oval

just use the original codes of Olegators speedo:

 

038D: draw_texture 16 position 550.0 360.0 size 191.25 170.0 RGBA 255 255 255 255 03E3: set_texture_to_be_drawn_antialiased 1 074B: draw_texture 15 position 550.0 360.0 scale 191.25 170.0 angle [email protected] color_RGBA 255 255 255 255

 

then it looks good for me, the STRELK moves over the scale near to the border

Link to comment
Share on other sites

aStiffSausage
Still making the textures, just need to get the script function well before spending lots of hours on textures  tounge.gif

 

But the idea is, that needle goes barely inside the white/blue/black border on speedo, you get the idea when you put those two textures on editing program and spin the needle  turn.gif

 

And I would also be grateful for helping me to make the needle stop at 260 km/h, so it would "shake" at that speed but go no further.

Your cif is also shown oval

just use the original codes of Olegators speedo:

 

038D: draw_texture 16 position 550.0 360.0 size 191.25 170.0 RGBA 255 255 255 255 03E3: set_texture_to_be_drawn_antialiased 1 074B: draw_texture 15 position 550.0 360.0 scale 191.25 170.0 angle [email protected] color_RGBA 255 255 255 255

 

then it looks good for me, the STRELK moves over the scale near to the border

For me it still looks wierd suicidal.gif

 

Two pics, one wierd, one nice

 

 

Tried also with different resolution, lower the resolution, less buggy. But game looks then bad then devil.gif

On 640x480 it looks about what I'm looking for, but it just looks so bad with that low resolution.

 

 

Link to comment
Share on other sites

 

Still making the textures, just need to get the script function well before spending lots of hours on textures  tounge.gif

 

But the idea is, that needle goes barely inside the white/blue/black border on speedo, you get the idea when you put those two textures on editing program and spin the needle  turn.gif

 

And I would also be grateful for helping me to make the needle stop at 260 km/h, so it would "shake" at that speed but go no further.

Your cif is also shown oval

just use the original codes of Olegators speedo:

 

038D: draw_texture 16 position 550.0 360.0 size 191.25 170.0 RGBA 255 255 255 255 03E3: set_texture_to_be_drawn_antialiased 1 074B: draw_texture 15 position 550.0 360.0 scale 191.25 170.0 angle [email protected] color_RGBA 255 255 255 255

 

then it looks good for me, the STRELK moves over the scale near to the border

For me it still looks wierd suicidal.gif

 

Two pics, one wierd, one nice

 

 

Tried also with different resolution, lower the resolution, less buggy. But game looks then bad then devil.gif

On 640x480 it looks about what I'm looking for, but it just looks so bad with that low resolution.

resolution 1280 x 1024

user posted image user posted image user posted image

 

have you changed the code at 2 parts?

one for the day and one for the night?

Edited by ZAZ
Link to comment
Share on other sites

Some time ago on Sannybuilder forum (I can't remember the author, sorry) I found a scale fix for rotating textures. It works nicely in The '95 Story.

 

 

0A8D: [email protected] = read_memory 0xC17044 size 4 virtual_protect 0 0A8D: [email protected] = read_memory 0xC17048 size 4 virtual_protect 00093: [email protected] = integer [email protected] to_float  0093: [email protected] = integer [email protected] to_float 0073: [email protected] /= [email protected] 0007: [email protected] = 175.0   // Y scale006B: [email protected] *= [email protected] 0013: [email protected] *= 0.7

 

 

Pass it as your textures' Y scale.

 

 

0A8D: [email protected] = read_memory 0xC17044 size 4 virtual_protect 0 0A8D: [email protected] = read_memory 0xC17048 size 4 virtual_protect 00093: [email protected] = integer [email protected] to_float  0093: [email protected] = integer [email protected] to_float 0073: [email protected] /= [email protected] [email protected] = 175.0006B: [email protected] *= [email protected] [email protected] *= 0.7 03E3: set_texture_to_be_drawn_antialiased 1 074B: draw_texture SPEEDO2 position 550.0 480.0 scale 175.0 [email protected] angle [email protected] color_RGBA 255 255 255 255 03E3: set_texture_to_be_drawn_antialiased 1 038D: draw_texture SPEEDO1 position 550.0 480.0 size 175.0 [email protected] RGBA 255 255 255 255

 

Link to comment
Share on other sites

aStiffSausage

ZAZ, yep, changed both night and day, and I think that why it worked for you but not for me was caused because you run on 1280x1024 and I run on 1280x768 (Laptop) tounge.gif Thanks for your efforts anyways icon14.gif

 

 

SilentPL, got it work now, thanks a lot tounge2.gif Never would have figured that out, still a bit buggy but soon finished turn.gif

 

 

 

PS. Still got one thing: Is it possible to make the needle "shake" at 260-265 km/h, so it would stay there and go no further? I got an idea for it, like when it would pass some value, it would be returned it to a bit previous value, as simplified: When needle reaches 265 km/h, it would be returned to 260 km/h, making it look shaking, but digital meter would still keep counting kilometers.

Edited by oksa8
Link to comment
Share on other sites

 

PS. Still got one thing: Is it possible to make the needle "shake" at 260-265 km/h, so it would stay there and go no further? I got an idea for it, like when it would pass some value, it would be returned it to a bit previous value, as simplified: When needle reaches 265 km/h, it would be returned to 260 km/h, making it look shaking, but digital meter would still keep counting kilometers.

 

03E3: set_texture_to_be_drawn_antialiased 1038D: draw_texture 16 position 550.0 360.0 size 191.25 170.0 RGBA 255 255 255 255 if359.9 > [email protected] @NONAME_47003E3: set_texture_to_be_drawn_antialiased 1 074B: draw_texture 15 position 550.0 360.0 scale 191.25 170.0 angle [email protected] color_RGBA 255 255 255 255jump @NONAME_999:[email protected] == 0jf @NONAME_47503E3: set_texture_to_be_drawn_antialiased 1 074B: draw_texture 15 position 550.0 360.0 scale 191.25 170.0 angle 359.5 color_RGBA 255 255 255 [email protected] = 1jump @NONAME_999:[email protected] == 1jf @NONAME_99903E3: set_texture_to_be_drawn_antialiased 1 074B: draw_texture 15 position 550.0 360.0 scale 191.25 170.0 angle 5.5 color_RGBA 255 255 255 [email protected] = 0:NONAME_999

 

 

same then for the daypart with other labels

Edited by ZAZ
Link to comment
Share on other sites

aStiffSausage

Wow. Thanks a lot, both of you. Wouldn't figured out any of those by myself, take some cookie.gif's smile.gif

Link to comment
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
 Share

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