じ☆ve冰风 发表于 2026-7-30 16:24:07

Ammunition System & Add-on (Crafting System)

Ammunition System - ver1.1.7


by Unconnected42


Latest updates


        - 2016-12-11 : ver1.1.7 : fixed a bug that make the game crash in some menus when an actor had no weapon equipped.


        - 2016-11-16 : ver1.1.6 : makes ammunition display for normal attack.


        - 2016-11-15 : ver1.1.5 : fixes the incompatibility with Yanfly's Weapon Unleash.


        - 2016-06-11 : ver1.1.4 : fixes the incompatibility with Yanfly's ItemCore ver. 1.24.


        - 2016-02-17 : ver1.1.3 : (supposedly?) corrected a bug that causes crashes when enemy attacks for some persons.


        - 2015-12-15 : ver1.1.2 : yet another bug correction.


        - 2015-12-15 : ver1.1.1 : corrected a bug that caused zero cost equip ammunition to be unequippable.


        - 2015-12-09 : ver1.1.0 : charged ammunition can now 'create' an 'empty' item when their charge number is reduced to zero. Also, charged ammunition will show their remaining charges in equip windows.


        - 2015-11-29 : ver1.0.0 : added charged ammunition feature. Fixed a (generally silent) bug that could make skills availables even in case of unsufficient ammunition in some rare cases.


        - 2015-11-26 : ver0.4.4 : fixed an issue that caused equip-type ammo to be equippable when it should not in some situations.


        - 2015-11-24 : ver0.4.3b : fixed an issue that caused ammo not to be consumed in some situations when using older versions of Yanfly's ATB.


        - 2015-11-21 : ver0.4.3 - the previous changes made actually break the ammo cost implementation when ammo are NOT independent items, causing the ammo to be simply unequipped... Corrected now.


        - 2015-11-20 : ver0.4.2 - correction of the 'reload skills' feature so that indicating the correct equip slot for equip ammunition is no more necessary. Slight modification of how the cost of equip ammunition is managed internally, so that it works more logically when independent ammo with variance is used.


        - 2015-11-15 : ver0.4.1 - corrected a bug causing a crash during battle when no weapon is equipped and the ammo amount is displayed next to attack command. Also corrected a bug that could make the displayed cost in attack command incorrect.


        - 2015-11-15 :


        * ver0.4.0: added compact cost display, game switch dependency, and weapon-type ammunition (for now, it is strongly recommended to use it only for weapons using themselves as ammo, such as throwing knives).


        * added extension Crafting System.


Introduction


        This script allow to define costs in terms of gold, items or equipments (that is, armors or weapons) for skills or weapons use.


        It can be used for a variety of purposes : spells requiring special components in order to be cast, making items only usable by certain actors through the use of specific skills, having guns or bows needing bullets and arrows, throwing knives... 


Features


        - the cost is added to any existing cost (MP, TP...)


        - if the equipped weapon has a cost in items/equips, this cost will be applied each time the normal attack is used.


        - if a skill/weapon has a cost for several items, each cost must be paid each time the skill/weapon is used.


        - if a skill/weapon has a cost for several equipments, only the equipped ammunition will be consumed when the skill/weapon is used. Additionally in that case, if no ammunition is equipped, the skill/weapon cannot be used.


        - skills can be used to change armour-type ammunition during battle.


        - equip-type ammunition (armor/weapon) can possess charges (a number of limited uses), in which case the ammo charges are reduced at each use, instead of the ammo being consumed. When the charges number hits zero, the ammo is unequipped and 'disappears'.


Screenshots

SpoilerSpoiler



https://forums.rpgmakerweb.com/data/attachments/13/13954-ab0ba61c86751b3316f330ccca2eccca.jpg


https://forums.rpgmakerweb.com/data/attachments/13/13955-70434e6d1869f2dd45062f358f0dbe0b.jpg


https://forums.rpgmakerweb.com/data/attachments/13/13956-628661d01a04a72c84069e46bf68ed9a.jpg


