Silver's Dash Stamina

Discussion in 'JS Plugin Releases (RMMV)' started by SilverDash, Nov 26, 2015.

  1. SilverDash

    SilverDash Veteran Veteran

    Messages:
    392
    Likes Received:
    156
    First Language:
    Dutch
    Primarily Uses:
    RMMV
    I uploaded a new version: 2.03:
    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:


    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.


    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.


    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.
     
    yeye on est la likes this.
  2. e463gx

    e463gx Villager Member

    Messages:
    10
    Likes Received:
    1
    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.
     
  3. SilverDash

    SilverDash Veteran Veteran

    Messages:
    392
    Likes Received:
    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:
    [​IMG]
    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)
     
  4. e463gx

    e463gx Villager Member

    Messages:
    10
    Likes Received:
    1
    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!
     
  5. SilverDash

    SilverDash Veteran Veteran

    Messages:
    392
    Likes Received:
    156
    First Language:
    Dutch
    Primarily Uses:
    RMMV
    Uploaded version 2.04:

    @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:
    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: Nov 15, 2019
  6. e463gx

    e463gx Villager Member

    Messages:
    10
    Likes Received:
    1
    This is Perfect, works like a charm!

    The new plugin commands are exactly what I needed, thanks a lot Silver!
     
    SilverDash likes this.
  7. TenTranVN

    TenTranVN Veteran Veteran

    Messages:
    149
    Likes Received:
    16
    First Language:
    Vietnam
    Primarily Uses:
    RMMV
    can use image change bar default ?
     
  8. SilverDash

    SilverDash Veteran Veteran

    Messages:
    392
    Likes Received:
    156
    First Language:
    Dutch
    Primarily Uses:
    RMMV
    I'm sorry I don't understand the question.
     

Share This Page