Jump to content

[SA] SCM Direct Draw - Status/Progress Bar Flickering


Recommended Posts

Hey,

 

I'm creating a CLEO script based on the SCM Direct Draw plugin by DK22Pac. This script fetches a time-based variable (32@, the counting variable actually) stored as a global variable from an INI file inside the CLEO folder. Then, it creates a progress bar (aka status bar or hud bar) that increases to a limit as 32@ increases. The script works, but my problem is that the progress bar flickers twice every second on screen. I believe this is because the opcodes I use are slowing the script down. Oh, and this script does not write to the ini file. Another script takes care of that. Can anyone help me out with any of these questions:

 

How to prevent the flickering?

 

How to make a script hook plugin that will do the same thing (but faster)?

 

How to create a global CLEO variable that saves continuously without saving the game (an alternative to the ini file)?

 

Here are the essential parts of my code (this is not my entire script, it is just long. Don't reprimand me for this :lol:):

:HEATBAR_40wait 0 if Player.Defined($PLAYER_CHAR)jf @HEATBAR_20811: 20@ = actor $PLAYER_ACTOR car // versionCif and Actor.Driving($PLAYER_ACTOR)$ACTIVE_INTERIOR == 08119:   NOT   car 20@ wreckedelse_jump @HEATBAR_2gosub @HEATBAR_3000AB1: call @HEATBAR_163 2 from @HEATBAR_100 to @HEATBAR_102jump @HEATBAR_40 :HEATBAR_1000AA5: call_function 0x728640 num_params 10 pop 10 0 0xFFFFFFFF 1 0 0 15@ 100 20 300.0 150.0:HEATBAR_102:HEATBAR_1630A8D: 2@ = read_memory 0x884740 size 4 virtual_protect 0if    2@ <> 0x40404040then    0A9F: 3@ = current_thread_pointer    0AA5: call 2@ num_params 3 pop 3 _end 1@ _start 0@ _script 3@end0AB2: ret 0:HEATBAR_300wait 00AF0: 6@ = get_int_from_ini_file "CLEO\WL.INI" section "MAIN" key "WL" //IF and SET  jump @HEATBAR_310:HEATBAR_310wait 0if or6@ == 06@ == 1else_jump @HEATBAR_3200AF0: 11@ = get_int_from_ini_file "CLEO\WL.INI" section "MAIN" key "H1" //IF and SET0093: 11@ = integer 11@ to_float14@ = 120000.00087: 15@ = 11@0073: 15@ /= 14@0013: 15@ *= 100.0return:HEATBAR_320wait 0if 6@ == 2else_jump @HEATBAR_3300AF0: 11@ = get_int_from_ini_file "CLEO\WL.INI" section "MAIN" key "H2" //IF and SET0093: 11@ = integer 11@ to_float14@ = 180000.00087: 15@ = 11@0073: 15@ /= 14@0013: 15@ *= 100.0return:HEATBAR_330wait 0if 6@ == 3else_jump @HEATBAR_3400AF0: 11@ = get_int_from_ini_file "CLEO\WL.INI" section "MAIN" key "H3" //IF and SET0093: 11@ = integer 11@ to_float14@ = 300000.00087: 15@ = 11@0073: 15@ /= 14@0013: 15@ *= 100.0return:HEATBAR_340wait 0if or6@ == 46@ == 5else_jump @HEATBAR_30015@ = 0.0return

Thanks.

 

-Agent 86

Link to comment
https://gtaforums.com/topic/764227-sa-scm-direct-draw-statusprogress-bar-flickering/
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
  • 0 User Currently Viewing
    0 members, 0 Anonymous, 0 Guests

×
×
  • Create New...

Important Information

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