Gauge Action System

procraftynation

Master Procraftynator
Veteran
Joined
Oct 24, 2015
Messages
32
Reaction score
70
First Language
English
Primarily Uses
N/A
Gauge Action System v2.02


by Procrafynation


Description


Gauge Action System captures the OK button pressed down and fills the gauge until the OK button is released. The gauge is emptied when the OK button is released. Only the system will stop when the lifetime specified is consumed and results are determined.

As of this 2.01, there are 3 types of gauge:

  1. Filling - default. The gauge is being filled when OK button is pressed and emptied when OK button is released.
  2. Moving Cursor - Instead of filling and emptying the gauge, the cursor moves along the fill image and waits for OK button to be pressed at a specified success point.
  3. No Action - only requires lifetime. Like a casting gauge only. If a success point is specified, a random result will be determined using success point as percentage of success.

Terms of Use

Free for use in non-commercial and commercial games just give credit and link back to https://github.com/procraftynation/RMV.



Download


Plugin File


Demo Files - Create a new project and paste these files in to your project.




Plugin Documentation

Spoiler



 



============================================================================
IMAGE COMPONENTS
============================================================================
1. Fill - part of a gauge that displays how much it is filled.
2. Cursor - part of a gauge that indicates where to fill only (range)
3. Lifetime - similar to Fill image but is filled based on the lifetime specified
4. Background - for aesthetics. Rendered first
5. Foreground - for aesthetics. Rendered last
============================================================================
USAGE
============================================================================
To setup a gauge, create an event with a script call:
  $gameSystem.gauge("gaugeId");
  Replace 'gaugeId' to any text. This is used for identifying and managing multiple gauges
(see Chained Functions Reference for setup options)
Determining Results:
  Depending on the type, the results can be placed on a variable: 
     1 - success, 2 - failure, 3 - canceled
  Also, an alternative and more flexible way is to use:
     a. $gameSystem.("gaugeId").isSuccess()
     b. $gameSystem.("gaugeId").isFailed()
     c. $gameSystem.("gaugeId").isCancelled()


============================================================================
Functions Reference:
============================================================================
FILL Options:
  $gameSystem.gauge("gaugeId").fill(imageName, offsetX, offsetY);
     Sets the fill image of the gauge. Offsets are relative to the background.
     Offsets are optional and defaults to 0.
  $gameSystem.gauge("gaugeId").fillSpeed(value);
     Sets the speed in frames of the filling motion of the gauge. Default 1
  $gameSystem.gauge("gaugeId").emptySpeed(value);
     Sets the speed in frames of the emptying motion of the gauge. 
     If not set, emptySpeed will take fillSpeed's value
  $gameSystem.gauge("gaugeId").fillReset();
     Sets reset fill to true. The filling motion will return to 0 when gauge 
     is filled to the max and OK button is still pressed. Default false.
     
CURSOR Options:
  $gameSystem.gauge("gaugeId").cursor(imageName);
     Sets the cursor image of the gauge. Cursor is automatically centered vertically to
     the fill image and is positioned horizontally based on the successPoint specified.
  $gameSystem.gauge("gaugeId").movingCursor();
     Sets the cursor to move along the horizontal width of the fill image.
     If this is called, the fill is 'filled' to the max and will wait for OK button to
     determine the result based on the successPoint specified.
  $gameSystem.gauge("gaugeId").bounceCursor();
     Sets the cursor to move back and forth along the horizontal width of the fill image.
     This will only take effect if the cursor is moving. 
     Default movement is it resets the position to the starting point.
  $gameSystem.gauge("gaugeId").cursorStartLeft();
     Sets the start position of the moving cursor to the left most part of the fill image.
  $gameSystem.gauge("gaugeId").cursorStartRight();
     Sets the start position of the moving cursor to the right most part of the fill image.
  $gameSystem.gauge("gaugeId").cursorSpeed(value);
     Sets the speed in frames the cursor will be moving.
     
LIFETIME Options:
  $gameSystem.gauge("gaugeId").lifetime(imageName, offsetX, offsetY);
     Sets the lifetime/timer image of the gauge. Offsets are relative to the background.
     Offsets are optional and defaults to 0.
  $gameSystem.gauge("gaugeId").lifetimeValue(value);
     Sets the life value in frames. In normal circumstances, 60 frames = 1 second
  $gameSystem.gauge("gaugeId").eternalLife();
     Sets the life of the gauge to be 'infinite'. If this is called, only OK and cancel buttons
     can stop the gauge(aside from the refresh button).
  $gameSystem.gauge("gaugeId").lifetimeDecreasing();
     Sets the fill type of the lifetime image to be from 'full' to 'empty'.
     By default, lifetime is decreasing.
  $gameSystem.gauge("gaugeId").lifetimeIncreasing();
     Sets the fill type of the lifetime image to be from 'empty' to 'full'.
     By default, lifetime is decreasing.
     
