QUOTE (Night_Runner @ Apr 8 2012, 05:07 AM)

Well, you could change it to:
CODE
def dash?
return false if $game_variables[10] == 0
return false if @move_route_forcing
return false if $game_map.disable_dash?
return false if vehicle
return Input.press?(:A)
end
And that would stop dashing when variable 10 (the one I have set up for stamina) reaches 0.
Then you just need to have an event that increases your stamina variable by 1 every few frames.
Building off of this,
I could try to event this for you,
It seems simple,
use a parallel process called Stamina_System. with control swith [STAMINA_SYSTEM_SWITCH]
make a loop.
LOOP
add a CONDITIONAL
if button pressed [SHIFT] or whatever the button is.
Wait 15 frames (I want 4 stamina per second)
control variable [010 STAMINA] -=1
else (Button not pressed, recover stamina)
if variable STAMINA < MAX_STAMINA (We don't want infinite stamina)
Wait 60 frames (We are going to recover 1 stamina per second)
control variable [010 STAMINA] +=1
else
We have max stamina so nothing here
end branch
end branch.
repeat above
Now if you combine it with what Night_Runner
said.. you should have a system that controls stamina
now, lets add in a PUNISHMENT
if the player runs out of stamina, lets prevent stamina from recovering for..5 seconds
Lets take our previous common event and add in a conditional we want this at the top
LOOP
if variable [010 STAMINA] == 0
wait 300 frames
end branch
//This branch will prevent the remaining conditionals to activate, preventing Stamina recovery for 5 seconds
// 60Frames / Seconds 60* 5 = 300
if button pressed [SHIFT] or whatever the button is.
Wait 15 frames (I want 4 stamina per second)
control variable [010 STAMINA] -=1
else (Button not pressed, recover stamina)
if variable STAMINA < MAX_STAMINA (We don't want infinite stamina)
Wait 60 frames (We are going to recover 1 stamina per second)
control variable [010 STAMINA] +=1
else
We have max stamina so nothing here
end branch
end branch.
Repeat Above
I'm in class right now so I'll test this when I get back.
I'll also clean this up and give you a demo..
I'm still relatively new to eventing.
(Though I did make my own Date/Time/Night/Day system with days of week and stuff)
It all works great.
Not sure how to display it as a bar in the menu. but it's simple
http://www.mediafire.com/?m11d0dp1o0x6w85