Silver's Dash Stamina

SilverDash

Veteran
Veteran
Joined
Oct 11, 2015
Messages
393
Reaction score
156
First Language
Dutch
Primarily Uses
RMMV
I uploaded a new version: 2.03:
- Bugfix: Fixed a crash when using the Stamina Game Variable ($gamePlayer is sometimes null).
- Bugfix: if the "Window Slide-out Direction" parameter was set to Disabled, the stamina window would never appear ingame.
- Added a new PluginCommand: Stamina Regen <option>.
Hello there!
1st: thank you so much Silver for this amazing plugin!
I'm just looking for a script command or something to block the stamina regen. Could you help me finding that? Putting the recovery rate at 0 maybe?
I added a new plugin command for you in version 2.03. I did this rather quickly and did not test it much so please let me know if there are any problems:
Stamina Regen <option>
[option] can be either: enabled, true, disabled, false, toggle
Examples:
Stamina Regen Enabled
Stamina Regen Disabled
Stamina Regen Toggle


Hey Silver! Thank you so much for the amazing plugin! Thank you for the fix : the stamina windows now appears properly.

However, I noticed 2 bugs in your awesome plugin:

1. When you chose the disable option for the window sliding motion, the stamina window would not appear in game

2. When you chose to hide the stamina window at max - For Ex: If I choose 30 frames, the window would hide after 30 frames even though it is not at max stamina and would reappear to regenerate to max then would hide after 30 frames.

Both of the bugs can be replicated in the Demo file along with the 2.01 version.

Thanks again for your awesome work!

Yeye on est la
1. Fixed in version 2.03
2. Not a bug but intended. If you lower that parameter to 30 frames then you should also lower the "Stamina Recovery Delay" parameter to 30. However, I can see how this can be confusing. At this point in time, I don't have enough personal time to improve this properly so, for now, I'll leave this be.


Is there a way to reduce the stamina manually through script or plugin commands? I see you can do it through items, but I would like to do it through an event
Yes you can deplete, refill or set an exact (or even a percentage) value, set it to a game variable, etc. using the plugin commands as described in the help section of the plugin.


When I try to use the Variable option in the plugin I receive an errror saying "Cannot read property 'dashStamina' of null". It happens both in my game and in your demo, so I'm pretty sure I messed something up when I updated my RPGMV, any chance you know what that could be?

View attachment 127170
Sorry, it was a bug and it's fixed in version 2.03. Please download the new version and if it still persists, please let me know.
 

e463gx

Villager
Member
Joined
Sep 26, 2013
Messages
10
Reaction score
1
Primarily Uses
Thanks for the quick update!

It now lets me get into the game, but I still can't get the variable to work, it just acts as if they are unrelated. I have a very primitive ABS system, and I'd like it to remove stamina when melee attacking.

Basically using "Control Variable" Sub 30 from the variable identified in the plugin settings, but nothing happens.
 

SilverDash

Veteran
Veteran
Joined
Oct 11, 2015
Messages
393
Reaction score
156
First Language
Dutch
Primarily Uses
RMMV
If you set the variable to a number higher than 20 (MV by default comes only with 20), please make sure that you also have that many variables set in RPG Maker MV. To set it:
Otherwise, nothing happens. I tested it here and it works fine for me when I set it to 30. You can test this by pressing F9 and check the variable. You can also type this in the console to check the value:
Code:
$gameVariables.value(30)
 

e463gx

Villager
Member
Joined
Sep 26, 2013
Messages
10
Reaction score
1
Primarily Uses
Sorry for being a pain!

Using the console I see that the variable is changing, the problem I'm running into is that it's not reflecting in the Stamina Bar, nor is it recharging back to normal.

