athosfranco

Regular
Regular
Joined
Apr 30, 2014
Messages
54
Reaction score
9
First Language
Portuguese
Primarily Uses
Hi. My engine is RPG Maker MV.

Im using two plugins:
Silver's Dash Stamina (by Squirting Elephant) (It makes the dash ability limited by stamina)
Galv's Jump Ability by Galv (The player can jump by pressing a key)

However, theres no way to limit the amount of times the player can jump. I want to make the jump action cost 25% of total stamina, and if the player's stamina deplete, he cant dash or jump.

Can someone help me with that?

Here's both plugins:

 

Attachments

  • GALV_JumpAbility.js
    10.7 KB · Views: 0
  • SE_DashStamina.js
    68.7 KB · Views: 0

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
12,652
Reaction score
11,165
First Language
English
Primarily Uses
RMMV
Reading through the DashStamina, the values are stored in $gamePlayer.dashStaminaMax and $gamePlayer.dashStamina. So...in GALV_JumpAbility, go to line 183, and edit it to look like this:
Code:
if (this.canMove() && Input.isJumpTriggered('jump') && ($gamePlayer.dashStamina/$gamePlayer.dashStaminaMax>.25)) {

Then, at the end of the next function (do_jump), add:
Code:
$gamePlayer.decreaseStamina(25);
 
Last edited:

athosfranco

Regular
Regular
Joined
Apr 30, 2014
Messages
54
Reaction score
9
First Language
Portuguese
Primarily Uses
1622678390414.png

Thanks a lot for your help. Unfortunately, it's not working. :(

EDIT: I recorded what happened after i applied what you told me to do. .

As you can see, there is a 'delay' between the jump and the eventual decrease in stamina. My goal is that each jump consumes 25% of the total stamina, that is, if the player has 100% stamina, he can do 4 consecutive jumps before having to wait for the stamina to charge again.
 
Last edited:

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
12,652
Reaction score
11,165
First Language
English
Primarily Uses
RMMV
Thanks a lot for your help. Unfortunately, it's not working. :(
That is not the instructions I gave you. I told you to add the second line at the end of the do_jump function. Not in the moveByInput function where it says do_jump.

So scroll down to line 196, press Enter, put that new line of code in there.

Also, I misread or mistyped or something...I made it check for 25 percent, but spend 25 points. So that line should read:
Code:
$gamePlayer.decreaseStamina($gamePlayer.dashStaminaMax*0.25);
 

athosfranco

Regular
Regular
Joined
Apr 30, 2014
Messages
54
Reaction score
9
First Language
Portuguese
Primarily Uses
Now its working! It decreases 25% of stamina when the player jumps. Thank you very much.

There's just one more problem - the value shown in the hud (top left corner) doesn't update after the jump. The hud only updates when the player runs (which is the traditional way in which stamina is reduced). That is, if I take two jumps, the top left corner will still show 100%. Then when the player runs, it instantly goes to 50%.

I hope it's not asking too much, but if you have the time and can help me with that, I would be very grateful!
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
12,652
Reaction score
11,165
First Language
English
Primarily Uses
RMMV
It would've been smart for the plugin author to make that go automatically :stickytongue:

But try this...after the decreaseStamina bit that you added, add one more line and put $gamePlayer.updateStamina();
 

athosfranco

Regular
Regular
Joined
Apr 30, 2014
Messages
54
Reaction score
9
First Language
Portuguese
Primarily Uses
It works perfectly. Thank you very much, my friend.
 

Latest Threads

Latest Posts

Latest Profile Posts

I've made a big emphasis on visually representing things to make the game as accessible as possible.

MP.png

Grimoires will consist of 5 - 10 pages of skills (still finalizing that max number)

Since each actor is able to take multiple actions per turn, each skill will cost 1-5 pages
This prevents more powerful skills from being uber spammed during an actors turn.
Cats are so easy. I noticed the gray one would never nap in the office while I worked, so I put a blanket on the spare chair in here and now she won't leave.
1701793108356.png
still work in progress, had not much time at the weekend^^
Oh deer! Have you checked my calendar today already? ;3
1701790624587.png
Whenever the site tells me this, I feel like it's being intentionally antagonistic. Like, just freaking round down!

1701784620294.png

Forum statistics

Threads
136,765
Messages
1,269,682
Members
180,510
Latest member
Nillaw
Top