Actor Switches & Variables v1.2

Discussion in 'JS Plugin Releases (RMMV)' started by lordvalinar, May 8, 2019.

  1. lordvalinar

    lordvalinar Lord of the Damned Veteran

    Messages:
    162
    Likes Received:
    29
    Location:
    Hell on Earth
    First Language:
    English
    Actor Switches & Variables v1.2
    LordValinar

    Introduction
    With RPG Maker MV, switches and variables are globalized - saved within the $gameSystem object. Well there might have been times when you or I required personalized switches/variables to the actor themselves (Races? Gender? Corruption count?) Well now you can!

    Features
    - Allows you to store a switch or variable (default max is 5,000, same as the Engine, but this can be smaller or larger depending on your project) on each individual actor! No more sharing!
    - Group tagging is also available (setting a switch or variable to all party members)
    - Can "toggle" switches on an actor (or party-wide) instead of setting them for quick-usage.
    - More complex methods allowing you to manipulate "Input Number.." event commands for even greater possibilities!

    How to Use
    This is a [Core] script, and can be imported into other plugins, so you should put this plugin somewhere near the top of your plugin order as it won't override anything. NOTE: Importing is not a part of these instructions.

    Once placed in and turned ON, there are four plugin parameters that can be configured. It's best to leave the maximums alone, but you can reduce them for your project. (Going over 5000 is -NOT- recommended..) The Storage parameters are optional, but if you intend to add some flexibility in your actor's variables, then feel free to assign 2 variable slots here.

    After that, you're good to go! You can use the following plugin commands and script calls where necessary. The Script Calls are recommended for conditional branches within Events.

    Demo
    While I don't think this plugin needs a demo (it worked in the demo I tried), I can upload one if desired.

    Script
    The script/code is included in this post.
    -- UPDATED v1.2 --

    FAQ
    Q: No questions yet
    A: Ask and I shall answer

    Credit and Thanks
    - LordValinar
    - Shaz (for ideas in my initial thread)

    Author's Notes
    TERMS OF USE: Free to use and modify for commercial and noncommercial games, with credit.
     

    Attached Files:

    Last edited: May 10, 2019
    #1
    atoms, TheTitan99 and Eliaquim like this.
  2. Eliaquim

    Eliaquim Raze: The Rakuen Zero's Guardian! Veteran

    Messages:
    608
    Likes Received:
    181
    Location:
    Brazil - Rio de Janeiro
    First Language:
    Portuguese - Br
    Primarily Uses:
    RMMV
    A great plugin! I like the idea, there are much possibilities!
    Thank you! ^^
     
    #2
    lordvalinar likes this.
  3. lordvalinar

    lordvalinar Lord of the Damned Veteran

    Messages:
    162
    Likes Received:
    29
    Location:
    Hell on Earth
    First Language:
    English
    Whoops! Minor mistake for 'SetGroupVariable' (looking for "-1" and not "true"), but Fixed that and re-uploaded as v1.1 now ^_^

    And thank you @Eliaquim Make sure to download the new one(fix), but I hope you like it. As I mentioned, the plugin worked on my demo, but if you ever have questions (or need me to post a demo) I will be glad to help ^_^
     
    #3
    Eliaquim likes this.
  4. lordvalinar

    lordvalinar Lord of the Damned Veteran

    Messages:
    162
    Likes Received:
    29
    Location:
    Hell on Earth
    First Language:
    English
    Errr... okay 1 last mistake (I hope you all will forgive me. First released plugin and there's bound to be issues).
    You can either choose to Search and Replace the issue yourselves, or download the new v1.2 :p

    Search for "value = (value === 'true') ? true : false; // convert to boolean"
    - Replace with (2 instances within the script) -
    value = (args[1] === 'true') ? true : false; // convert to boolean

    (Underlined the mistake). Since the value variable was converted to a Number initially (because most of the checks were for numbers), then value will no longer be defined as 'true' or 'false' :\ So instead we just get the argument itself
     
    #4

Share This Page