Silver's Dash Stamina

● ARCHIVED · READ-ONLY
Started by SilverDash 151 posts Page 1 of 8 View original ↗
  1. Script name: Dash Stamina v2.05
    Author: Squirting Elephant

    JgGgpFL.png

    Features:
    Features
    - Disables dashing on the map when you run out of stamina.
    - Items can replenish, lower, refill, deplete and change maximum stamina (only from the menu, not during battle).
    - Has a stamina threshold so you don't automatically start dashing again at 1 stamina.
    - Comes with an optional stamina bar with an optional percentage value in it.
    - Can optionally automatically hide the stamina window.
    - The bar changes color depending on the stamina value (NOT a gradient!).
    - Does not consume stamina when the player can not walk (example: attempts to dash into a wall).
    - Optional: slide the stamina window in/out instead of just hiding it.
    - Optional: make the stamina's window invisible but not the stamina bar (use opacity parameter).
    - Optional allow the stamina regen to increase in speed the longer you let it consecutively regenerate using a custom function in a parameter.
    - Disable stamina consumption on specific maps (like overworlds) by using a map notetag.
    - Disable stamina consumption by using a gameswitch.
    - Increase/decrease max stamina.
    - Optionally show the value, percentage, both or none of the current stamina in the stamina bar.
    - The window can hide it self automatically during dialogs.
    - Max stamina can be manually set in case you'd like to control the max stamina yourself.
    - Window can be made invisible so you only see the stamina bar (use opacity parameter).
    - You control how the stamina regenerates with a custom parameter-equation.
    - Can show custom text in front of the stamina-gauge.
    - Can disable dashing entirely on a map (with map-notetag and plugins commands).
    - Etc. etc. etc.


    Script:
    Download v2.05
    Download Master Demo

    License:
    License: Attribution 4.0 International (CC BY 4.0) (https://creativecommons.org/licenses/by/4.0/)


    Old Versions:
    Old versions
    Download v2.03
    Download v2.00 (pastebin)
    Download v1.21
    Download v1.10
    Download v1.09
    Download v1.08
    Download v1.07a
    Download v1.07
    Download v1.06
    Download v1.05
    Download v1.04
    Download v1.03
    Download v.1.02
    Download v.1.01
    Download v.1.00

    Note: The plugin-addon below is not compatible with Dash Stamina v2.00 or higher.
    Download (optional) Game Variable addon v1.01
    Download (optional) Game Variable addon v1.00
  2. Loving this plugin so far, I always felt there should be some limitations to the dashing! now there is thank you!

    may I suggest some features?

    It would be really cool if you could show the text "Stamina" or "Stamina Bar" in the window just for the visuals!

    also how about you could use <stamina refill> note tag in the items notebox so you could find/craft/make stamina potions?

    anyway great work! keep it up
  3. Not sure about potions, I would have to make a key-binding so you can quickly & instantly refill stamina while running (which requires a dependency script :( ), or maybe give unlimited stamina for x-tiles instead. But would anyone really want to buy it as a player? They would have to be dirt-cheap. Unless of course you make a topdown hack 'n slash game.

    But maybe potions that increase max-stamina up to a certain limit.
  4. Hey, just downloaded this, and I can't get it to work. As soon as I try to run my game, it crashes and gives me "ReferenceError: x is not defined"


    Does this even with no other scripts enabled.
  5. Great plugin. This feature is nearly essential for anyone building onscreen encounters since it enables the player to be faster than the enemy while dashing and slower when walking in a meaningful way.

    I encountered the same bug as the previous poster. Simple fix:

    Line 617

    x = 0;

    replace

    var x = 0;

    Line 619

    y = 0;

    replace

    var y = 0;

    Line 584

    || x >

    replace

    || this.x >

    Line 585

    || x >

    replace

    || this.y >

    One suggestion, you may want to consider adding some plugin commands or provide javascript examples on how to extract dashing values for use in other code. Example, in an enemies on map game, one might want to force a surprise encounter if the player encounters an enemy while out of stamina.

    Can you confirm js below is correct or make recommendations for how to extract the information below:

    $gamePlayer.dashStamina; //returns current stamina

    ($gamePlayer.dashStamina == 0 || ( !(gamePlayer.wasDashing) && $gamePlayer.requiresThresholdAmount )); //returns true if low stamina is preventing dashing, otherwise returns false

    Thanks!

    -DCF
  6. Thanks DCF, that fixed it for me!
  7. Thanks for reporting that. This happens because RPG Maker has a problem/bug with strict-mode. Crashes on some platforms, not on others. I recently fixed this in my other plugins but forgot it for this one. Sorry.

    Update:

    v1.01 (1 December 2015)
      - Removed strict-mode because... Possible bug in RPG Maker...
      - Refactored and fixed semicolons and missing var-keywords.

      - Added $gamePlayer.dashingAllowed() so other scripts can check it as well.

    Can you confirm js below is correct or make recommendations for how to extract the information below:

    $gamePlayer.dashStamina; //returns current stamina

    ($gamePlayer.dashStamina == 0 || ( !(gamePlayer.wasDashing) && $gamePlayer.requiresThresholdAmount )); //returns true if low stamina is preventing dashing, otherwise returns false
    Both confirmed. But I made you a function instead now:

    Code:
    $gamePlayer.dashingAllowed()
  8. Strict mode works fine for all of my plugins in multiple browsers and "desktop" version. Just remember to initialize every variable with "var" and you should be safe.
  9. Iavra said:
    Strict mode works fine for all of my plugins in multiple browsers and "desktop" version. Just remember to initialize every variable with "var" and you should be safe.
    It does not work properly (for me). See my topic about it: http://forums.rpgmakerweb.com/index.php?/topic/51603-use-strict-mode-unreliable/

    So I rather just remove it. Crashes on some platforms, not on others. There are some 'workarounds' but still the fact that it behaves different depending on platform or even PC used, is enough reason for me to scrap it.

    Could make a video to proof it but why bother. It simply is not 100% reliable. It may work for you and maybe for 20 other people. The one exception is enough reason to not use it.
  10. SilverDash said:
    Thanks for reporting that. This happens because RPG Maker has a problem/bug with strict-mode. Crashes on some platforms, not on others. I recently fixed this in my other plugins but forgot it for this one. Sorry.

    Update:

    v1.01 (1 December 2015)

      - Removed strict-mode because... Possible bug in RPG Maker...

      - Refactored and fixed semicolons and missing var-keywords.

      - Added $gamePlayer.dashingAllowed() so other scripts can check it as well.

    Both confirmed. But I made you a function instead now:

    $gamePlayer.dashingAllowed()
    Thanks, I've tested the new version and it works without modification. Also, thank you for adding the function. That's a big help!

    -DCF
  11. This is a really nice script, thank you so much!

    Is there a way to call the stamina amount into a variable so I can display it alongside others in the OrangeHud?
  12. UPDATE (parameters were changed)

    v1.02 (12 December 2015)
      - Dashing for the current map can now be entirely disabled with a map-notetag and switched with a plugin command at any time.
      - Created a simple plugin addon to store the player-stamina in a global game-variable.
      - Enabled custom text to be drawn in front of the Stamina Window.
      - New feature: items can replenish, lower, refill and deplete stamina and change the maximum stamina (only in the menu, not in battle).

    Is there a way to call the stamina amount into a variable so I can display it alongside others in the OrangeHud?
    I added it in v1.02 if you also use the new addon.

    Yuudai said:
    may I suggest some features?
    It would be really cool if you could show the text "Stamina" or "Stamina Bar" in the window just for the visuals!

    also how about you could use <stamina refill> note tag in the items notebox so you could find/craft/make stamina potions?
    Also added in v1.02
  13. Wow, I had no expectations for this to be added so fast ... unreal! Thank you so much!

    I've added the additional plugin and have set it to store in variable 2 which I have titled Stamina, I have then added a new Orangehud line but it doesn't seem to be showing up in the game ... My first custom Orangehud line does.

    ** SOLVED THIS BIT **

    I used the Orangehud multiple variables plugin and bingo it all works beautifully! Thank you!

    Screen Shot 2015-12-07 at 20.13.16.png

    Screen Shot 2015-12-07 at 20.13.24.png
  14. Oops, sorry - last one I promise!!!

    Can we decrease the stamina useage by a decimal value - such as 0.25? I've changed the max stamina value to be 100 so that I can put it as a percentage, and now it runs out way too quick :p
  15. No you can't. It parses integers (whole numbers) all over the place.

    What you can do however is just set the max-stamina value to 10.000 (100x100). Basically you just multiply your percentage x100 too. so 0.25 becomes 25. Also make sure to adjust the algorithm for regenerating stamina then and the result should be the same as using percentages.
  16. SilverDash said:
    UPDATE (parameters were changed)

    v1.02 (12 December 2015)

      - Dashing for the current map can now be entirely disabled with a map-notetag and switched with a plugin command at any time.

      - Created a simple plugin addon to store the player-stamina in a global game-variable.

      - Enabled custom text to be drawn in front of the Stamina Window.

      - New feature: items can replenish, lower, refill and deplete stamina and change the maximum stamina (only in the menu, not in battle).
    Thank you very much! awesome update! :D

    Is there any way to adjust the X position of the Text? I would like to put it above the gauge if possible.
  17. No I'm sorry, full control over positioning of the text is not (yet) supported. It would require quite a bit of extra parameters and I didn't know people want the text so customized. Maybe next version.
  18. Oh okay no problem I will wait for it  B)
  19. Update v1.03 (01 January 2016)
    - Used my new coding standards & refactored.
    - Switched to the Imported variable.
    - Fixed an accidental duplicate alias.
    - Fixed a bug in Scene_Map.prototype.updateMain() (which just so happened to cause no side-effects).

    The new code works the same as the old one, but performs better. For the end-user, nothing really changed but I would recommend to use this new version instead.
  20. Hi there SilverDash, i'm running into an issue with events causing a fadeout with the updated version of the script ... it's giving the old 'null' error message.