gdog12356 Posted June 1, 2011 Author Share Posted June 1, 2011 Hello, i was thinking of using a timer for checking the stamina, but it blinks(i guess because it is not set checking constantly.) This is my code for the stamina bar:```frmMain.imgStaminaBar.width = ((lblStam.Caption / frmMain.imgStaminaBar.width) / frmMain.imgStaminaBar.width) * frmMain.imgStaminaBar.width```where would i put this? Would i have to call some sort of function that i define with a timer? Like, a timer that checks every 5 seconds, and send the function "setplayerstam" Can someone help me? :D. Thnx Link to comment Share on other sites More sharing options...
Joyce Posted June 1, 2011 Share Posted June 1, 2011 What exactly is the purpose of this? This won't fix your HP regenerating in blinks, as you call it.. This will just add more useless processing, as your HP bar already gets updated as soon as new data for it is received. Link to comment Share on other sites More sharing options...
gdog12356 Posted June 1, 2011 Author Share Posted June 1, 2011 @Yami:> What exactly is the purpose of this? This won't fix your HP regenerating in blinks, as you call it.. This will just add more useless processing, as your HP bar already gets updated as soon as new data for it is received.no, i made a new bar for stamina. Like running depletes your stamina. Link to comment Share on other sites More sharing options...
Yxxe Posted June 1, 2011 Share Posted June 1, 2011 So you are setting the width of an image depending on the caption of a label? o_oEdit it to something like this (this is pseudocode btw):```frmMain.imgStaminaBar.width = (Current Stamina / Maximum Stamina) * Maximum Viewed Length of imgStaminaBar```You would need to place this code wherever the stamina changes client-side, mainly when the player first logs in and whenever stamina is reduced or increased.Hope this helps,Lightning Link to comment Share on other sites More sharing options...
Carim123 Posted June 1, 2011 Share Posted June 1, 2011 NVM Link to comment Share on other sites More sharing options...
gdog12356 Posted June 1, 2011 Author Share Posted June 1, 2011 Warning - while you were typing a new reply has been posted. You may wish to review your post.oh, so i should make the stamina a player type? Thnx, this helped im out to play around now, thnx :).@Hamster:> I dunno about you, but I'd just stick it in CheckMovement. It's something that updates as you walk :Dwhen i do that it still blinks, i need something that is constantly checking, or i need to define it as the max width of the img and than change it accordingly with some code >_>… if only i knew how to do that xD. Link to comment Share on other sites More sharing options...
Carim123 Posted June 1, 2011 Share Posted June 1, 2011 Add it under timWalk, as well. Forgot to mention that, too. It shouldn't really blink…EDIT: Just tried it. I see what you mean. I'll post back in a min'... Link to comment Share on other sites More sharing options...
Joyce Posted June 1, 2011 Share Posted June 1, 2011 Ah, I really did misunderstand.. How did you implent this stamina system then? Server side? Client Side? And where did you add it into, if it's tossed into the server side movement system, just toss that code in the bit where you receive the new stamina values from the server. Link to comment Share on other sites More sharing options...
Carim123 Posted June 1, 2011 Share Posted June 1, 2011 @Yami:> Ah, I really did misunderstand.. How did you implent this stamina system then? Server side? Client Side? And where did you add it into, if it's tossed into the server side movement system, just toss that code in the bit where you receive the new stamina values from the server.It's purely client side. Link to comment Share on other sites More sharing options...
gdog12356 Posted June 1, 2011 Author Share Posted June 1, 2011 @Yami:> Ah, I really did misunderstand.. How did you implent this stamina system then? Server side? Client Side? And where did you add it into, if it's tossed into the server side movement system, just toss that code in the bit where you receive the new stamina values from the server.also it isnt values it is a timer, that changes movement type when a value is reached,just look at his tutorial. >! http://www.touchofdeathforums.com/smf/index.php/topic,72169.msg774798.html#msg774798 Link to comment Share on other sites More sharing options...
Carim123 Posted June 1, 2011 Share Posted June 1, 2011 It's a pretty stupid way of doing Stamina, but I just wanted a simple way to exploit what I already had. ;p Link to comment Share on other sites More sharing options...
Joyce Posted June 1, 2011 Share Posted June 1, 2011 … I'm just going to say that is one lazy ass/poor way to add it. Anyways..``` If frmMain.lblStam.Caption = "0" Then Player(MyIndex).Moving = MOVING_WALKING Else frmMain.lblStam.Caption = Val(frmMain.lblStam) - 1 End If```In that code, where it's deducting the stamina.. Add it there, whenever it deducts it'll update.. And do the same where it regenerates. :) Link to comment Share on other sites More sharing options...
gdog12356 Posted June 1, 2011 Author Share Posted June 1, 2011 thnx, but it still blinks, im trying to figure out why, but when it updates it blinks. Link to comment Share on other sites More sharing options...
Joyce Posted June 1, 2011 Share Posted June 1, 2011 Have you tried blatantly copying the way your health/mana bars are handled? Those don't blink/flash on my screen. :) Unless you're already doing this, in which case it's likely something on your PC messing it up.. Or something resetting the value in an instant for some odd reason. Link to comment Share on other sites More sharing options...
Carim123 Posted June 1, 2011 Share Posted June 1, 2011 EDIT: NVM. 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