ROTATION Options:
  $gameSystem.gauge("gaugeId").rotateClockwise90();
     Sets the rotation of the whole gauge to 90 degrees clockwise.
  $gameSystem.gauge("gaugeId").rotateCounter90();
     Sets the rotation of the whole gauge to 90 decrees counter clockwise or -90.
  $gameSystem.gauge("gaugeId").rotateClockwise(degrees);
     Sets the rotation of the whole gauge to the specified degrees clockwise.
  $gameSystem.gauge("gaugeId").rotateCounter(degrees);
     Sets the rotation of the whole gauge to the specified degrees counter clockwise.
  NOTE: rotation options may mess up the positioning. 
     $gameSystem.gauge("gaugeId").offset(x,y) should be used to this.
     
POSITIONING Options:
  $gameSystem.gauge("gaugeId").upperLeft();
     Sets the position of the gauge to the upper left of the screen.
  $gameSystem.gauge("gaugeId").upperCenter();
     Sets the position of the gauge to the upper center of the screen.
  $gameSystem.gauge("gaugeId").upperRight();
     Sets the position of the gauge to the upper right of the screen.
  $gameSystem.gauge("gaugeId").centerLeft();
     Sets the position of the gauge to the center left of the screen.
  $gameSystem.gauge("gaugeId").centerCenter();
     Sets the position of the gauge to the center of the screen.
  $gameSystem.gauge("gaugeId").centerRight();
     Sets the position of the gauge to the center right of the screen.
  $gameSystem.gauge("gaugeId").lowerLeft();
     Sets the position of the gauge to the lower left of the screen.
  $gameSystem.gauge("gaugeId").lowerCenter();
     Sets the position of the gauge to the lower center of the screen.
  $gameSystem.gauge("gaugeId").lowerRight();
     Sets the position of the gauge to the lower right of the screen.
  $gameSystem.gauge("gaugeId").abovePlayer();
     Sets the position of the gauge to be above the player.
  $gameSystem.gauge("gaugeId").belowPlayer();
     Sets the position of the gauge to be below the player.
  $gameSystem.gauge("gaugeId").aboveEvent(mapEventId);
     Sets the position of the gauge to be above a specified map event.
  $gameSystem.gauge("gaugeId").belowEvent(mapEventId);
     Sets the position of the gauge to be below a specified map event.
  $gameSystem.gauge("gaugeId").offset(x, y);
     Moves the gauge by the specifed offsets x and y. This is relative to the position
     specified above.
     
SUCCESS and AFTER ACTION Related Options:
  $gameSystem.gauge("gaugeId").successPoint(value);
     Sets the position in percentage of the cursor along the Fill component's width.
     For example the Fill component's width is 200 and the specified cursor point is 50,
     the cursor image will be placed in the middle of the Fill component since the cursor point
     is specified as 50 percent.
     Values: 1 - 100
  $gameSystem.gauge("gaugeId").successPointAbove();
     Sets that the success result will be determined above the success point specified.
     For example: successPoint = 75. Success result will be from 75-100
  $gameSystem.gauge("gaugeId").successPointBelow();
     Sets that the success result will be determined below the success point specified.
     For example: successPoint = 75. Success result will be from 0-75
  $gameSystem.gauge("gaugeId").successPointRange(min, max);
     Sets the success point as a range. This overwrites the success point specified.
  $gameSystem.gauge("gaugeId").mapEventId(mapEventId);
     Sets the map event id to be called once the gauge action is finished
     NOTE: common event will override this
  $gameSystem.gauge("gaugeId").commonEventId(commonEventId);
     Sets the common event id to be called once the gauge action is finished
  $gameSystem.gauge("gaugeId").resultVariableId(variableId);
     Sets the result value to the variable specified.
     1 - success, 2 - failure, 3 - canceled
     
