suliman2 Posted April 17, 2006 Share Posted April 17, 2006 Hi My threads are set up and are run ingame. The first works and controls health. The second should set armour to 50 if its above 50. Problem is it sets it to 50 (once) after wasted/busted/start of game. Like the "if" doesnt work properly all the time. What could be wrong? The first one works like a charm. Oh and is it confirmed that you cannot lower max_health only increase it? I would want the healthbar to be shorter so that 50 health looks like full-health (not half bar empty as it is now). Playing around with max_health doesnt work. Thanks. My code: :LOWHEALTH 0001: wait 250 ms 00D6: if 0 0256: defined $PLAYER_CHAR 004D: jump_if_false ££LOWHEALTH 0226: @0 = actor $PLAYER_ACTOR health 00D6: if 0 0019: @0 > 50 ;; integer values 004D: jump_if_false ££LOWHEALTH 0223: set_actor $PLAYER_ACTOR health_to 50 0002: jump ££LOWHEALTH :LOWARMOUR 0001: wait 250 ms 00D6: if 0 0256: defined $PLAYER_CHAR 004D: jump_if_false ££LOWARMOUR 0226: @0 = actor $PLAYER_ACTOR armour 00D6: if 0 0019: @0 > 50 ;; integer values 004D: jump_if_false ££LOWARMOUR 035F: set_actor $PLAYER_ACTOR armour_to 50 0002: jump ££LOWARMOUR Link to comment Share on other sites More sharing options...
Demarest Posted April 17, 2006 Share Posted April 17, 2006 It would appear that you believe the text is interpreted by the game. It isn't. The armor code checks on health since you used opcode 0226. Also, if you'll check the Opcode Database, you'll find that I dutifully named 035F as INCREMENT_actor_armor (not SET) because after testing, that's what it does, despite you renaming it set for whatever reason. I don't know about the max. You say bar, so I'm assuming we're talking SA here. I know in VC (where the opcode to change max first appeared), it was an increment command whereby using -50 for example should work fine. Maybe you were just trying the wrong opcode and naming it to suit what you WANTED it to do Link to comment Share on other sites More sharing options...
PLPynton Posted April 17, 2006 Share Posted April 17, 2006 (edited) i do not really get the idea why full bar does not work. use this you can edit regarding to info after semicolons :ARMREG00 0001: wait 1000 ms ;checks every second 00D6: if 0 0256: player $PLAYER_CHAR defined 004D: jump_if_false ££ARMREG00 0653: @0 = stat 24 (max health) ; float 0013: @0 *= 1.75 ;; floating-point values 0A1F: set_stat 24 max_to @0 04DD: @0 = actor $PLAYER_ACTOR armour 0226: @2 = actor $PLAYER_ACTOR health 0945: $PLAYER_CHAR @1 0016: @1 /= 2 ;; integer values ;2 means 1/2 of armour bar, 1 would be full bar 00D6: if 0 002D: @1 >= @0 ;; integer values 004D: jump_if_false ££ARMREG01 0062: @1 -= @0 ;; integer values 035F: set_actor $PLAYER_ACTOR armour_to @1 :ARMREG01 00D6: if 0 8019: NOT @2 > 87 ;; integer values ;87 means refill when less than 88 (174 would be full health bar) 004D: jump_if_false ££ARMREG00 0223: set_actor $PLAYER_ACTOR health_to 88 ;here 88 for 1/2 healths bar or 175 for full 0002: jump ££ARMREG00 004E: end_thread Edited April 17, 2006 by PLPynton Link to comment Share on other sites More sharing options...
ZAZ Posted April 17, 2006 Share Posted April 17, 2006 Hi My threads are set up and are run ingame. The first works and controls health. The second should set armour to 50 if its above 50. Problem is it sets it to 50 (once) after wasted/busted/start of game. Like the "if" doesnt work properly all the time. What could be wrong? The first one works like a charm. Oh and is it confirmed that you cannot lower max_health only increase it? I would want the healthbar to be shorter so that 50 health looks like full-health (not half bar empty as it is now). Playing around with max_health doesnt work. Thanks. My code: :LOWHEALTH 0001: wait 250 ms 00D6: if 0 0256: defined $PLAYER_CHAR 004D: jump_if_false ££LOWHEALTH 0226: @0 = actor $PLAYER_ACTOR health 00D6: if 0 0019: @0 > 50 ;; integer values 004D: jump_if_false ££LOWHEALTH 0223: set_actor $PLAYER_ACTOR health_to 50 0002: jump ££LOWHEALTH :LOWARMOUR 0001: wait 250 ms 00D6: if 0 0256: defined $PLAYER_CHAR 004D: jump_if_false ££LOWARMOUR 0226: @0 = actor $PLAYER_ACTOR armour 00D6: if 0 0019: @0 > 50 ;; integer values 004D: jump_if_false ££LOWARMOUR 035F: set_actor $PLAYER_ACTOR armour_to 50 0002: jump ££LOWARMOUR You must change the "if bigger"-code :body1_30001: wait 0 ms00D6: if 00256: player $PLAYER_CHAR defined004D: jump_if_false ££body1_60226: @21 = actor $PLAYER_ACTOR health04DD: @22 = actor $PLAYER_ACTOR armour00D6: if 0001B: 30 > @22 ;; integer values004D: jump_if_false ££body1_4055F: set_player $PLAYER_CHAR max_armour += 70:body1_400D6: if 0001B: 30 > @21 ;; integer values004D: jump_if_false ££body1_44055E: set_player $PLAYER_CHAR max_health += 70 for bigger full max health and extra full max health exists more codes search it CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
suliman2 Posted April 18, 2006 Author Share Posted April 18, 2006 thanks for your help i´ll try it at home. Erik 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