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

[转载发布] Solarflare's Miscellaneous Plugins [SFG]

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

    连续签到: 2 天

    [LV.7]常住居民III

    7949

    主题

    864

    回帖

    3万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

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

    灌水之王

    发表于 昨天 17:16 | 显示全部楼层 |阅读模式
    Miscellaneous Plugins


    I've posted a few plugins in the Plugin Request forum already, so I thought it would be a good idea to gather them all in one place. This thread will only be for small and simple plugins - if I release something big or complex I'll create another thread. Some of my plugins depend on having SFG_Utils installed above them, so if a plugin doesn't work, try installing SFG_Utils before posting a bug report.

    Unless otherwise noted, these plugins are not compatible with MZ. If the links below are broken, all these plugins (plus the work-in-progress localization plugin in my signature) can also be found on my website. Some of my plugins can also be downloaded from itch.io. I'll be adding more there bit by bit.

    Spoiler: SFG_Utils
    This is just a collection of utility functions that I use in several of my plugins. If you have any trouble getting one of my plugins to work, install this and make sure it's placed above any of my plugins.

    Download Link
    Itch Link
    Spoiler: SFG_AltDeathState
    This allows you to set additional states to be treated as a death state for purposes of targeting, game overs, or both. You can also set an auto-state for 0 MP.

    Download Link
    Spoiler: SFG_AutoBattle
    This adds an option in the Options menu to set auto-battle for all actors. Turn it on and the game will do all your fights for you.

    This plugin is also compatible with RPGMaker MZ.

    Download Link
    Spoiler: SFG_BattleBalloons
    This lets you use balloon icons in battle. Attach them to side-view actors or to enemies.

    Download Link
    Spoiler: SFG_EquipParams
    This allows you to restrict equipment based on an actor's stats.

    This plugin is also compatible with RPGMaker MZ.

    Download Link
    Itch Link
    Spoiler: SFG_EventTriggers
    This allows triggering an event while in an airship and also adds a way for events to have a "line of sight" that will trigger them when you step on a tile in the same row or column.

    This plugin is also compatible with RPGMaker MZ.

    Download Link
    Spoiler: SFG_ExpandedTP
    This basically allows you to do with TP anything that's already possible with MP and HP, plus some extra things specific to TP like customizing what it's set to at the beginning and end of battle.

    This plugin is also compatible with RPGMaker MZ.

    Download Link
    Itch Link
    Spoiler: SFG_ExtraMaps
    This is a mod of Zeriab_ExtraMaps. It works pretty much the same way; the only real difference is that when you switch map folders, it loads the MapInfos.json from the new folder, which is required for compatibility with some of my plugins such as SFG_Localization and SFG_MapHierarchy.

    This plugin is also compatible with RPGMaker MZ.

    Download Link
    Spoiler: SFG_ImprovedPathfinding
    Improves the pathfinding used when navigating the map with the mouse. The improved algorithm recognizes bridges, same-map teleporters, and a few other exotic things, and allows avoiding things like damage floor if at all possible.

    Main Thread
    Spoiler: SFG_MapHierarchy
    Makes maps inherit optional properties (currently BGM, BGS, and battle backs) from their parent map in the editor map hierarchy. Note: This could cause some lag when transferring between maps, especially if you have deep nesting and/or are deploying to the web. I didn't experience any lag in my testing, but your mileage may vary.

    This plugin is also compatible with RPGMaker MZ.

    Download Link
    Spoiler: SFG_NewAnimTimings
    This lets you shake the screen or play weather effects in the middle of a battle animation. Should work even when calling the battle animation from the map.

    Download Link
    Spoiler: SFG_OptionalFaces
    Adds an option in the Options menu to disable all actor faces in message windows. You can override the setting for individual messages if you wish.

    Download Link
    Spoiler: SFG_ParamAdd
    Adds an additive trait for parameters, instead of the standard multiplicative trait.

    This plugin is also compatible with RPGMaker MZ.

    Download Link
    Itch Link
    Spoiler: SFG_PartyBattleFormation
    This allows setting custom formations that alter how the party is laid out on the battlefield and even grants passive states to actors based on their position.

    Main Thread
    Spoiler: SFG_PassiveStates
    This allows you to set states that are automatically applied when a condition holds, and removed when the condition no longer holds.

    Download Link

    Alternatively, copy-paste the following code into a text file and name it SFG_PassiveStates.js:
    Spoiler                JavaScript:       
    1. /*:
    2. @plugindesc [1.0] Allows you to set states to be applied based on arbitrary conditions.
    3. @author Solarflare Software
    4. @help
    5. Use the following note tag to turn a state into a passive state:
    6. <activeif:true> (states)
    7.   This state is automatically added or removed based on the given condition.
    8.   As with a damage formula, the actor can be referenced as a.
    9.   Game variables are also available as v and switches as s.
    10.   The state object itself can be accessed as state.
    11. */
    12. var Imported = Imported || {};
    13. (function() {
    14.         var conditionalStates = [];
    15.         var old_startup = Scene_Boot.prototype.start;
    16.         Scene_Boot.prototype.start = function() {
    17.                 old_startup.call(this);
    18.                 for(var i = 1; i < $dataStates.length; i++) {
    19.                         if($dataStates[i].meta.activeif)
    20.                                 conditionalStates.push(i);
    21.                 }
    22.         };
    23.        
    24.         Game_BattlerBase.prototype.isStateConditionallyActive = function(stateId) {
    25.                 if(this.isStateResist(stateId)) return false;
    26.                 var state = $dataStates[stateId];
    27.                 if(!state) return false;
    28.                 var cond = state.meta.activeif;
    29.                 if(cond) {
    30.                         let locals = {
    31.                                 state: state,
    32.                                 a: this,
    33.                         };
    34.                         try {
    35.                                 return !!Utils.eval(cond, locals);
    36.                         } catch(e) {}
    37.                 }
    38.                 return false;
    39.         };
    40.        
    41.         const old_globalUpdate = Scene_Base.prototype.update;
    42.         Scene_Base.prototype.update = function() {
    43.                 old_globalUpdate.call(this);
    44.                 $gameParty.refreshPassiveStates();
    45.                 $gameTroop.refreshPassiveStates();
    46.         };
    47.        
    48.         const old_isStateAddable = Game_Battler.prototype.isStateAddable;
    49.         const old_removeState = Game_Battler.prototype.removeState;
    50.         Game_Battler.prototype.isStateAddable = function(state) {
    51.                 if(conditionalStates.includes(state))
    52.                         return this.isStateConditionallyActive(state);
    53.                 return old_isStateAddable.call(this, state);
    54.         };
    55.        
    56.         Game_Battler.prototype.removeState = function(state) {
    57.                 if(conditionalStates.includes(state) && this.isStateConditionallyActive(state))
    58.                         return;
    59.                 old_removeState.call(this, state);
    60.         };
    61.        
    62.         Game_Battler.prototype.requestPassiveStateRefresh = function() {
    63.                 this._needsPassiveStateUpdate = true;
    64.                 this.friendsUnit()._needsPassiveStateUpdate = true;
    65.         };
    66.        
    67.         Game_Battler.prototype.refreshPassiveStates = function() {
    68.                 this._needsPassiveStateUpdate = false;
    69.                 for(let i = 0; i < conditionalStates.length; i++) {
    70.                         let stateId = conditionalStates[i];
    71.                         if(this.isStateConditionallyActive(stateId))
    72.                                 this.addState(stateId);
    73.                         else this.removeState(stateId);
    74.                 }
    75.         };
    76.        
    77.         // Should also override isStateAddable to return false if the condition is not satisfied, and removeState to not remove it if the condition is still satisfied.
    78.        
    79.         Game_Unit.prototype.requestPassiveStateRefresh = function() {
    80.                 this._needsPassiveStateUpdate = true;
    81.                 this.members().forEach(who => who.requestPassiveStateRefresh());
    82.         };
    83.        
    84.         Game_Unit.prototype.refreshPassiveStates = function() {
    85.                 if(!this._needsPassiveStateUpdate) return;
    86.                 this._needsPassiveStateUpdate = false;
    87.                 this.members().forEach(function(who) {
    88.                         if(who._needsPassiveStateUpdate)
    89.                                 who.refreshPassiveStates();
    90.                 });
    91.         };
    92.        
    93.         Game_Troop.prototype.refreshPassiveStates = function() {
    94.                 if(this.inBattle()) Game_Unit.prototype.refreshPassiveStates.call(this);
    95.         };
    96.        
    97.         Game_Party.prototype.refreshPassiveStates = function() {
    98.                 // Refresh on all members, even in battle
    99.                 var inBattle = this.inBattle();
    100.                 this._inBattle = false;
    101.                 Game_Unit.prototype.refreshPassiveStates.call(this);
    102.                 this._inBattle = inBattle;
    103.         };
    104.        
    105.         const updateParty = () => $gameParty.requestPassiveStateRefresh();
    106.         const updateAll = () => {$gameParty.requestPassiveStateRefresh(); $gameTroop.inBattle() && $gameTroop.requestPassiveStateRefresh()};
    107.         const refreshMethods = [
    108.                 {
    109.                         class: Game_Battler,
    110.                         methods: ['onAllActionsEnd', 'onTurnEnd', 'onBattleStart', 'onBattleEnd', 'refresh'],
    111.                 },
    112.                 {
    113.                         class: Game_Actor,
    114.                         check: (self, skill) => self.isLearnedSkill(skill),
    115.                         methods: ['learnSkill', 'forgetSkill'],
    116.                 },
    117.                 {
    118.                         class: Game_Enemy,
    119.                         methods: ['appear'],
    120.                 },
    121.                 {
    122.                         class: Game_Party,
    123.                         methods: ['gainGold', 'gainItem'],
    124.                 },
    125.                 {
    126.                         class: Game_Player,
    127.                         update: updateParty,
    128.                         methods: ['refresh'],
    129.                 },
    130.                 {
    131.                         class: Game_Player,
    132.                         check: (self) => self.isInVehicle(),
    133.                         update: updateParty,
    134.                         methods: ['getOnOffVehicle'],
    135.                 },
    136.                 {
    137.                         class: Game_Event,
    138.                         update: updateParty,
    139.                         methods: ['refresh'],
    140.                 },
    141.                 {
    142.                         class: Game_CharacterBase,
    143.                         update: updateParty,
    144.                         methods: ['increaseSteps', 'setPosition', 'copyPosition'],
    145.                 },
    146.                 {
    147.                         class: Game_Switches,
    148.                         update: updateAll,
    149.                         methods: ['onChange'],
    150.                 },
    151.                 {
    152.                         class: Game_Variables,
    153.                         update: updateAll,
    154.                         methods: ['onChange'],
    155.                 },
    156.                 {
    157.                         class: Game_SelfSwitches,
    158.                         update: updateAll,
    159.                         methods: ['onChange'],
    160.                 },
    161.         ];
    162.         if(Imported.TH_SelfVariables) {
    163.                 refreshMethods.push({
    164.                         class: Game_SelfVariables,
    165.                         update: updateAll,
    166.                         methods: ['onChange'],
    167.                 });
    168.         }
    169.        
    170.         for(let cls of refreshMethods) {
    171.                 let proto = cls.static ? cls.class : cls.class.prototype;
    172.                 for(let fcn of cls.methods) {
    173.                         let old = Utils.makeAliasProxy(cls.class, fcn);
    174.                         let check = cls.check ? cls.check : (self) => {};
    175.                         let update = cls.update ? cls.update : (self) => self.requestPassiveStateRefresh();
    176.                         proto[fcn] = function() {
    177.                                 var before = check(this);
    178.                                 old(this, ...arguments);
    179.                                 if(before === undefined || before != check(this, ...arguments)) {
    180.                                         update(this);
    181.                                 }
    182.                         };
    183.                 }
    184.         }
    185. })()
    复制代码






    Spoiler: SFG_ReserveActions
    This allows reserve actors (who are in the party but would not normally participate in battle) to occasionally jump onto the battlefield and perform a skill under specific conditions.

    Main Thread
    Spoiler: SFG_SortKeys
    Allows you to control how items, weapons, armours, and skills are ordered in various windows. Useful if the lists in your database are not in any logical order.

    This plugin is also compatible with RPGMaker MZ.

    Download Link
    Spoiler: SFG_SwitchCommand
    This adds a new command for eventing that lets you check the value of a variable and run code depending on what the value is. Programmers may know this as a "switch statement".

    This plugin is also compatible with RPGMaker MZ.

    Here's a contrived example of its use:

                    Code:       
    1. ◆Control Variables:#0019 += 1
    2. ◆Plugin Command:switch @19
    3. ◆Show Choices:1, 2, 3, #4~8, 9, 10 (Window, Right, #1, #2)
    4. :When 1
    5.   ◆Text:None, Window, Bottom
    6.   :Text:First time!
    7.   ◆
    8. :When 2
    9.   ◆Text:None, Window, Bottom
    10.   :Text:Second time!
    11.   ◆
    12. :When 3
    13.   ◆Text:None, Window, Bottom
    14.   :Text:Third time!
    15.   ◆
    16. :When #4~8
    17.   ◆Text:None, Window, Bottom
    18.   :Text:Maybe you should stop this...
    19.   ◆
    20. :When 9
    21.   ◆Text:None, Window, Bottom
    22.   :Text:Calm down, that's already nine times!
    23.   ◆
    24. :When 10
    25.   ◆Text:None, Window, Bottom
    26.   :Text:And now it's your tenth time!
    27.   ◆
    28. :End
    29. ◆Show Choices:#(value % 5 == 1), 20, >30 (Window, Right, #1, -)
    30. :When #(value % 5 == 1)
    31.   ◆Text:None, Window, Bottom
    32.   :Text:I'm really at a loss for words.
    33.   ◆Plugin Command:switch @19
    34.   ◆Show Choices:>100, >45 (Window, Right, #1, #2)
    35.   :When >100
    36.     ◆Text:None, Window, Bottom
    37.     :Text:Are you serious!? You've exceeeded one hundred!!!
    38.     ◆
    39.   :When >45
    40.     ◆Text:None, Window, Bottom
    41.     :Text:No really, stop it!
    42.     ◆
    43.   :End
    44.   ◆
    45. :When 20
    46.   ◆Text:None, Window, Bottom
    47.   :Text:Twentieth time already!? Are you mad!?
    48.   ◆
    49. :When >30
    50.   ◆Text:None, Window, Bottom
    51.   :Text:More than thirty times! Just... just stop!
    52.   ◆
    53. :When Cancel
    54.   ◆Text:None, Window, Bottom
    55.   :Text:This is starting to get crazy...
    56.   ◆
    57. :End
    复制代码


    And another example using strings:

                    Code:       
    1. ◆Name Input Processing:Harold, 8 characters
    2. ◆Plugin Command:switch $gameActors.actor(1).name()
    3. ◆Show Choices:"Harold", #"x"~"zzzzzzz", ~"[aeiou]{3,}" (Window, Right, #1, -)
    4. :When "Harold"
    5.   ◆Text:None, Window, Bottom
    6.   :Text:The default, good choice!
    7.   ◆
    8. :When #"x"~"zzzzzzz"
    9.   ◆Text:None, Window, Bottom
    10.   :Text:That's quite a rare name...
    11.   ◆
    12. :When ~"[aeiou]{3,}"
    13.   ◆Text:None, Window, Bottom
    14.   :Text:So many vowels!
    15.   ◆
    16. :When Cancel
    17.   ◆Text:None, Window, Bottom
    18.   :Text:Not a bad choice!
    19.   ◆
    20. :End
    复制代码


    Download Link
    Spoiler: SFG_VariableTime
    This allows you to change how fast time progresses on the map using traits.

    Download Link
    Spoiler: SFG_Wait
    Adds wait commands for various event commands that have an optional wait. The most useful of this is "waitForMovementRoute", which will wait for a given character's movement route to complete. This lets you set the movement route going, do other stuff while it executes, but later wait for it to complete. If you're having movement routes cut short due to fast-forward, this can fix it.

    This plugin is also compatible with RPGMaker MZ.

    Download Link
    Mods or Add-ons to Other Plugins

    Spoiler: SFG_BookFiles
    An add-on for TAA_BookMenu that will load your books from external text files, one file per book. Note: this does not work for web deployment at this time and may not work on mobile either - it requires NwJS in order to function.

    To enable it, set DataSource Type to Book Files in the TAA_BookMenu  configuration.

    Download Link
    Spoiler: Aloe_ConditionalChoices
    Allows hiding or disabling choices by writing a condition directly in the choice box.

    Main Thread
    Spoiler: Moogle_X_ActorsFriendshipSystem
    A fully-featured system to track relationships between your characters.

    Main Thread
    Terms of Use


    • You don't need to credit me in the game credits or anything. However, don't remove me from the "author" field in the plugin file. If you do wish to credit me, you can do so as "Solar Flare" or "Solarflare Software".
    • You can use these plugins in commercial or non-commercial games, free of charge.
    • Feel free to modify these plugins however you need for your game. Exception: Do not modify SFG_Utils for any reason. If you need something added to or altered in SFG_Utils, just create a new plugin.
    • If a plugin that I created is not listed in this thread, or if the listing in this thread links to another thread that specifies different terms, these terms of use do not apply to it.
    • You may port these plugins to MZ as long as a port isn't already available in my MZ plugins threadand you change the filename to remove the SFG_ prefix (to avoid making it appear to be an official port; you may add your own prefix if you wish). You still need to leave me in the "author" field in the plugin file.



    本贴来自国际rpgmaker官方论坛作者:Solar_Flare处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/solarflares-miscellaneous-plugins-sfg.122826/

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有账号?立即注册

    x
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-7-31 22:41 , Processed in 0.094313 second(s), 57 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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