bull.04 Posted September 6, 2011 Share Posted September 6, 2011 So I never understood how to make a bar representing something's health. Like Sweet's health in Sweet's Girl mission. Would anyone know how to make a copy of that in CLEO format? And if so, is there a way to scale that bar? Link to comment Share on other sites More sharing options...
spaceeinstein Posted September 6, 2011 Share Posted September 6, 2011 (edited) 03C4: set_status_text_to $100 1 'DUMMY'while true wait 10 $100 = your health if you dead then 0151: remove_status_text $100 break endend CLEO can't use global variables, though, and this opcode can only support global variables. Search for a work around for this problem, it's somewhere in this forum. Edited September 7, 2011 by spaceeinstein Link to comment Share on other sites More sharing options...
bull.04 Posted September 7, 2011 Author Share Posted September 7, 2011 So it can only be done with global variables which CLEO doesn't use? What if I defined a special global variable within the CLEO script, would that change anything? Link to comment Share on other sites More sharing options...
spaceeinstein Posted September 7, 2011 Share Posted September 7, 2011 If you really want to use global variables, use an useless global var from the game. As long as you're not adding global vars that the script did not define or you're not changing existing global vars, then you can use global vars. Sanny's CustomVariables.ini file should provide you with some unused variables that you can use. Link to comment Share on other sites More sharing options...
bull.04 Posted September 7, 2011 Author Share Posted September 7, 2011 Thank you very much. Would there be a way to scale/size that bar? Just wondering. Link to comment Share on other sites More sharing options...
bull.04 Posted September 7, 2011 Author Share Posted September 7, 2011 So I made a new healthbar in PS to represent each 10% of health lost. I used 11 different textures for the health bar and made a TON of checks to draw a special texture when the health is in that area. The problem is is that the texture just flickers really badly and is just pure white, even though I am sure I used the right texture names. Anyways, here is the code, and if you can help me fix the flickering it would be appreicated. {$CLEO .cs}thread 'HLTHBAR':HLTHBAR_1wait 0ifPlayer.Defined($PLAYER_CHAR)jf @HLTHBAR_1ifPlayer.Controllable($PLAYER_CHAR)jf @[email protected] = Actor.Health($PLAYER_ACTOR)0390: load_txd_dictionary 'AVATARS'038F: load_texture "HEALTH" as 2 // Load dictionary with 0390 first038F: load_texture "HLT90" as 4 // Load dictionary with 0390 first038F: load_texture "HLT80" as 6 // Load dictionary with 0390 first038F: load_texture "HLT70" as 8 // Load dictionary with 0390 first038F: load_texture "HLT60" as 10 // Load dictionary with 0390 first 038F: load_texture "HLT50" as 12 // Load dictionary with 0390 first 038F: load_texture "HLT40" as 14 // Load dictionary with 0390 first038F: load_texture "HLT30" as 16 // Load dictionary with 0390 first038F: load_texture "HLT20" as 20 // Load dictionary with 0390 first038F: load_texture "HLT10" as 22 // Load dictionary with 0390 first038F: load_texture "HLT00" as 24 // Load dictionary with 0390 firstjump @HLTHBAR_505:HLTHBAR_505wait 0if0184: actor $PLAYER_ACTOR health >= 99 jf @[email protected] = Actor.Health($PLAYER_ACTOR)038D: draw_texture 2 position 505.0 400.0 size 130.0 55.0 RGBA 255 255 255 255jump @HLTHBAR_1:HLTHBAR_3wait 0if [email protected] = 90 [email protected] = [email protected] = [email protected] = [email protected] = 86jf @HLTHBAR_4if [email protected] = [email protected] = [email protected] = [email protected] = [email protected] = 81jf @HLTHBAR_4038D: draw_texture 4 position 505.0 400.0 size 130.0 55.0 RGBA 255 255 255 255jump @HLTHBAR_1 :HLTHBAR_4wait 0if [email protected] = 80 [email protected] = [email protected] = [email protected] = [email protected] = 76jf @HLTHBAR_5if [email protected] = [email protected] = [email protected] = [email protected] = [email protected] = 71jf @HLTHBAR_5038D: draw_texture 6 position 505.0 400.0 size 130.0 55.0 RGBA 255 255 255 255jump @HLTHBAR_1:HLTHBAR_5wait 0if [email protected] = 70 [email protected] = [email protected] = [email protected] = [email protected] = 66jf @HLTHBAR_6if [email protected] = [email protected] = [email protected] = [email protected] = [email protected] = 61jf @HLTHBAR_6038D: draw_texture 8 position 505.0 400.0 size 130.0 55.0 RGBA 255 255 255 255jump @HLTHBAR_1:HLTHBAR_6wait 0if [email protected] = 60 [email protected] = [email protected] = [email protected] = [email protected] = 56jf @HLTHBAR_7if [email protected] = [email protected] = [email protected] = [email protected] = [email protected] = 51jf @HLTHBAR_7038D: draw_texture 10 position 505.0 400.0 size 130.0 55.0 RGBA 255 255 255 255jump @HLTHBAR_1:HLTHBAR_7wait 0if [email protected] = 50 [email protected] = [email protected] = [email protected] = [email protected] = 46jf @HLTHBAR_8if [email protected] = [email protected] = [email protected] = [email protected] = [email protected] = 41jf @HLTHBAR_8038D: draw_texture 12 position 505.0 400.0 size 130.0 55.0 RGBA 255 255 255 255jump @HLTHBAR_1:HLTHBAR_8wait 0if [email protected] = 40 [email protected] = [email protected] = [email protected] = [email protected] = 36jf @HLTHBAR_9if [email protected] = [email protected] = [email protected] = [email protected] = [email protected] = 31jf @HLTHBAR_9038D: draw_texture 14 position 505.0 400.0 size 130.0 55.0 RGBA 255 255 255 255jump @HLTHBAR_1:HLTHBAR_9wait 0if [email protected] = 30 [email protected] = [email protected] = [email protected] = [email protected] = 26jf @HLTHBAR_10if [email protected] = [email protected] = [email protected] = [email protected] = [email protected] = 21jf @HLTHBAR_10038D: draw_texture 16 position 505.0 400.0 size 130.0 55.0 RGBA 255 255 255 255jump @HLTHBAR_1:HLTHBAR_10wait 0if [email protected] = 20 [email protected] = [email protected] = [email protected] = [email protected] = 16jf @HLTHBAR_11if [email protected] = [email protected] = [email protected] = [email protected] = [email protected] = 11jf @HLTHBAR_11038D: draw_texture 20 position 505.0 400.0 size 130.0 55.0 RGBA 255 255 255 255jump @HLTHBAR_1:HLTHBAR_11wait 0if [email protected] = 10 [email protected] = [email protected] = [email protected] = [email protected] = 6jf @HLTHBAR_12if [email protected] = [email protected] = [email protected] = [email protected] = [email protected] = 1jf @HLTHBAR_12038D: draw_texture 22 position 505.0 400.0 size 130.0 55.0 RGBA 255 255 255 255jump @HLTHBAR_1:HLTHBAR_12wait 0ifActor.Dead($PLAYER_ACTOR)jf @HLTHBAR_505038D: draw_texture 24 position 505.0 400.0 size 130.0 55.0 RGBA 255 255 255 255jump @HLTHBAR_1 Also, I did put avatars.txd in the models/txd directory because it worked before I added all the checks, but I only added the full healthbar and made a constant draw texture loop but the problem is is that the texture just rendered for like 1 ms then deleted so I needed a loop, but apparently adding checks after that loop makes the texture flicker. Sorry, this is probably very complicated... Link to comment Share on other sites More sharing options...
UNRATED69 Posted September 7, 2011 Share Posted September 7, 2011 You added too many wait 0s. You only need one per check loop, not one per if statement. And instead of checking if the player's health is equal to every number, you could just check if it's in between two. {$CLEO .cs}//-------------MAIN---------------thread 'HLTHBAR' 0390: load_txd_dictionary 'AVATARS' 038F: load_texture "HEALTH" as 2 // Load dictionary with 0390 first 038F: load_texture "HLT90" as 4 // Load dictionary with 0390 first 038F: load_texture "HLT80" as 6 // Load dictionary with 0390 first 038F: load_texture "HLT70" as 8 // Load dictionary with 0390 first 038F: load_texture "HLT60" as 10 // Load dictionary with 0390 first 038F: load_texture "HLT50" as 12 // Load dictionary with 0390 first 038F: load_texture "HLT40" as 14 // Load dictionary with 0390 first 038F: load_texture "HLT30" as 16 // Load dictionary with 0390 first 038F: load_texture "HLT20" as 20 // Load dictionary with 0390 first 038F: load_texture "HLT10" as 22 // Load dictionary with 0390 first 038F: load_texture "HLT00" as 24 // Load dictionary with 0390 first :HLTHBAR_144wait 0 if Player.Defined($PLAYER_CHAR)else_jump @HLTHBAR_144 [email protected] = Actor.Health($PLAYER_ACTOR):HLTHBAR_172if 0184: actor $PLAYER_ACTOR health >= 99 else_jump @HLTHBAR_233 038D: draw_texture 2 position 505.0 400.0 size 130.0 55.0 RGBA 255 255 255 255 jump @HLTHBAR_144 :HLTHBAR_233if and [email protected] > 80 not [email protected] > 91 else_jump @HLTHBAR_301 038D: draw_texture 4 position 505.0 400.0 size 130.0 55.0 RGBA 255 255 255 255 jump @HLTHBAR_144 :HLTHBAR_301if and [email protected] > 70 not [email protected] > 81 else_jump @HLTHBAR_369 038D: draw_texture 6 position 505.0 400.0 size 130.0 55.0 RGBA 255 255 255 255 jump @HLTHBAR_144 :HLTHBAR_369if and [email protected] > 60 not [email protected] > 71 else_jump @HLTHBAR_437 038D: draw_texture 8 position 505.0 400.0 size 130.0 55.0 RGBA 255 255 255 255 jump @HLTHBAR_144 :HLTHBAR_437if and [email protected] > 50 not [email protected] > 61 else_jump @HLTHBAR_505 038D: draw_texture 10 position 505.0 400.0 size 130.0 55.0 RGBA 255 255 255 255 jump @HLTHBAR_144 :HLTHBAR_505if and [email protected] > 40 not [email protected] > 51 else_jump @HLTHBAR_573 038D: draw_texture 12 position 505.0 400.0 size 130.0 55.0 RGBA 255 255 255 255 jump @HLTHBAR_144 :HLTHBAR_573if and [email protected] > 30 not [email protected] > 41 else_jump @HLTHBAR_641 038D: draw_texture 14 position 505.0 400.0 size 130.0 55.0 RGBA 255 255 255 255 jump @HLTHBAR_144 :HLTHBAR_641if and [email protected] > 20 not [email protected] > 31 else_jump @HLTHBAR_709 038D: draw_texture 16 position 505.0 400.0 size 130.0 55.0 RGBA 255 255 255 255 jump @HLTHBAR_144 :HLTHBAR_709if and [email protected] > 10 not [email protected] > 21 else_jump @HLTHBAR_777 038D: draw_texture 20 position 505.0 400.0 size 130.0 55.0 RGBA 255 255 255 255 jump @HLTHBAR_144 :HLTHBAR_777if and [email protected] > 0 not [email protected] > 11 else_jump @HLTHBAR_845 038D: draw_texture 22 position 505.0 400.0 size 130.0 55.0 RGBA 255 255 255 255 jump @HLTHBAR_144 :HLTHBAR_845if Actor.Dead($PLAYER_ACTOR)else_jump @HLTHBAR_172 038D: draw_texture 24 position 505.0 400.0 size 130.0 55.0 RGBA 255 255 255 255 jump @HLTHBAR_144 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