Common event stamina system with hud

link12

Veteran
Veteran
Joined
May 18, 2014
Messages
63
Reaction score
7
First Language
English
Primarily Uses
RMMV
Is it possible to make this, because stamina plugins don't work with the Altimit Pixel Movement plugin?
 

ShadowDragon

Veteran
Veteran
Joined
Oct 8, 2018
Messages
2,633
Reaction score
905
First Language
Dutch
Primarily Uses
RMMV
to make a HUD with stamina, you can use 2 things (both might work)
SRD HUDMaker to create the bar and variable, (this require basic js knowledge)

but for easier use, which I use it for a timer setup, Galv_VariableBar.
you can use it very easely with a common event and works probably 100%
with altimit Pixel Movement or any oher pixel movement.

I suggest to download the demo to see how it works.
(I alter the demo for my own purposes) to test if it works in a way I needed.
but it can be used in many, many ways though.
 

link12

Veteran
Veteran
Joined
May 18, 2014
Messages
63
Reaction score
7
First Language
English
Primarily Uses
RMMV
Will this allow the player to dash for an x amount of seconds?
 

Soulrender

Jack Of All Trades
Veteran
Joined
Jan 12, 2019
Messages
805
Reaction score
438
First Language
Poland
Primarily Uses
RMMV
Yes, SRD Hud maker simply adds various elements to game screen.
 

link12

Veteran
Veteran
Joined
May 18, 2014
Messages
63
Reaction score
7
First Language
English
Primarily Uses
RMMV
Can I still create a stamina system without a plugin?
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,227
Reaction score
1,206
First Language
Spanish
Primarily Uses
RMVXA
anything involving the interface should be done by coding, not common events.
because, common events run at map level, and the interface should be above that, in programming terms.

if a given plugin doesn't work with what you have, find another plugin or try to adapt what you have.... don't simply try to bend (and potentially break) the whole system because of one thing that doesn't fit.
 

link12

Veteran
Veteran
Joined
May 18, 2014
Messages
63
Reaction score
7
First Language
English
Primarily Uses
RMMV
I meant if it was still possible to create a stamina system with no hud only through a common event.
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,227
Reaction score
1,206
First Language
Spanish
Primarily Uses
RMVXA
how would that system be displayed, with no hud?
 

link12

Veteran
Veteran
Joined
May 18, 2014
Messages
63
Reaction score
7
First Language
English
Primarily Uses
RMMV
I just asked about the hud as an option, but the main thing I want is a limited dash time for the player.
 

caethyril

^_^
Veteran
Joined
Feb 21, 2018
Messages
1,959
Reaction score
1,406
First Language
EN
Primarily Uses
RMMZ
:kaohi: Here's a little demo of a stamina system with a simple picture-based gauge. It's mostly event commands and variables, with a couple of chunky script calls:
(If you want to check it out, remember to right-click > Extract after downloading.)