OTHER functions:
  $gameSystem.gauge("gaugeId").background(imageName, offsetX, offsetY);
     Sets the background image of the gauge. Offsets are relative to the whole gauge.
     Offsets are optional and defaults to 0.
  $gameSystem.gauge("gaugeId").foreground(imageName, offsetX, offsetY);
     Sets the foreground image of the gauge. Offsets are relative to the whole gauge.
     Offsets are optional and defaults to 0.
  $gameSystem.gauge("gaugeId").noAction();
     Sets the gauge to not handle any action, OK/cancel button. 
     If this is called, lifetime image is the only required image. 
     This is used for casting only gauges.
  $gameSystem.gauge("gaugeId").allowMovement();
     If this is called, player can move around while the gauge is running.
  $gameSystem.gauge("gaugeId").pauseBeforeFadeOut(frames);
     Sets the number of frames the gauge will display after an action and result has been
     determined and before starting fade out.
  $gameSystem.gauge("gaugeId").fadeOutSpeed(value);
     Sets how fast the gauge will fade out. 
  $gameSystem.gauge("gaugeId").fadeOutInstant();
     Sets the fade out speed to 255 to completely fadeout in 1 frame.
  $gameSystem.gauge("gaugeId").waitToFinish(); 
     Prevents the event(where this gauge is called to start) to proceed to the next command
     in the event's command queue.
 
START function: 
  $gameSystem.gauge("gaugeId").start();
     called to start and display the gauge.
      
RESULT RELATED functions: Usually called used Conditional Branches in events.
  $gameSystem.gauge("gaugeId").isMoving();
     Returns true if the gauge is currently moving. Where the fill is 'filling'
     or the cursor is moving.
  $gameSystem.gauge("gaugeId").isDead();
     Returns true if the gauge's lifetime is consumed. Gauge is considered dead
     if the action is canceled also.
  $gameSystem.gauge("gaugeId").isSuccess();
     Returns true if the result is success!
  $gameSystem.gauge("gaugeId").isFailed();
     Returns true if the result is failed!
  $gameSystem.gauge("gaugeId").isCancelled();
     Returns true if the action is cancelled!
     
============================================================================
Chained Functions:
============================================================================
Most of the above functions, except RESULT RELATED functions are chained functions.
Chained functions can be called together in a single line without repeating $gameSystem.gauge("gaugeId")
Example: 
     $gameSystem.gauge("fishing").fill("DefaultFill",81,27).cursor("DefaultCursor");
     $gameSystem.gauge("fishing").background("DefaultBackground").foreground("FishingIcon");
     $gameSystem.gauge("fishing").lifetime("DefaultTimer",81,77);
     $gameSystem.gauge("fishing").waitToFinish().start();


============================================================================
Gauge Setup Events
============================================================================
Gauges setup script calls can now be placed in a 1 time running map event.
You can have 1 map event that setups all gauges on map and when you want to 
use the gauge you can call the start() function any time. 
Be sure that you don't call the start() function in the setup event.


Example:
 Map Event 001: Setup gauge "fishing", "drilling"
 Map Event 002: Call and display the fishing gauge
     $gameSystem.gauge("fishing").start();
 Map Event 003: Call and display the drilling gauge    
     $gameSystem.gauge("drilling").start();
 Map Event 004: Call and display the fishing gauge again without repeating the setup
     $gameSystem.gauge("fishing").start();


 

Demo Video

Spoiler



 

Tutorial Video

Spoiler



 

Changelog

Spoiler



v2.02 - Fixed Object too big when saving - moved gauge objects to $gameTemp instead of $gameSystem


v2.01 - Rewrite plugin. NOT COMPATIBLE with older versions. Version based on number of changes detected by git.
      - Changed and removed a lot of functions. See documentation for available functions.
      - Added gaugeId for managing MULTIPLE gauges. Allows gauge setup on a different event.
      - Added new feature MOVING CURSOR.
      - Added new feature NO ACTION - only requires lifetime. Like a casting gauge only.
      - Added positioning options ABOVE/BELOW a map event.
      - Added lifetime option to be eternal.
v1.08 - Moved call to __finish. Called only when gauge fades out completly.
      - Added option to position gauge above or below player character.
      - Added option to make lifetime image decrease instead of increasing.
      - Added $gameSystem function $gameSystem.gauge() for easier access of gauge.
      - New gauge functions: isMoving(), isDead(), isSuccess(), isFailed() and isCancelled().
          Ex: $gameSystem.isMoving()
      - Added new option for success point to be above or below cursor point.
      - Changed orientation to rotation for future display options.
v1.01 - Fixed cursor positioning.
v1.00 - Initial release!


 

 
 
Last edited by a moderator:

Lionheart_84

Veteran
Veteran
Joined
Oct 27, 2015
Messages
479
Reaction score
43
First Language
Italian
Primarily Uses
Because at this point it does not release a demo practice to download ???
 

