DoubleX RMMV Permanent States

Discussion in 'JS Plugin Releases (RMMV)' started by DoubleX, Oct 31, 2015.

    Tags:
  1. DoubleX

    DoubleX Just a nameless weakling Veteran

    Messages:
    1,447
    Likes Received:
    537
    First Language:
    Chinese
    Primarily Uses:
    N/A
    Note

    This plugin's available for commercial use

    Purpose

    Lets you sets some states to be kept/restored in some set cases

    Games using this plugin

    None so far

    Plugin Calls

     *    # State manipulations                                                    *      1. meta.permanentStates                                                *         - Returns the permanent state scenes and types in                   *           <permanent state: scene, type> in the form of                     *           { battle: types, map: types } with types being an Array storing   *           all unique String type or an empty Array if scene matches and     *           doesn't match the property name storing types respectively        *      2. meta.permanentStates = [scene, types]                               *         - Sets the permanent state scene and types in                       *           <permanent state: type> as { battle: types, map: types } with     *           types being an Array storing all unique String type which will be *           used in the scene matching the property name storing types        *         - All meta.permanentStates changes can be saved if                  *           DoubleX RMMV Dynamic Data is used                               
    Notetag

     *    # State Notetags:                                                        *      1. <permanent state: scene, type>                                      *         - scene can be either battle or map, meaning the state can be       *           restored in battle or map respectively                            *         - type can be either persist, recover or revive, meaning the state *           will be kept upon death or recover all, or added back upon revive *           respectively                                                      *         - The same state can have more than 1 permanent state scene/type  
    Prerequisites

    Abilities:

    1. Little Javascript coding proficiency to fully utilize this plugin

    Terms Of Use

    You shall keep this plugin's Plugin Info part's contents intact

    You shalln't claim that this plugin's written by anyone other than DoubleX or his aliases

    None of the above applies to DoubleX or his/her aliases

    Changelog

     *      v1.02c(GMT 0100 4-12-2015):                                            *      1. Fixed undefined all array function which should be empty instead    *      2. Increased this plugin's compactness, efficiency and robustness     *      v1.02b(GMT 0800 2-12-2015):                                            *      1. Fixed reading repetitive notetag values due to typo bug             *      2. Fixed permanent state type persist not working due to typo bug      *      3. Fixed null permanent state container due to wrong init timing bug   *      4. Fixed undefined $gameParty upon actor initializations bug          *      v1.02a(GMT 1400 1-12-2015):                                            *      1. <permanent state: type> has changed to                              *         <permanent state: scene, type>                                      *      2. Added new permanent state type recover restored upon recover all    *      3. The same state can now have more than 1 permanent state type        *      4. Removed param allStatesPermanent in the plugin manager              *      5. Fixed undefined permanent state containers upon loading savefiles  *      v1.01h(GMT 0600 29-11-2015):                                           *      1. Fixed clearing all states upon calling Recover All event command    *      2. Fixed notetags not reading at all due to treating "null" as falsey *      v1.01g(GMT 0300 29-11-2015):                                           *      1. Fixed undefined error due to non persist nor revive poermanent type *      v1.01f(GMT 1200 27-11-2015):                                           *      1. Fixed undefined state_id in store_permanent_states due to typo bug *      2. Increased this plugin's efficiency, readability and robustness     *      v1.01e(GMT 0900 25-11-2015):                                            *      1. Fixed wrong number of arguments when loading state notetags bug     *      2. The aliased functions can be accessed by other custom plugins now   *      3. Exposed the state plugin calls that can access the notetag values  *      v1.01d(GMT 1600 6-11-2015):                                            *      1. Simplified the notetag reading mechanisms                           *      2. Fixed undefined this under forEach bug                             *      v1.01c(GMT 1300 5-11-2015):                                            *      1. Fixed undefined this under DoubleX_RMMV.Permanent_States bug       *      v1.01b(GMT 0000 5-11-2015):                                            *      1. Fixed failing to load notetags due to nil $dataStates bug          *      v1.01a(GMT 1300 4-11-2015):                                            *      1. The notetag <permanent state> has changed to <permanent state: type> *      2. Fixed several logic and syntax errors                               *      3. Increased this plugin's maintainability                             *      v1.00a(GMT 0800 31-10-2015):                                           *      1. 1st version of this plugin finished                               
    DoubleX RMMV Permanent States v102c.rar
     

    Attached Files:

    Last edited by a moderator: Dec 4, 2015
    #1
    Cvrtis, Chickenlump and Roguedeus like this.
  2. DoubleX

    DoubleX Just a nameless weakling Veteran

    Messages:
    1,447
    Likes Received:
    537
    First Language:
    Chinese
    Primarily Uses:
    N/A
    Updates

    Code:
     *      v1.01a(GMT 1300 4-11-2015):                                            *      1. The notetag <permanent state> has changed to <permanent state: type> *      2. Fixed several logic and syntax errors                               *      3. Increased this plugin's maintainability                            
     
    #2
  3. Roguedeus

    Roguedeus Veteran Veteran

    Messages:
    506
    Likes Received:
    103
    First Language:
    English
    Out of curiosity, would you be willing to add: type = "battle" and "rest" so the state only pops up in battle or out of battle?

    Possibly, in addition to "persist" and "revive".
     
    #3
  4. DoubleX

    DoubleX Just a nameless weakling Veteran

    Messages:
    1,447
    Likes Received:
    537
    First Language:
    Chinese
    Primarily Uses:
    N/A
    I'll think about it :)

    Updates

    Code:
     *      v1.01b(GMT 0000 5-11-2015):                                            *      1. Fixed failing to load notetags due to nil $dataStates bug          
     
    #4
    Roguedeus likes this.
  5. Roguedeus

    Roguedeus Veteran Veteran

    Messages:
    506
    Likes Received:
    103
    First Language:
    English
    Good enough for me. ;)
     
    #5
  6. DoubleX

    DoubleX Just a nameless weakling Veteran

    Messages:
    1,447
    Likes Received:
    537
    First Language:
    Chinese
    Primarily Uses:
    N/A
    Updates

    Code:
     *      v1.01d(GMT 1600 6-11-2015):                                            *      1. Simplified the notetag reading mechanisms                           *      2. Fixed undefined this under forEach bug                             *      v1.01c(GMT 1300 5-11-2015):                                            *      1. Fixed undefined this under DoubleX_RMMV.Permanent_States bug       
     
    Last edited by a moderator: Nov 7, 2015
    #6
  7. DoubleX

    DoubleX Just a nameless weakling Veteran

    Messages:
    1,447
    Likes Received:
    537
    First Language:
    Chinese
    Primarily Uses:
    N/A
    Updates

    Code:
     *      v1.01e(GMT 0900 25-11-2015):                                            *      1. Fixed wrong number of arguments when loading state notetags bug     *      2. The aliased functions can be accessed by other custom plugins now   *      3. Exposed the state plugin calls that can access the notetag values  
     
    #7
  8. Roguedeus

    Roguedeus Veteran Veteran

    Messages:
    506
    Likes Received:
    103
    First Language:
    English
    Have you decided not to add the battle and rest options I asked about above?
     
    #8
  9. DoubleX

    DoubleX Just a nameless weakling Veteran

    Messages:
    1,447
    Likes Received:
    537
    First Language:
    Chinese
    Primarily Uses:
    N/A
    No, but because it turns out that I'm still not completely familiar with Javascript yet, as I'm still making quite some silly errors(so I want to ensure this plugin does work before adding anything further) :)
     
    #9
  10. fireflower46

    fireflower46 Villager Member

    Messages:
    19
    Likes Received:
    6
    First Language:
    English
    I'm sorry to complain DoubleX, but I'm having trouble with this plugin. I keep getting the message: "TypeError: Cannot read property 'push; of undefined" whenever the "Recover All" event command is implemented. Do you know of any way this can be fixed?
     
    #10
    DoubleX likes this.
  11. DoubleX

    DoubleX Just a nameless weakling Veteran

    Messages:
    1,447
    Likes Received:
    537
    First Language:
    Chinese
    Primarily Uses:
    N/A
    Updates

    Code:
     *      v1.01f(GMT 1200 27-11-2015):                                           *      1. Fixed undefined state_id in store_permanent_states due to typo bug  *      2. Increased this plugin's efficiency, readability and robustness     
     
    #11
  12. fireflower46

    fireflower46 Villager Member

    Messages:
    19
    Likes Received:
    6
    First Language:
    English
    I've had a chance to try the new revision (v1.01f). But I'm still getting the same error. But I have noticed that the error occurs anytime the "death" or "knockout" state are either added or removed. That's when I get the error that I mentioned before. I hope this helps.
     
    #12
  13. DoubleX

    DoubleX Just a nameless weakling Veteran

    Messages:
    1,447
    Likes Received:
    537
    First Language:
    Chinese
    Primarily Uses:
    N/A
    I think you'll have to show me all the permanent state notetags you instances used. Right now only <permanent state: persist> and <permanent state: revive> are valid notetag instances :)
     
    #13
  14. fireflower46

    fireflower46 Villager Member

    Messages:
    19
    Likes Received:
    6
    First Language:
    English
    I don't have any note tags for any of my states yet so I'm afraid I cannot show you anything. All I know is that the Death/KO state is causing the error message mentioned before.
     
    #14
  15. DoubleX

    DoubleX Just a nameless weakling Veteran

    Messages:
    1,447
    Likes Received:
    537
    First Language:
    Chinese
    Primarily Uses:
    N/A
    How about the value of param all_states_permanent in the plugin manager?
     
    #15
  16. fireflower46

    fireflower46 Villager Member

    Messages:
    19
    Likes Received:
    6
    First Language:
    English
    I have it on "null." Should it be something different?
     
    #16
    DoubleX likes this.
  17. DoubleX

    DoubleX Just a nameless weakling Veteran

    Messages:
    1,447
    Likes Received:
    537
    First Language:
    Chinese
    Primarily Uses:
    N/A
    Turns out that the problem's on my end :)

    Updates

    Code:
     *      v1.01g(GMT 0300 29-11-2015):                                           *      1. Fixed undefined error due to non persist nor revive poermanent type
     
    #17
  18. fireflower46

    fireflower46 Villager Member

    Messages:
    19
    Likes Received:
    6
    First Language:
    English
    I have good news and bad news. First the good news: your revision fixed the issue I was having before. The bad news: your plugin and note tags are not immune to the effects of the "Recover All" event command. When "Recover All" is implemented, it removes ALL states from the actors whether they're good or bad. I want to create a state that cannot be removed with this event command but I also want to be able to remove it using the "Change State" event command. Would you be willing to implement this change in your next revision?
     
    #18
  19. DoubleX

    DoubleX Just a nameless weakling Veteran

    Messages:
    1,447
    Likes Received:
    537
    First Language:
    Chinese
    Primarily Uses:
    N/A
    Updates

    Code:
     *      v1.01h(GMT 0600 29-11-2015):                                           *      1. Fixed clearing all states upon calling Recover All event command    *      2. Fixed notetags not reading at all due to treating "null" as falsey 
     
    #19
  20. fireflower46

    fireflower46 Villager Member

    Messages:
    19
    Likes Received:
    6
    First Language:
    English
    I'm sorry to be the bearer of bad news again. But your recent revision still didn't work. The state I have tagged as permanent still gets removed from "Recover All." Though, I do have the state with both note tags on it. But I would like to suggest adding a new note tag so that we have the option of having states being removable by "Recover All" or not; something like <permanent state: recover all>.
     
    #20
    DoubleX likes this.

Share This Page