https://forums.rpgmakerweb.com/data/attachments/13/13957-911d61b1f6d53b7d92d64497b0f53b59.jpg


https://forums.rpgmakerweb.com/data/attachments/13/13958-037c7063a2a93879391ec37f0f7c9a1d.jpg


https://forums.rpgmakerweb.com/data/attachments/13/13959-b3681739f384cf103abea06f15d5917f.jpg






How to Use, & Compatibility issues


        My lazyness made me simply copy/paste the plug-in's help below :

SpoilerSpoiler







                        ============================================


                        Introduction


                        ============================================


                        This plug-in will allow skills or weapons to require the consumption of 


                        ammunition, components, etc. in order to work. The cost is  paid each 


                        time the skill is used, together with MP/TP costs, or each time the 


                        normal attack is used in the case of weapons.


                        The ammunition can be either gold, items or equipments (armours, weapons), or 


                        a mix.


                        However, things work differently depending on what type of cost is considered.


                        - items : if several types of items are marked as required as ammunition 


                          for a given skill/weapon, *ALL* of the corresponding prices must be 


                          paid each time the skill/weapon is used. 


                        - equipment : the equipment needs to be equipped in order for the skill/weapon


                          to work. If several types of equipments are marked as required as ammunition


                          for a given skill/weapon, *ONLY* the cost of the one that is *CURRENTLY


                          EQUIPPED* will be paid. That means a weapon/skill can be able to use 


                          different interchangeable ammunition types.


                        - Gold cost is straightforward in how it functions.


                        You can also define skills which can change the type of ammunition 


                        equipped even during combat, in the case of armour-type ammunition.


                        Then, your hero can use an action to change his/her ammunition type !


                        ============================================


                        Known Compatibility Issues


                        ============================================


                        This plug-in should be placed under all plug-ins that you are using,


                        especially Yanfly's since it actually uses some of their features if


                        they are present.


                        Known exceptions to that rule : 


                        - Yanfly's Skill Cooldown


                        - Jay's Dual Techs. 


                          -> Ammunition should be placed above these two plug-ins.


                        This might also be the case for other plug-ins whenever 


                        the modification of skill costs is concerned.


                        On the contrary, the following plug-ins MUST be placed above :


                        - Bobstah's BattleCommandList.


                        This plug-in in the present version should be fully compatible


                        with Yanfly's ItemCore Independent Items feature.


                        Therefore, ammunition of any kind can either be independent or


                        not (for the latter case, use a <Not Independent Item> notetag


                        in the ammunition notebox if you are using ItemCore and a max


                        number of items > 0).


                        ============================================


                        Use


                        ============================================


                        + Declaring a weapon/skill to need ammunition


                        ---------------------------------------------


                        Lines to put in either Weapon notebox or Skill notebox for defining costs :


                          <Gold Cost: c>


                          <Ammo i Item: c>  (for items ammo)


                          <Ammo i Equip: c>  (for armors ammo)


                          <Ammo i Weapon: c>  (for weapons ammo)


                        ... where i is the ID of the ammunition item/armor and c is the cost 


                        required for one use.


                        Disclaimer concerning weapon-type ammunition: 


                        In its present state it is intended to be used for weapons that would be


                        their own ammo, like throwing knives, shurikens, etc.


                        In theory, however, it *should* be possible to use as ammo for a weapon 


                        a different weapon, provided both of them are equipped, but this possibility


                        has yet to be playtested...


                        + Declaring a skill that serves for equipping ammo (during combat)


                        ------------------------------------------------------------------


                        To create a skill that will change the type of ammunition equipped:


                          <Ammo i Load>


                        ... where i is the ID of the ammunition armor.


                        The following syntax is also authorized:


                          <Ammo i Load: s>


                        ...where s is the specific slot to be equipped.


                        This syntax is kept only for compatibility reasons, so that people


                        who defined their tags for older versions of the script that did


                        not support the simpler syntax are not forced to change.


                        If your actor(s) have for example the following equipment types:


                            Weapon, Shield, Head, Body, Accessory, Ammunition


                        ... then the slot number would be 6.


                        Note 1: this is meant to be used during battle, when equip menu is not 


                        accessible, if you want your actors to be able to switch ammunition.


                        Note 2: it is necessary to define one skill per type of ammunition.


                        Note 3: it is possible to use this tag for equipping any kind of armor, and 


                        not just ammunition.


                        Also, the Load feature currently does not work with weapon-type ammo.


                        + Ammo equipment with charges


                        -----------------------------


                        For an armor- or weapon-type ammunition, you can allow each ammo item to


                        provide a given number of uses instead of being consumed after just one use.


                        Declare the following tag in the ammo equipment notebox:


                          <Ammo Charges: n>


                        ... where 'n' is the wished number of charges the item possesses.


                        This tag will only actually be used if you are using Yanfly's ItemCore and


                        the item is an independent item.


                        The equipped ammo item has a certain number of charges, and at each use, this


                        is this number that will be reduced, instead of the number of ammo items.


                        When the number of charges hits zero, the item is unequipped, without


                        being returned to inventory. No other item of same type will be equipped even


                        if available in inventory.


                        + Determining skill's availability depending on a game switch


                        -------------------------------------------------------------


                        You can also now have skill availability depend on a game switch status, with


                        the following tag to put in a skill's notebox:


                          <Game Switch: n>


                        If the game switch number 'n' is set at false, the skill cannot be used.


                        This might be useful, for example, if you are also using the crafting


                        extension of this plug-in and wish to make crafting available only


                        in certain places/situations.


                        ============================================


                        Displaying Ammunition Amounts & Costs


                        ============================================


                        A given ammunition type is almost always represented by its icon when it


                        is necessary (either to display a cost or a remaining amount).


                        Ammo costs for skills are indicated together with "normal" TP/MP costs.


                        There are several solutions for displaying the remaining ammunition amount


                        so that the player knows where he stands.


                        Most of them are turned on through the plug-in parameters.


                        - For weapons : 


                          + The number of ammunition left can be displayed at the


                            top of the screen when the actor command menu is active.


                            This is the default option.


                          + The number of ammunition left can be displayed in the 


                            command window, just next to the "Attack" option.


                            No icon in that case.


                          + If you are using Yanfly's SkillCore plug-in, you can use the following


                            notetag in the weapon note :


                                <Swap Gauge n: AMMO>


                            ...where n is the number of the gauge you want to replace.


                            Instead of a normal HP/MP/TP gauge, you will then have the amount of


                            ammunition left for the currently equipped weapon.


                        - For skills : 


                          + The remaining amount for each ammunition type can be showed


                            together with cost in the skill window.


                          + It can also be displayed after the skill description, in the help


                            window. This is the default option.


                            In that case, you should keep the skill description within one unique


                            line with no line-break at the end, or else the remaining ammo will 


                            not be visible.


                        The text before ammunition left amounts can be customized with the following


                          notetag in the skill notebox:


                          <Ammo Left Text: xxx>


                          ... with xxx being your custom text.


                        The name of the ammunition type can be displayed along with its icon with


                        the following notetag in the weapon/skill notebox:


                          <Show Ammo Name>


                        Also, in the case of equipment ammunition, several types of


                        ammunition are possible but only one (the one equipped) will be displayed


                        in any skill/help/etc window (or gauge). When there is no more ammunition,


                        the system normally would not know which icon to use !


                        There is a default icon for that, but you can put the following notetag


                        in skill/weapon notebox to define which icon will be used :


                          <No Ammo Icon: i>


                          ... with i being the icon number. 


                        It is also possible to add details about the ammunition type currently 


                        equipped by adding the following notetag in the ammo notebox :


                          <Ammo Window Desc: xxx>


                        Where 'xxx' is the description you want to give to your ammo.


                        This description will show up in the skill help window and the ammunition


                        window visible during actor command selection.


                        Please that if you deactivate the ammo window or the display of remaining


                        ammo amount with the corresponding plug-in parameters, you will of course 


                        not see any description of ammunition !