Here are the event transcripts in case anyone wants those instead:
Action Button:
Code:
◆Comment:Call to turn stamina system off if it's on, on if it's off.
:       :Note that standard dashing is disabled in the map properties.
◆Comment:----------------------------------------------------------------------
◆If:Stamina System is ON
  ◆Text:None, Window, Bottom
  :    :Dash stamina system is currently enabled.
  ◆Show Choices:Enable, Disable (Window, Right, #1, #1)
  :When Enable 
    ◆
  :When Disable 
    ◆Control Switches:#0001 Stamina System = OFF
    ◆Comment:Remove gauge and background pictures
    ◆Erase Picture:#5
    ◆Erase Picture:#6
    ◆Text:None, Window, Bottom
    :    :You can no longer dash.
    ◆
  :End
  ◆
:Else
  ◆Text:None, Window, Bottom
  :    :Dash stamina system is currently disabled.
  ◆Show Choices:Enable, Disable (Window, Right, #2, #2)
  :When Enable 
    ◆Comment:Show gauge bar and background
    :       :(My background has a 2 px border, so the bar position is offset by that much)
    ◆Show Picture:#5, gaugeBack, Upper Left (596,20), (100%,100%), 255, Normal
    ◆Show Picture:#6, gauge, Upper Left (598,22), (100%,100%), 255, Normal
    ◆Comment:Initialise stamina variable and switches
    ◆Control Variables:#0001 Stamina = 300
    ◆Control Switches:#0001 Stamina System = ON
    ◆Control Switches:#0002 Breathless = OFF
    ◆Comment:User feedback and instructions for use~
    ◆Text:None, Window, Bottom
    :    :You can now dash!
    ◆Text:None, Window, Bottom
    :    :Dashing will now consume stamina.
    :    :\.Walk or stand still to recover.
    :    :\.If you get out of breath, you'll have to wait a bit
    :    :   until you can dash again.
    ◆
  :When Disable 
    ◆
  :End
  ◆
:End
Parallel:
Code:
◆Comment:Default speed 4.
:       :Set using script call so it doesn't interfere with player movement.
◆Script:$gamePlayer.setMoveSpeed(4);
◆Comment:Check if player is currently moving.
◆If:Script:var p = $gamePlayer, d = p.getInputDirection(); p.isMoving() || (d > 0 && p.canPass(p.x, p.y, d)) || $gameTemp.isDestinationValid()
  ◆Control Switches:#0003 Moving = ON
  ◆
:Else
  ◆Control Switches:#0003 Moving = OFF
  ◆
:End
◆Comment:Check if breathlessness has worn off.
◆If:Breathless is ON
  ◆Comment:Re-enable dashing after regaining some stamina
  ◆If:Stamina ≥ 150
    ◆Control Switches:#0002 Breathless = OFF
    ◆Plugin Command:EnableDashing
    ◆Comment:Undo opacity change (see below)
    ◆Move Picture:#6, Upper Left (598,22), (50%,100%), 255, Normal, 1 frame
    ◆
  :End
  ◆
:End
◆Comment:Update stamina based on current motion.
◆If:Moving is ON
  ◆If:Breathless is OFF
    ◆If:Button [Shift] is pressed down
      ◆Comment:Dashing!
      ◆Script:$gamePlayer.setMoveSpeed(5);
      ◆Control Variables:#0001 Stamina -= 8
      ◆
    :Else
      ◆Comment:Walking!
      ◆Control Variables:#0001 Stamina += 2
      ◆
    :End
    ◆
  :Else
    ◆Comment:Walking! (Out of breath.)
    ◆Control Variables:#0001 Stamina += 2
    ◆
  :End
  ◆
:Else
  ◆Comment:Standing!
  ◆Control Variables:#0001 Stamina += 5
  ◆
:End
◆Comment:Apply min/max stamina
◆If:Stamina ≤ 0
  ◆Control Variables:#0001 Stamina = 0
  ◆Comment:Also become out of breath at zero stamina, which disables dashing
  ◆Control Switches:#0002 Breathless = ON
  ◆Comment:Let's make the gauge 50% transparent while recovering!
  ◆Move Picture:#6, Upper Left (598,22), (0%,100%), 128, Normal, 1 frame
  ◆Comment:And make the player character show some emotion~
  ◆Show Balloon Icon:Player, Sweat
  ◆
:Else
  ◆If:Stamina > 300
    ◆Control Variables:#0001 Stamina = 300
    ◆
  :End
  ◆
:End
◆Comment:Rescale the stamina gauge to reflect current stamina value!
:       :Via script call to avoid a tedious number of branches. >_>
◆Comment:Script vars:
:       : - picId        is the ID of the picture you're using
:       : - duration     is how many frames the picture takes to rescale
:       : - fullScale    is the width scale of the gauge picture when full (100 = "100%")
:       : - staminaVarId is the ID of the game variable used for stamina
:       : - staminaMax   is the maximum value of the stamina variable
◆Script:var picId = 6, duration = 6, fullScale = 100;
:      :var staminaVarId = 1, staminaMax = 300;
:      :// Change the above values as needed //
:      :var scale = $gameVariables.value(staminaVarId) / staminaMax;
:      :var pic = $gameScreen.picture(picId);
:      :pic._duration = duration;
:      :pic._targetScaleX = fullScale * scale;
◆Comment:Repeat again in 1/10 second = 6 frames.
◆Wait:6 frames
 

link12

Veteran
Veteran
Joined
May 18, 2014
Messages
63
Reaction score
7
First Language
English
Primarily Uses
RMMV
Thanks for the solution.
 

ShadowDragon

Veteran
Veteran
Joined
Oct 8, 2018
Messages
2,633
Reaction score
905
First Language
Dutch
Primarily Uses
RMMV
scaling a picture is tricky part though, while scaling down, it can go out of the box,
Galv_Variables avoid this part, but there are alot of nice methodes with only events.

if you want it simple with a simple scriptcall, a plugin is better than eventing.

Eventing can go many many ways, while plugins runs things way smoother (but cannot always
created in some ways)

the choice is your really :)

Good luck on your project.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

gonna record the beginning of my game if anyone is interested in seeing it message me for the link it's going to be unlisted on youtube
Dev stream today, come on by and ask questions about rpg maker!
Fun fact: If your story introduces a variety of different races, the "human race" will automatically become the most corrupt race in general.
Finally finished my late start entry for the jam. Now. I. Sleep.
Just made 3 easy, simple and small MZ plugins today(12 hours straight), and I never thought I could ever do this.
Now I feel myself being very productive, even though I know I'm just utterly flattering myself lol

Forum statistics

Threads
104,648
Messages
1,007,821
Members
136,133
Latest member
Cashews
Top