Carim123 Posted May 26, 2011 Author Share Posted May 26, 2011 **I DO NOT recommend you use this.**Anyway, this is a lot more simpler than I thought. It's perfectly functional for me.There are more functional, and WAY better ways of doing this; but I just wanted something simple, and I just exploited what I had to use. ;p.What this does is that if you're running, it depletes your stamina, if you're walking, or standing still, it raises your stamina, and if you end up at 0, the only solution to raising your stamina is standing still.NOTE: I switched my Running and Walking functions, so you may need to swap MOVING_RUNNING for MOVING_WALKING, and vice versa. If it rises, just swap them. I changed them to how they'd be normally, but in the case I'm incorrect, correct me.First, make a label on frmMain. Name it lblStam, and set the Caption to 100\. Or whatever number between 0 - 100\. Now, make a timer, and call it timWalk. Keep it enabled as true, and set the interval to anything higher than 2000\. This makes the stamina rise every few seconds, and keep in mind 2000 is 2 seconds, so you don't want it lower than 1000\. I tried 3\. The results was hilarious. xD.Inject this into timWalk:```If frmMain.lblStam.Caption = "100" Then' Change the 100 to whatever you want to maximum value to be. Exit SubEnd IfIf frmMain.lblStam.Caption = "0" Then Player(MyIndex).Moving = MOVING_WALKING frmMain.lblStam.Caption = Val(frmMain.lblStam) + 1 Else frmMain.lblStam.Caption = Val(frmMain.lblStam) + 1 End If```Now, that's done. Now go into Sub CheckMovement, within modGameLogic, and under:```Player(MyIndex).Moving = MOVING_RUNNING```add:``` If frmMain.lblStam.Caption = "0" Then Player(MyIndex).Moving = MOVING_WALKING Else frmMain.lblStam.Caption = Val(frmMain.lblStam) - 1 End If```There you go. A functional Stamina system, provided I've added everything. Link to comment Share on other sites More sharing options...
Dzastin Posted May 26, 2011 Share Posted May 26, 2011 Wow, simple and nice, i like this :) Link to comment Share on other sites More sharing options...
Carim123 Posted May 26, 2011 Author Share Posted May 26, 2011 Sorry, there's a little flaw with it, but I'll have an update in a min'. Solving it right now :DEDIT: Worked it out, editing main post. Link to comment Share on other sites More sharing options...
Dzastin Posted May 26, 2011 Share Posted May 26, 2011 Reply, when you have 0 in Stamima Point, stamima not +1.If frmMain.lblStam.Caption = "0" Then Player(MyIndex).Moving = MOVING_WALKING frmMain.lblStam.Caption = Val(frmMain.lblStam) + 1 Else frmMain.lblStam.Caption = Val(frmMain.lblStam) + 1 End IfRewrite with this. Link to comment Share on other sites More sharing options...
Carim123 Posted May 26, 2011 Author Share Posted May 26, 2011 @aℓνιη:> Reply, when you have 0 in Stamima Point, stamima not +1.> > If frmMain.lblStam.Caption = "0" Then> Player(MyIndex).Moving = MOVING_WALKING> frmMain.lblStam.Caption = Val(frmMain.lblStam) + 1> Else> frmMain.lblStam.Caption = Val(frmMain.lblStam) + 1> End If> > Rewrite with this.It's because when you deplete to 0, you need to stand still to replenish it. It's how I intended it to be. But I'll change it. Seeing as other people may not want the rock hard difficulty I like. xD Link to comment Share on other sites More sharing options...
Dzastin Posted May 27, 2011 Share Posted May 27, 2011 ```Private Sub timWalk_Timer()Dim Stata As LongStata = GetPlayerStat(MyIndex, Endurance) * 3If frmMain.lblStam.Caption = Stata ThenExit SubEnd IfIf InGame = True ThenIf frmMain.lblStam.Caption = "0" Then Player(MyIndex).Moving = MOVING_WALKING frmMain.lblStam.Caption = Val(frmMain.lblStam) + 1 Else frmMain.lblStam.Caption = Val(frmMain.lblStam) + 1End IfEnd IfEnd Sub```Now you have stamima based of Endurance! xD Link to comment Share on other sites More sharing options...
FinalFlame Posted May 27, 2011 Share Posted May 27, 2011 I might use this :D Link to comment Share on other sites More sharing options...
Yxxe Posted May 27, 2011 Share Posted May 27, 2011 > Now, make a timerPlease… use GetTickCount. Link to comment Share on other sites More sharing options...
Carim123 Posted May 27, 2011 Author Share Posted May 27, 2011 @Lightning:> Please… use GetTickCount.Yeah, I am. This was literally written in 5 minutes. I'll update it when I come to it. Link to comment Share on other sites More sharing options...
Grimnnak Posted May 27, 2011 Share Posted May 27, 2011 This is pretty cool, though i never really liked stamina in ES Link to comment Share on other sites More sharing options...
Helladen Posted May 28, 2011 Share Posted May 28, 2011 You already run pretty slow, this might not be very good to add. Link to comment Share on other sites More sharing options...
Repercussionist Posted May 28, 2011 Share Posted May 28, 2011 @Helladen:> You already run pretty slow, this might not be very good to add.Increase the movement speeds. Link to comment Share on other sites More sharing options...
Carim123 Posted May 28, 2011 Author Share Posted May 28, 2011 @Helladen:> You already run pretty slow, this might not be very good to add.Just saying that proves you've never read modConstants. Link to comment Share on other sites More sharing options...
adr990 Posted May 28, 2011 Share Posted May 28, 2011 Ah nice man!I was about to add that once in my game, just didn't get to it yet.Thumbs up, heh.I'm gonna test it out, -snip nvm-Thanks for sharing this tutorial, I learned from it. :) (As I didn't have any idea where to start yet actually.. lol)Edit: Works good. Though, I might do it the GetTickCount as suggested by lightning.As timers do slow down the game? (idk)I also will try and make it use the exp/hp/mp bar way, I believe there even was a whole tutorial about that, but first gonna try it myself.Edit2:@ Helladen:Find:```Sub ProcessMovement(ByVal Index As Long)```:)-=-=-Edit3:Got it working, I'm fine with what I have here.Now I wonder if I can make it some kind of stats out of it.So that if people level up, they can upgrade their Stamina.I'll go and try that. Link to comment Share on other sites More sharing options...
Carim123 Posted May 29, 2011 Author Share Posted May 29, 2011 Cool, nice to know you learned and found a use from it :D. Link to comment Share on other sites More sharing options...
adr990 Posted May 29, 2011 Share Posted May 29, 2011 Yea, I know it sounds stupid, but only until now I realized what timers are for. .. ehbtw this is what my bar looks like:(Yes, I didn't spend much time to the GUI placement, Stamina bar yet.)>! ![](http://img842.imageshack.us/img842/1324/79796248.png)>! ![](http://img52.imageshack.us/img52/7643/58363742.png) Link to comment Share on other sites More sharing options...
Carim123 Posted May 29, 2011 Author Share Posted May 29, 2011 Heh, looks cool. :DStill, isn't your GUI a bit wide?Oh, and thanks for finding a use for my Eyecatch Framework. xD Link to comment Share on other sites More sharing options...
DshWinchester Posted May 30, 2011 Share Posted May 30, 2011 hey devil,nice shootThis is much more simple to add and theres no need to delete the actual files(by changing the StatsEnum)Thanks .-. Link to comment Share on other sites More sharing options...
Fragment Posted June 28, 2011 Share Posted June 28, 2011 Just to check, this doesnt actually do anything server side does it?Because in that case this is very unreliable because someone could hack the game to have constant speed. Link to comment Share on other sites More sharing options...
Whackeddie99 Posted September 24, 2011 Share Posted September 24, 2011 @adr990:> Yea, I know it sounds stupid, but only until now I realized what timers are for. .. eh> > btw this is what my bar looks like:> (Yes, I didn't spend much time to the GUI placement, Stamina bar yet.)> > >! ![](http://img842.imageshack.us/img842/1324/79796248.png)> >! ![](http://img52.imageshack.us/img52/7643/58363742.png)I want to make a stamina bar like this guy. I actually would prefer taking out the Spirit bar and replacing it with the stamina for running. I tried to follow the path of the imgEXPBar, but I couldn't figure it out. Any help? Link to comment Share on other sites More sharing options...
evilbunnie Posted September 24, 2011 Share Posted September 24, 2011 Has anyone realised but me that this code has horrible formatting?``` If frmMain.lblStam.Caption = "0" Then Player(MyIndex).Moving = MOVING_WALKING Else frmMain.lblStam.Caption = Val(frmMain.lblStam) - 1 End If```Also anyone can just go into cheat engine and freeze that address.. Woo unlimited running. Link to comment Share on other sites More sharing options...
Carim123 Posted September 24, 2011 Author Share Posted September 24, 2011 @Captain:> Has anyone realised but me that this code has horrible formatting?Of course you aren't the only person, hence the huge warning in red on the OP. 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