aStiffSausage Posted May 6, 2011 Share Posted May 6, 2011 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? // 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 More sharing options...
ZAZ Posted May 6, 2011 Share Posted May 6, 2011 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? 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. CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
aStiffSausage Posted May 6, 2011 Author Share Posted May 6, 2011 Ok, here: Still making the textures, just need to get the script function well before spending lots of hours on textures 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 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 More sharing options...
ZAZ Posted May 6, 2011 Share Posted May 6, 2011 Still making the textures, just need to get the script function well before spending lots of hours on textures 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 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 CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
aStiffSausage Posted May 6, 2011 Author Share Posted May 6, 2011 Still making the textures, just need to get the script function well before spending lots of hours on textures 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 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 Two pics, one wierd, one nice Tried also with different resolution, lower the resolution, less buggy. But game looks then bad then 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 More sharing options...
ZAZ Posted May 6, 2011 Share Posted May 6, 2011 (edited) Still making the textures, just need to get the script function well before spending lots of hours on textures 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 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 Two pics, one wierd, one nice Tried also with different resolution, lower the resolution, less buggy. But game looks then bad then On 640x480 it looks about what I'm looking for, but it just looks so bad with that low resolution. resolution 1280 x 1024 have you changed the code at 2 parts? one for the day and one for the night? Edited May 6, 2011 by ZAZ CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
Silent Posted May 6, 2011 Share Posted May 6, 2011 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 More sharing options...
aStiffSausage Posted May 6, 2011 Author Share Posted May 6, 2011 (edited) 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) Thanks for your efforts anyways SilentPL, got it work now, thanks a lot Never would have figured that out, still a bit buggy but soon finished 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 May 6, 2011 by oksa8 Link to comment Share on other sites More sharing options...
ZAZ Posted May 6, 2011 Share Posted May 6, 2011 (edited) 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 May 6, 2011 by ZAZ CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
aStiffSausage Posted May 6, 2011 Author Share Posted May 6, 2011 Wow. Thanks a lot, both of you. Wouldn't figured out any of those by myself, take some 's Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now