procraftynation

Master Procraftynator
Veteran
Joined
Oct 24, 2015
Messages
32
Reaction score
70
First Language
English
Primarily Uses
N/A
Because at this point it does not release a demo practice to download ???
Ooh Yes! Sorry. Why have I not thought about that. Thank you for asking.

Here it is demo package. I've deleted most files to strip down the file size. I hope it would work on your side.
 

topar395

Veteran
Veteran
Joined
Nov 10, 2015
Messages
44
Reaction score
15
First Language
English
These new updates are great! I really like the reversed lifetime bar. Just not really sure what to do with these new codes. isMoving(), isDead(), isSuccess(), isFailed() and isCancelled().
        

Disregard that message sorry, Those commands are for the drill! :)
 
 
Last edited by a moderator:

Lionheart_84

Veteran
Veteran
Joined
Oct 27, 2015
Messages
479
Reaction score
43
First Language
Italian
Primarily Uses
I tried the demo !!! beautiful plugin !!! :D   :D   :D  

but if you did the skills they would use this gauge ??? ;)   ;)   ;)

a little like Final Fantasy X and Overdrive Tidus ??? BD   BD   BD
 

procraftynation

Master Procraftynator
Veteran
Joined
Oct 24, 2015
Messages
32
Reaction score
70
First Language
English
Primarily Uses
N/A
These new updates are great! I really like the reversed lifetime bar. Just not really sure what to do with these new codes. isMoving(), isDead(), isSuccess(), isFailed() and isCancelled().

Disregard that message sorry, Those commands are for the drill! :)
Thanks! The new functions are used to implement the drill in the demo but can be useful in some other ways! Initially, I added it for the purpose of not using event id and variable in creating gauge anymore using the 'Advance usage' functions.  :)

I tried the demo !!! beautiful plugin !!! :D   :D   :D

but if you did the skills they would use this gauge ??? ;)   ;)   ;)

a little like Final Fantasy X and Overdrive Tidus ??? BD   BD   BD
Thanks. I'm glad you liked it! Yes. Skill implementation is on my list. Thanks  :D
 

Lionheart_84

Veteran
Veteran
Joined
Oct 27, 2015
Messages
479
Reaction score
43
First Language
Italian
Primarily Uses
Ok ... I'm happy for telling suggested !!! BD   BD   BD

or you had already thought ??? ;)   ;)   ;)
 

procraftynation

Master Procraftynator
Veteran
Joined
Oct 24, 2015
Messages
32
Reaction score
70
First Language
English
Primarily Uses
N/A
Ok ... I'm happy for telling suggested !!! BD   BD   BD

or you had already thought ??? ;)   ;)   ;)
I thought then forgot then you thought. So thanks for giving me the thought again!  :D
 

Lionheart_84

Veteran
Veteran
Joined
Oct 27, 2015
Messages
479
Reaction score
43
First Language
Italian
Primarily Uses
I thought then forgot then you thought. So thanks for giving me the thought again!  :D
Ok ... I'm happy to have rekindled this idea in you !!!! BD   BD   BD  

well, I'll wait ls demo with the skills !!!  :guffaw:   :guffaw:   :guffaw:
 

Silenity

Veteran
Veteran
Joined
Dec 17, 2013
Messages
654
Reaction score
246
First Language
English
Primarily Uses
RMMV
Very cool plugin.

I'd like to see this used for crafting!

So if you get it on the mark you get a strong item or just the regular item.

And if you miss the mark you get a weak item or no item.
 

RodsXP

Villager
Member
Joined
Nov 9, 2015
Messages
20
Reaction score
17
First Language
Español
Primarily Uses
RMMV
Great Plugin. But...Marsha is lying.

She have all her MP.  :rswt:

Womans.... :D
 

Ushi

Warper
Member
Joined
Jan 4, 2016
Messages
4
Reaction score
1
First Language
PT-BR
Primarily Uses
N/A
+Ushi O'Mito Hello! You mean a cast effect on an event/player? Then what happens when the charge is full? Can we discuss here: http://forums.rpgmakerweb.com/index.php?/topic/53755-gauge-action-system/ So we can follow threads easily if it's okay :) 
Here am I. o/

Yes, wanna make a forging/cooking/alchemy process so when the material is been charging the player be free to walk in map.

Also will add a sound like *ding!* and a 'OK!' animation when the item is done, but that part i think i can handle.

So, i need to know how to place a cast/timer bar above an event. Not in a screen position... Got it? @.@
 

