Equipment Variables

● ARCHIVED · READ-ONLY
Started by LadyBaskerville 27 posts Page 1 of 2 View original ↗
  1. Equipment Variables v1.03

    LadyBaskerville


    Introduction
    By default, equipment can change an actor's parameters like MHP, ATK and MDF, and assign a wide range of traits to the actor that has equipped it. However, what equipment cannot do, is to change variables based on which actor - if any - has equipped it. If, for example, you are using Yanfly's Actor Variables plugin to give your actors a set of special "parameters", the only way to make equipment influence these variables is to constantly check the actors' equipment - which comes with another set of problems.

    This plugin simply lets you specify a variable, a value and an actor in the note box of any piece of equipment, and takes care of the rest.

    Features
    - For any piece of equipment, you can specify which variable you want to increase by how much if a certain actor has equipped it. When the actor equips the item, the variable will increase and decrease again when the actor deequips it.

    How to use
    Use a notetag of the format
    Code:
    <Add to Variable: variableId, value, actorId>
    on the note box of a piece of equipment (weapon or armor).

    variableId: The ID of the variable you want to change
    value: The value you want to add to the variable. Use a negative value if you want to decrease the variable.
    actorId: The ID of the actor that has to equip the item for the change to take place. If it doesn't matter which actor has the item equipped, use 0.

    You can put as many notetags underneath each other as you want.

    Examples
    Code:
    <Add to Variable: 11, 10, 1>
    <Add to Variable: 21, 10, 2>
    <Add to Variable: 31, 10, 3>
    <Add to Variable: 41, 10, 4>

    If actor #1 has this equipped, increase variable #11 by 10, but if actor #2 / #3 / #4 has this equipped, add 10 to variable #21 / #31 / #41, respectively.

    Code:
    <Add to Variable: 35, 50, 0>
    If any actor has this equipped, increase variable #35 by 50.

    Plugin
    Download it here: LB_EquipVariables.js

    Demo
    None yet, but if you would like one, let me know :)

    Credit
    - LadyBaskerville

    Terms of Use
    - You may use this plugin in both non-commercial and commercial projects.
    - You may edit this plugin and redistribute your edits, but do not claim you wrote the original code.
    - You may redistribute this plugin elsewhere. In that case, please link back to this plugin thread if possible.

    Author's notes
    As far as I tested it, this plugin is compatible with Yanfly's Equip Core. If you want to use both plugins, place this plugin somewhere below Yanfly's in the plugin list.
    The same applies to HIME_EquipSlotsCore: as far as I tested it, it should be compatible (as of version 1.03) as long as it is placed below Hime's plugin.

    If you find any issues with this plugin, please make sure that you have started a new game after installing the plugin and not loaded the game from a savefile. If that doesn't fix the problem, feel free to leave a bug report in this topic.


    Changelog
    Version 1.03
    - Added compatability with HIME_EquipSlotsCore.
    Version 1.02
    - Fixed bugs with Change Class, Change Weapon/Armor and Seal Slot.
    Version 1.01
    - Added support for negative values.
    - Fixed a bug that kept variables from being reset upon deequipping.
  2. LadyBaskerville said:
    Equipment Variables v1.01


    LadyBaskerville




    Introduction


    By default, equipment can change an actor's parameters like MHP, ATK and MDF, and assign a wide range of traits to the actor that has equipped it. However, what equipment cannot do, is to change variables based on which actor - if any - has equipped it. If, for example, you are using Yanfly's Actor Variables plugin to give your actors a set of special "parameters", the only way to make equipment influence these variables is to constantly check the actors' equipment - which comes with another set of problems.


    This plugin simply lets you specify a variable, a value and an actor in the note box of any piece of equipment, and takes care of the rest.


    Features


    - For any piece of equipment, you can specify which variable you want to increase by how much if a certain actor has equipped it. When the actor equips the item, the variable will increase and decrease again when the actor deequips it.


    How to use


    Use a notetag of the format

    Code:
    <Add to Variable: variableId, value, actorId>

    on the note box of a piece of equipment (weapon or armor).


    variableId: The ID of the variable you want to change
    value: The value you want to add to the variable. Use a negative value if you want to decrease the variable.


    actorId: The ID of the actor that has to equip the item for the change to take place. If it doesn't matter which actor has the item equipped, use 0.


    You can put as many notetags underneath each other as you want.



    Examples

    Code:
    <Add to Variable: 11, 10, 1>
    <Add to Variable: 21, 10, 2>
    <Add to Variable: 31, 10, 3>
    <Add to Variable: 41, 10, 4>

    If actor #1 has this equipped, increase variable #11 by 10, but if actor #2 / #3 / #4 has this equipped, add 10 to variable #21 / #31 / #41, respectively.

    Code:
    <Add to Variable: 35, 50, 0>

    If any actor has this equipped, increase variable #35 by 50.


    Plugin


    Download it here: LB_EquipVariables.js


    Demo


    None yet, but if you would like one, let me know :)


    Credit


    - LadyBaskerville


    Terms of Use


    - You may use this plugin in both non-commercial and commercial projects.
    - You may edit this plugin and redistribute your edits, but do not claim you wrote the original code.
    - You may redistribute this plugin elsewhere. In that case, please link back to this plugin thread if possible.


    Author's notes


    As far as I tested it, this plugin is compatible with Yanfly's Equip Core. If you want to use both plugins, place this plugin somewhere below Yanfly's in the plugin list.


    If you find any issues with this plugin, please make sure that you have started a new game after installing the plugin and not loaded the game from a savefile. If that doesn't fix the problem, feel free to leave a bug report in this topic.


    Changelog


    Version 1.01


    - Added support for negative values.


    - Fixed a bug that kept variables from being reset upon deequipping.

    Your plugin seem nice. UNfirtunatly it's not exactly what I looking for I think but almost.
    I create a game without any battle, but lot of map event.
    When player equip so quipement and are the main character(not a follower), then it's do some special stuff.

    As th stuff in question is to activate a special event page, I guess the best way is not by variable but by switch.
    It's possible to add an extention that if player that was the main character got something equiped then it's put to true the selfswitch?
  3. Meant to post when you released this, but thank you! It is literally just what I had needed at the time you originally posted it. :)
  4. @XGuarden It would be possible, but not quite as simple to program - I would have to take into account all the occasions where the order of the party members can be changed (the Formation access from the menu and the Change Party Member event command are the ones I can think of right now) and update the variables / switches accordingly. It can be done, but I probably won't have time to implement it before next week because of university and work.

    That said, if you only want to activate an event page through the first party member's equipment and don't need a switch for any other purposes, I would suggest using Himeworks' Custom Page Conditions instead with a script call in the Conditional Branch (or just a normal Conditional Branch if you don't need multiple event pages) to check if the party's leader has an item equipped - $gameParty.leader().hasWeapon($dataWeapons[ID]) or $gameParty.leader().hasArmor($dataArmors[ID]) - that seems to be a much more straightforward way of doing it.
  5. LadyBaskerville said:
    @XGuarden It would be possible, but not quite as simple to program - I would have to take into account all the occasions where the order of the party members can be changed (the Formation access from the menu and the Change Party Member event command are the ones I can think of right now) and update the variables / switches accordingly. It can be done, but I probably won't have time to implement it before next week because of university and work.

    That said, if you only want to activate an event page through the first party member's equipment and don't need a switch for any other purposes, I would suggest using Himeworks' Custom Page Conditions instead with a script call in the Conditional Branch (or just a normal Conditional Branch if you don't need multiple event pages) to check if the party's leader has an item equipped - $gameParty.leader().hasWeapon($dataWeapons[ID]) or $gameParty.leader().hasArmor($dataArmors[ID]) - that seems to be a much more straightforward way of doing it.
    Thanks by the time your anwsered J found Himeworks to. Unfortunatly, they have a flaw... when I change party member by menu he did't update as long that I did't tlak to a event that add player or touch a variable.

    Also after many test, I realize that it's better to handle everyting with skill. So weapon give skill and then, I only need now to find a way to chck if main player got a specific skill.
  6. Can this plugin be used as like this?
    When I equip Sword it will increase the sword variable every I make an attack with sword.
    Actor A equip Sword, Actor A attack with sword, Variable Sword +1
    Only Actor A Sword Variable. Not All Actor.
  7. No, this plugin can only change the variables when a weapon is equipped/deequipped - but what you describe sounds like something that could be done with Galv's Weapon Proficiency plugin.
  8. Doesn't seem to work when the weapon is initially equipped, even if you unequip and reequip.
  9. @ZcheK I can't seem to replicate this bug in my testing project. Please answer me some questions so we can track it down:
    - Did you start a new game after adding the plugin, or did you load an old save file for testing? In the latter case, does the bug also occur when you start a new game instead?
    - Do you use any other plugins? If yes, does the bug still occur if you disable all the other plugins in the Plugin Manager and start a new game afterwards? If disabling the other plugins fixes it, could you show a screenshot of your Plugin Manager?
  10. It doesn't work for me. RPGMV 1.5.1
    I turn off all of other plugins but it still doesn't work
    I put this note in weapon notebox <Add to Variable: 23, 10, 2>
    After character equip the weapon, var 23 still = 0
  11. @Isabella Ava Did you increase the maximum on the game variables to include variable 23, like so?
    Image
    MaxVar.png
    (I only just realized that this can be an issue :kaoswt2:)
  12. So, two questions here.
    The first: Does this only work for weapons?
    The second, Is it possible to remove the value that it adds when the equipment is removed?

    Other than that, Plugin works fine.
  13. @epson777341
    1. It works for all kinds of equipment, so weapons and armor.
    2. Yes, that is how it is supposed to work: Add a value to a variable when the weapon/armor is equipped, and remove the value again when the weapon/armor is removed. (There was a bug with this on the first released version of this plugin, but it should be fixed now.)
    Let me know if you encounter any problems :)
  14. Ah, Alright. I see what I did wrong there.

    The variables won't change if the equipment is forcibly removed, IE, changing a class that can't use the equipment, or sealing the slot.

    I'm not sure how I missed the armor thing, I think it doesn't work on initial equipment.

    Thanks for the quick reply.
  15. epson777341 said:
    The variables won't change if the equipment is forcibly removed, IE, changing a class that can't use the equipment, or sealing the slot.
    Thanks for pointing that out, that was indeed something I missed!
    The plugin link in the opening post is now updated to version 1.02, where this should be fixed.
    epson777341 said:
    I'm not sure how I missed the armor thing, I think it doesn't work on initial equipment.
    It should also take the initial equipment into account - at least it does in my testing project (running MV 1.5.1, no other plugin enabled). Did you start a new game after adding the plugin and setting up the notetags, or do you have any other plugins enabled that might interfere with this one?
  16. It does indeed work. I was just having a different issue altogether. Thanks so much for your help.
  17. LadyBaskerville said:
    No, this plugin can only change the variables when a weapon is equipped/deequipped ...
    It's possible to assign the variable when the weapon is also in inventory?
    Because i need to give the variables at all weapons in game. both for the equipment then the inventory.
    Could you modify the script for this mine need? :frown:
  18. @Berin90 Sorry, but I currently don't have the time to add that option :( Also, I think this would work better as a separate plugin anyway - maybe you can try making a thread in Plugin Requests, and ask if someone else could program it for you? If you do, feel free to add a link to this thread in case whoever decides to do it wants to use this plugin as inspiration or make an extension to it.
  19. Updated to version 1.03: Added compatibility with HIME_EquipSlotsCore. When using both plugins, make sure to place this plugin below Hime's.
  20. If using this can I make the extra parameter being changed visible in the equip section of the menu?
    So that, if a shield increases a characters "cool" parameter by 10, the name of the parameter and it's value are visible when equipping the shield.