SRPG Studio

SRPG Studio

评价数不足
RepairAllUnitSuite
   
奖励
收藏
已收藏
取消收藏
RESOURCES: plugin
文件大小
发表于
更新日期
9.527 KB
2018 年 12 月 27 日 下午 7:38
2019 年 2 月 5 日 下午 2:04
2 项改动说明 ( 查看 )

订阅以下载
RepairAllUnitSuite

描述
This is an expanded version of RepairAllPlayerUnits. It is a seperate module in case this larger plugin causes conflicts with your project. If there is no conflict then RepairAllPlayerUnits is not needed as RepairAllUnitsSuite has RepairAllPlayerUnits builtin.

Contains:
RepairAllPlayerUnits();
RepairAllFactionUnits();
RepairFullTargetUnit();
RepairFullVariableUnit();


---------------------------------------
RepairAllPlayerUnits();
Call this function to repair all player owned items. Helpful for if you want to repair/reload everything in your game.

To call through an event, use the Execute Script event with the Execute Code option, then put 'RepairAllPlayerUnits();' without quotes.

To repair/reload after battle add 'RepairAllPlayerUnits();' without quotes to scene-battleresult.js at line 8 above this._completeSceneMemberData();

---------------------------------------
RepairAllFactionUnits(faction);
Call this function to repair all items of the selected FACTION/Affiliation type.

To call this through and event use Execute Script event with the Execute Code option, then put 'RepairAllFactionUnits(faction);' without quotes and instead
of faction put either 'Player', 'Enemy', or 'Ally' to choose their faction/affinity to repair.

CAUTION: If you leave it as [faction] or forget to put '' around the faction name then it will not work.

---------------------------------------
RepairFullTargetUnit(faction, targetID);
Call this function to repair all items of a single target unit only.

The slightly more complex method to call this through an event is to use Execute Script event with the Execute Code option, then put 'RepairAllFactionUnits(faction, targetID);'
without quotes and instead of faction put either 'Player', 'Enemy', or 'Ally' to choose their faction/affinity to repair. Then put the targets ID number where targetID is. You
can get the targetID of a unit through several means, by looking at their number in the map editor.

example: RepairAllFactionUnits('Player', 1); //This will repair the items of your first unit.
RepairAllFactionUnits('Enemy', 6); // this will repair the items of the enemies sixth unit.

The simplest method however is to use the Original Data tab in the Execute Code event. After inputting RepairFullTargetUnit(); in the Execute Code box, click the Original Data
tab. Change the Unit to the desired unit you wish to repair. Click ok and you're done!

CAUTION: I added some safety redundancies so that if the faction is input or the targetID (targetID = n, in the function call) it can still work, HOWEVER you WILL need to have the
Original Data Unit still set.

---------------------------------------
RepairFullVariableUnit(targetID);
Call this function to repair all items of a single target based on their unitID either directly or through a variable.

This is a modification of RepairFullTargetUnit. It only needs a target units ID or their ID in a variable.

To get a units ID at a position, use the Change Variable event, set value to Operand-Position-Unit ID. Then use:
RepairFullVariableUnit(root.getMetaSession().getVariableTable(x).getVariable(y));
-------Exchange (x) for the variable table(the tab) and subtract 1, so Variable tab 1 is 0.-----
-------Exchange (y) for the specific variable and subtract 1, so Variable 1 is 0.---------------

If there is no syntax error, having a mismatch number will not cause an error. It will simply not do anything.
---------------------------------------

CAUTION: Before altering ANY main script file, make a backup.

Made by Delsin. Help from and thanks to Lady Rena, TacticianDaraen, and Goinza.

For commercial or private use or modification or whatever. Credit would be nice though.

Version 1.2