procraftynation

Master Procraftynator
Veteran
Joined
Oct 24, 2015
Messages
32
Reaction score
70
First Language
English
Primarily Uses
N/A
Here am I. o/

Yes, wanna make a forging/cooking/alchemy process so when the material is been charging the player be free to walk in map.

Also will add a sound like *ding!* and a 'OK!' animation when the item is done, but that part i think i can handle.

So, i need to know how to place a cast/timer bar above an event. Not in a screen position... Got it? @.@
Currently you can only place it above or below player but not on events. I'll do an update and I'll make other images optional so you can use timer only.

Very cool plugin.

I'd like to see this used for crafting!

So if you get it on the mark you get a strong item or just the regular item.

And if you miss the mark you get a weak item or no item.
Thanks! Take a look at the fishing demo, you can actually use that but instead of returning fish on success, return an item! :)
 

Val

Veteran
Veteran
Joined
Oct 12, 2015
Messages
281
Reaction score
168
First Language
Français
Primarily Uses
Wow great plugins! It's sure I'm going to try it in my project and do some kind of mini game around it !! Thank you very much if I need some help or find a little bug I will let you know.

Continue your great work :)  
 

Fuchsilein

Devil Fox
Veteran
Joined
Aug 20, 2015
Messages
53
Reaction score
19
First Language
German
Primarily Uses
That exactly the plugin i wished for.. Great Work Mate!
 

beenbaba

Slowly getting there
Veteran
Joined
Apr 28, 2015
Messages
290
Reaction score
159
First Language
English
This is very nice, thank you for making this! :D

I'm not sure how much of a stretch this would be but I'll ask anyway :)

Would you be able to add something so that the bar goes up and down automatically and the player just has to hit enter when the bar is in the right place. The timer would still run down so they would have a limited amount of time to do so. Maybe a plugin parameter to choose between the different types possibly?
 
  • Like
Reactions: Val

Juztsacki

Game Developer
Veteran
Joined
Nov 19, 2015
Messages
55
Reaction score
8
First Language
English
Primarily Uses
N/A
Can you add a updated demo with the drill actually working. I just figured out the whole fishing process by watching the video you posted but there's nothing explain the drill and the bouncing effect. Can please help me on this.
 

procraftynation

Master Procraftynator
Veteran
Joined
Oct 24, 2015
Messages
32
Reaction score
70
First Language
English
Primarily Uses
N/A
Wow great plugins! It's sure I'm going to try it in my project and do some kind of mini game around it !! Thank you very much if I need some help or find a little bug I will let you know.

Continue your great work :)
That exactly the plugin i wished for.. Great Work Mate!
Thanks! I'm glad you liked it! I'm more than happy to hear bugs and suggestions :)

This is very nice, thank you for making this! :D

I'm not sure how much of a stretch this would be but I'll ask anyway :)

Would you be able to add something so that the bar goes up and down automatically and the player just has to hit enter when the bar is in the right place. The timer would still run down so they would have a limited amount of time to do so. Maybe a plugin parameter to choose between the different types possibly?
If you mean vertically display the gauge? I'll be working on updates this weekend but I already have an idea on how to do it. I'll post updates :)

Can you add a updated demo with the drill actually working. I just figured out the whole fishing process by watching the video you posted but there's nothing explain the drill and the bouncing effect. Can please help me on this.
You can download the Demo Package that contains the drill effect. The drill effect is actually jump movement, show animation(dust) and play sound in an event loop. The loop is goes 'break' only when the gauge life ends :)
 
  • Like
Reactions: Val

Unmercyful

Veteran
Veteran
Joined
Oct 25, 2015
Messages
123
Reaction score
30
First Language
English
I guess I'm not seeing it, But where do I set the variable for the drill for the success or failure? Is it possible you could show a example of a map event using the drill and a variable? Thanks so much!!!
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Welp, finally posted some images to Twitter that I meant to post last year... Better late than never, right?
Just going to leave this here. :LZSexcite:
Going for a spooky theme with my animal crossing home/town. All I gotta do is find that one gravestone recipe out of hundreds for my cemetary ; u;
Asthma has been getting worse because I can't get my paws on a brown (preventer) inhaler. Been without one for over a week now. Struggling to breathe sucks.
I'm wondering, what if I took the time to make a Bee Hive mirco-biome. It sounds cute, and be a home to that hornet monster, but would anyone actually use it?

Forum statistics

Threads
95,781
Messages
931,896
Members
126,197
Latest member
Sinnott
Top