设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 93|回复: 0

[转载发布] Gauge Action System

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    开心
    2026-7-12 04:10
  • 签到天数: 209 天

    连续签到: 2 天

    [LV.7]常住居民III

    7959

    主题

    864

    回帖

    3万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    29925
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    38778

    灌水之王

    发表于 4 天前 | 显示全部楼层 |阅读模式
    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:


    • Filling - default. The gauge is being filled when OK button is pressed and emptied when OK button is released.
    • 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.
    • 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

    SpoilerSpoiler



                             



                                    ============================================================================
                                    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

    SpoilerSpoiler



                             




    Tutorial Video

    SpoilerSpoiler



                             




    Changelog

    SpoilerSpoiler



                            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!


                             




             


    本贴来自国际rpgmaker官方论坛作者:procraftynation处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/gauge-action-system.53755/
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2026-8-1 05:53 , Processed in 0.128928 second(s), 52 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表