Example:
  • MAX Stamina = 300. When I dash it works perfectly and reflects in the bar, variable also changes based on dash use.
  • Using my attack I want to reduce the variable by 50 - making it so the user can't attack when stamina is below a certain point, and make it so that attacking also depletes stamina.
  • Attacking reduces the variable by 50 as required, but does not reflect in the stamina bar, nor does it recharge like it does when I stop dashing.
  • Furthermore, even when the variable is at 0 the stamina bar still shows full, and my character can still dash, which instantly puts the variable back to MAX.
Hope this makes sense!
 

SilverDash

Veteran
Veteran
Joined
Oct 11, 2015
Messages
393
Reaction score
156
First Language
Dutch
Primarily Uses
RMMV
Uploaded version 2.04:
v2.04 (14 November 2019)
- Bugfix: The stamina variable is (if parameter "Game Variable Number" is > 0) now set when starting a new game.
- 5 new plugin commands: "Stamina SetAbs <value>", "Stamina Increase <value>", Stamina Decrease <value>, "Stamina IncreaseAbs <value>" and "Stamina DecreaseAbs <value>".

@e463gx
That's intended because that game-variable is meant as a read-only variable for users who can't Javascript. I added that a long time ago upon request. You can't set the stamina through that variable. You'll have to use the plugin commands for that. The description of that parameter says:
Use a value of 0 to disable this. The GameVariable # to store the current stamina value into.
My English is not 'that awesome' so I'm sorry if it's confusing.

I added some extra plugin commands in 2.04 that you might find useful for manipulating the stamina.
If you are a scripter, you can also directly manipulate the stamina through code:
Code:
if ($gamePlayer !== null) { $gamePlayer.setStamina(<your absolutevalue>); }
if ($gamePlayer !== null) { $gamePlayer.setStaminaByPerc(<your % value>); }
// Note: I can't guarantee future compatibility if you don't use plugin commands because future refactoring may change function names so be sure to use a wrapper for easy updating later.
// Note: DON'T change the $gamePlayer.dashStamina value directly through code! Use the above functions instead, or better, just use the PluginCommands.
 
Last edited:

e463gx

Villager
Member
Joined
Sep 26, 2013
Messages
10
Reaction score
1
Primarily Uses
This is Perfect, works like a charm!

The new plugin commands are exactly what I needed, thanks a lot Silver!
 

TenTranVN

Veteran
Veteran
Joined
Apr 13, 2017
Messages
151
Reaction score
16
First Language
Vietnam
Primarily Uses
RMMV
can use image change bar default ?
 

Kire

The Dimension Traveler
Member
Joined
Aug 17, 2012
Messages
28
Reaction score
1
First Language
Portugues
Primarily Uses
Hey SilverDash, I have been trying to disable the stamina window permanently ( using a custom hud for it through the variables), however, if I set the parameter that says Show Stamina Window to false I get an error saying "Cannot read property 'wSliding' of null". I'll attach a screenshot of the console.

Thanks in advance.
Annotation 2020-01-06 010459.png
 

SilverDash

Veteran
Veteran
Joined
Oct 11, 2015
Messages
393
Reaction score
156
First Language
Dutch
Primarily Uses
RMMV
@Kire
I fixed it in v2.05 which I uploaded just now.

v2.05 (06 January 2020)
- Fixed a crash when the ShowStaminaWindow parameter was set to false.
I'm not using RPG Maker MV myself at the moment but I'll try to keep my scripts fixed and up2date but sadly due to this, some things go untested or unnoticed by me until someone reports it. So just keep reporting them.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Started playing Danganronpa 3 in French - Eyes started bleeding in less than 5 minutes - Installed English text instead.
Why, translator, whyyyy???
-_- Now we have punishments for skipping meals, specially breakfast. At least let me sleep on Fridays -_-
colorize an old sketch
Welp... with numerous plugins and a bit of Javascript help, I've simulated an AP system in battle. Proud of myself honestly.
Why most of games like to give a horrible control to an aircraft vehicle? can I get a simplified control that does not require me to roll first just to change my direction?

Forum statistics

Threads
93,433
Messages
912,336
Members
122,945
Latest member
Charliegn
Top