Silver's Dash Stamina

SilverDash

Veteran
Veteran
Joined
Oct 11, 2015
Messages
423
Reaction score
170
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
423
Reaction score
170
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
423
Reaction score
170
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
165
Reaction score
17
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
423
Reaction score
170
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.
 

Ewaldar

Villager
Member
Joined
Sep 25, 2013
Messages
27
Reaction score
3
First Language
French
Primarily Uses
Hi,
Thank you for that awesome plugin ;) Works really fine, I'm happy about it !!

I do have a question about it, though : Is it possible to restore stamina only when the player is idle ?

Thanks mate
 
Last edited:

Ewaldar

Villager
Member
Joined
Sep 25, 2013
Messages
27
Reaction score
3
First Language
French
Primarily Uses
Re,

Thanks for replying ;) Another question for you : "Common Event at Stamina value parameters" I dont understand it or it's not working.
I'd like to do the following thing : If Stamina is at 100% run fastest, if Stamina is 50% run faster, if Stamina is 15%, run normal.
stamina: 100% 28 50% 29 15% 30 (I put that in the plugin parameters). Then, in the Common Event I changed the value of the player accordingly to the parameters. Nothing happens !
So, I tried that : stamina: <=100% 28 <=50% 29 <=15% 30. Not working either.

Could you explain me how it works or why it doenst ?
Thanks mate
 

SilverDash

Veteran
Veteran
Joined
Oct 11, 2015
Messages
423
Reaction score
170
First Language
Dutch
Primarily Uses
RMMV
It seems to work as intended.

Then, in the Common Event I changed the value of the player accordingly to the parameters.
What value specifically? It seems like you are more or less trying to extend my script.

stamina: <=100% 28 <=50% 29 <=15% 30
You use this setting wrong. You cannot use operators. Only absolute and relative values as shown in the examples in the description of that parameter are supported as it was requested by someone some time ago.
 

Ewaldar

Villager
Member
Joined
Sep 25, 2013
Messages
27
Reaction score
3
First Language
French
Primarily Uses
Hello,
I try with that first : stamina: 100% 28 50% 29 15% 30 But nothing happens !
I changed the value of the speed of the players, but nothing happens, too ;(

I will edit and post a picture of what I did, so its gonna be easier for you.

EDIT :
Error.png
 
Last edited:

SilverDash

Veteran
Veteran
Joined
Oct 11, 2015
Messages
423
Reaction score
170
First Language
Dutch
Primarily Uses
RMMV
Oh haha I see. The text "stamina: " should not be included in those settings.
Sadly RPG Maker MV doesn't give me enough space for my descriptions and not enough options for parameters so it can look confusing. ONLY enter the values like this:
Code:
100% 28 50% 29 15% 30
 

Ewaldar

Villager
Member
Joined
Sep 25, 2013
Messages
27
Reaction score
3
First Language
French
Primarily Uses
I feel a bit dumb ;)
It works ! Now, I just have to configure my Comon Event and it will be great.

Again, thank you for the fast and nice answers !!

EDIT : It's me, again haha. Is there a way to change the running speed ? All I can do is change the speed of normal walking. What I have in mind is at the beginning, you run very fast, then fast, then normal speed. I found a speed manager plugin, but there is no option to change in-game.
 
Last edited:

SilverDash

Veteran
Veteran
Joined
Oct 11, 2015
Messages
423
Reaction score
170
First Language
Dutch
Primarily Uses
RMMV
This question seems to be unrelated to my plugin. The speed manager plugin should be able to change movement speed for dashing and even has a parameter for it. If you can't change this during gameplay then you should ask the author of that script instead or request a new script.
 

Ewaldar

Villager
Member
Joined
Sep 25, 2013
Messages
27
Reaction score
3
First Language
French
Primarily Uses
Would it be possible to add that feature ? Or is it too complex for your plugin ? If this is, I will adress to the author of the other plugin and leave you in peace ;)
 

SilverDash

Veteran
Veteran
Joined
Oct 11, 2015
Messages
423
Reaction score
170
First Language
Dutch
Primarily Uses
RMMV
It could be added but in my opinion, it belongs in a separate plugin. It should be very easy to make but it still costs time. If there's more demand then I could make one but if it's just you, I'm sorry you could either hire me or try to find another solution as it's too time-consuming and I'm already working on my minimap and various other projects.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

RM MV ACE? 2020? Super? Legends? Sword and Shield? 2.5D? RM Pixel? RM 2: Revenge of Squared RTP tiles? Don't mind me, I'm just wondering about what will be the name of the next engine.


So I came up with a new look for the paths, and along the way realized health bars are so overrated, so now a crazy red light trail follows her and gets shorter as her life decreases. :LZSexcite:
Stream will be live shortly with a session of the Interactive Text Adventure! Feel free to drop by!
Am I allowed to make a recruitment thread NOT for RPG Maker stuff?

Like for a group project?
(NOT RPG Maker project.)
If the new RPG Maker's character generator produces full busts and can match the art styles of previous RPG Makers, that might be a big incentive to buy it. An easier way to craft custom map tile sheets though would probably be an even bigger game changer.

Forum statistics

Threads
98,204
Messages
950,324
Members
129,501
Latest member
zendabbq
Top