Plug-in code


Js file download


Add-on : Crafting System

SpoilerSpoiler



                        A skill-based crafting system, requiring Ammunition System because it makes use


                        of its item costs mechanics. Must be placed *below* Ammunition System.


Features


                        - Allow skills to produce items.


                        - Crafting skills must be affected to specific skill types listed in one of the plug-in parameters.


                        - Display of crafting skills products and components' detailed costs and amounts.


How to use :



                                Spoiler



                                        ============================================


                                        Introduction


                                        ============================================


                                        This plug-in provides a skill-based crafting system.


                                        ============================================


                                        Known Compatibility Issues


                                        ============================================


                                        This plug-in is an extension of Ammunition System.


                                        It will not work if Ammunition System is not installed, and


                                        must be placed below it in the plug-in list.


                                        If you are using Bobstah's BattleCommandList plug-in,


                                        you will probably have to manually remove from your actors'battle command


                                        lists the crafting skill types (see below).


                                        ============================================


                                        Use


                                        ============================================


                                        This plug-in functions by allowing skills to produce items of any kind.


                                        The crafting skills (i.e., skills producing items) can consume items


                                        according to the rules of Ammunition System, with some specific tweaks.


                                        Note that crafting skills are not supposed to be used during battle.


                                        For the crafting skills to work properly, they must be given special


                                        skill types that are to be listed inside the plug-in parameter


                                        'Crafting Skill Types'.


                                        Example : create a skill type named 'Alchemy' with number 6 and


                                        put '6' as the value for parameter 'Crafting Skill Types'. Then, give


                                        the skill type Alchemy to some skills that you want to produce items.


                                        Later, if for example you create another crafting skill type named


                                        'Cooking' (number 7), put '6,7' as the value for parameter


                                        'Crafting Skill Types'.


                                        When a skill type is listed in the Crafting Skill Types, there are two


                                        consequences:


                                        - the skill type will not appear during battle (only if you don't use


                                        any plug-ins altering the actor battle command list)


                                        - when in main skill menu, when a crafting skill type is selected, the


                                        normal item window will be replaced. Instead, you will have two windows:


                                        the one at left will display the list of skills corresponding to the


                                        selected skill type (all those skills should be crafting skills),


                                        the one at right will display a list of products and components of


                                        the currently selected skill. Current amounts of products/components


                                        will also be displayed.


                                        Here are the tags to put in crafting skills notebox for defining production :


                                        <Make i Item: n>


                                        <Make i Armor: n>


                                        <Make i Weapon: n>


                                        ... where 'i' is the index of the desired item/armour/weapon and 'n' is the desired


                                        amount.


                                        As for the components, use the same tags as seen in Ammunition System.


                                        However, there is a little difference regarding item consumption.


                                        Weapon and armour-type items will be considered as normal items:


                                        that is, they do not need to be equipped, only the items in inventory will


                                        be accounted for to estimate the available amount (not the ones being equipped),


                                        and all the listed equip-type ammo will be consumed, and not only the one


                                        equipped.


                                        It is possible to customize the texts introducing the products and components


                                        in the craft information window with the following tag to put in the skill's


                                        notebox:


                                        <Craft Product Text: xxx>


                                        <Craft Component Text: xxx>




Screenshots:





Download:


Js file download









Working Demo:


Download Demo !


        (contains demonstration for plug-ins Ammunition System, Crafting extension and Change Equip On Battle) 


        (this demo contains no other plug-ins than the three aforementioned, meaning there is no demonstration for the functionalities depending on external plug-ins - such as Yanfly's plug-ins. Maybe another demo showing special functionalities and interactions with other plug-ins will be released later !)


Credit and Thanks


        - Unconnected42


        You can freely use, edit, or do anything you want with this plug-in, commercially or not. Just give proper credit.
data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7


本贴来自国际rpgmaker官方论坛作者:Unconnected42处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/ammunition-system-add-on-crafting-system.48316/
页: [1]
查看完整版本: Ammunition System &amp; Add-on (Crafting System)