Jump to content
Nicke

XS - Stamina System

Recommended Posts

xs.png

XS - Stamina System

Version 1.0c

Introduction
This script will add a Stamina System to the game. It will effect how long the player can dash around the map.

Features

  • Control the stamina easily with built in methods or with variables.
  • An HUD that will show the stamina values to the player. (Fade effect)
  • Custom pictures for the gauge.
  • Items can also effect the stamina. You can make a potion that will permanently increase max stamina etc.
  • Both the system and the HUD can be enabled/disabled by a switch ingame.
  • And more!

Screenshots
xs-stamina-system.png
 

xs-stamina-system2.png

How to Use
Instructions how to use it can be find inside the script.
To install this script, open up your script editor and copy/paste this script to an open slot below Materials but above Main. Remember to save.

Script
Get the script here.

Put these above: Core Script and the Numeric Class.

Optional: Download example pictures for the HUD. Need to be located in "Graphics/Picture" folder.

Updates
Released 1.0c:

  • Fixed a bug where the window/pictures would sometimes create itself more then once which would cause lag.
  • And more minor bug fixes.

Credit
Do credit me, Nicke, if you are planing on using this script. Thanks.
Can be use in a commercial project.

Edited by Nicke

Share this post


Link to post
Share on other sites

I've only recently found out about your scripts but they are AMAZING :), you seem to have everything I need already scripted out.

Anyways to the question, is there a way to make this script rely only on variables and disable the dash part of the script?

Well done and keep up the awesome work  :lol: .

Share this post


Link to post
Share on other sites

Hi,

 

It seems I've a compatibility problem with your script and Moghunter weather script.

 

 

Here's the bug report :

mini_671238bug.gif

 

 

This is the "bugged" line :

 @stamina = (@stamina + value).clamp(0, @max_stamina) if operator == :add

 

Here're the scripts :

MOG_Weather_EX : http://pastebin.com/MhrGe9MB

Share this post


Link to post
Share on other sites

I seem to run into an error whenever I attack or guard in battle when using this script.

 

Script 'XS - Stamina System' line 220: NoMethodError occurred.

 

undefined method `stamina' for #<RPG::Skill:0x7dfe6a0>

 

 

Sorry if it's a rookie error, I'm rather new to this whole thing. Anyways, when I removed these lines 207 - 224 of the script, I no longer got that error. And I'm just using it for the run energy, however it's nice to have options and I don't know the consequences of removing those lines of script. Any help would be appreciated if you can.

Edited by Warinabottle

Share this post


Link to post
Share on other sites

I seem to run into an error whenever I attack or guard in battle when using this script.

 

Script 'XS - Stamina System' line 220: NoMethodError occurred.

 

undefined method `stamina' for #<RPG::Skill:0x7dfe6a0>

 

 

Sorry if it's a rookie error, I'm rather new to this whole thing. Anyways, when I removed these lines 207 - 224 of the script, I no longer got that error. And I'm just using it for the run energy, however it's nice to have options and I don't know the consequences of removing those lines of script. Any help would be appreciated if you can.

 

I had the same issue, and *hopefully* fixed it by adding , after this code...

class RPG::Item < RPG::UsableItem
  
  def stamina
    # // Method to add stamina attribute for items.
    @note.scan(/<(?:STAMINA|stamina):\s(\d+)>/i)
    return ($1.to_i > 0 ? $1.to_i : 0)
  end
  
  def max_stamina
    # // Method to add max stamina attribute for items.
    @note.scan(/<(?:MAX_STAMINA|max_stamina):\s(\d+)>/i)
    return ($1.to_i > 0 ? $1.to_i : 0)
  end

end

...This code:

class RPG::Skill < RPG::UsableItem
  
  def stamina
    # // Method to add stamina attribute for items.
    @note.scan(/<(?:STAMINA|stamina):\s(\d+)>/i)
    return ($1.to_i > 0 ? $1.to_i : 0)
  end
  
  def max_stamina
    # // Method to add max stamina attribute for items.
    @note.scan(/<(?:MAX_STAMINA|max_stamina):\s(\d+)>/i)
    return ($1.to_i > 0 ? $1.to_i : 0)
  end

end

I suppose this code is to notetag itens/skills to increase stamina on use. I'm an absolute beginner on RGSS3, so use this with extreme care

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
Top ArrowTop Arrow Highlighted