Plugin for self-variables in common events

Discussion in 'JS Plugin Requests' started by Nachorl250, Jan 2, 2017.

  1. Nachorl250

    Nachorl250 Veteran Veteran

    Messages:
    34
    Likes Received:
    2
    First Language:
    Spanish
    Hi everyone! How are you? 


    So I released an action rpg game about a year ago, and after a lot of updates I decided that the most intelligent thing to do was move each type of enemy to a common event so that I don't have to manually make every update in every single event in every single map. I figured the best way to do this would be to change variables to self-variables that only apply to the current common event, making copy-pasting really easy. 


    The thing is I already tried various self-variables plugins (Yanfly's, himework's,  u'ki's) and they all have one of two problems:


    -They only work with map events, having to specify the map ID in the scriptcall/plugin command used. I need the plugin to set self-variables for each common event. 


    -They crash if not on a new savedata. I need the plugin to work with already created savedatas as the game was already released and I don't pretend every player to start over for the update to work. 


    Does anybody know or can make a plugin that meets my needs? 


    Thank you all for the attention and hope you have a great New Year! 
     
    #1
  2. Andar

    Andar Veteran Veteran

    Messages:
    27,483
    Likes Received:
    6,131
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    Unfortunately, there are reasons for those limitations - and making something without them is a lot more difficult than you think. Otherwise a lot of people would already do things otherwise. And those limitations are caused by general programming logic that requires a lot of work to get around.


    You might get lucky, but I don't think so, especially not with the requirement to keep the old savedata compatible. Unless someone redirects error handling (which would cause other problems) you'll need a versioning system to detect which kind of data was not available in old savefiles and redirect that. Not something likely in a free request...
     
    #2
    Nachorl250 likes this.
  3. Nachorl250

    Nachorl250 Veteran Veteran

    Messages:
    34
    Likes Received:
    2
    First Language:
    Spanish
    Well, that sucks :/ I'll have to think of a better way of making it work without self variables then. I just supposed if self-switches worked without a problem, self-variables would be the same. 


    Thanks a lot for the quick response!!! You sure saved me a lot of useless searching. 
     
    #3
  4. Andar

    Andar Veteran Veteran

    Messages:
    27,483
    Likes Received:
    6,131
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV


    Exactly - but common events don't have self-switches either, the self-switches only work on the map events. If a map event calls a common event, then those commands get transferred back to the map events (and it would probably be the same with map-based self-variables), but the common events themselves can have neither self-switches nor self-variables.
     
    #4
    Nachorl250 likes this.
  5. Nachorl250

    Nachorl250 Veteran Veteran

    Messages:
    34
    Likes Received:
    2
    First Language:
    Spanish
    Wow,  I'll have to check then. I have the enemy's HP defined in the common event with a self switch and it works flawlessly. I guess I'm setting the HP somewhere else too and the common event isn't doing anything? 
     
    #5
  6. Andar

    Andar Veteran Veteran

    Messages:
    27,483
    Likes Received:
    6,131
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    it depends on how you do something, and how the plugin controlling the variables work.


    If the self-switches work in that case, then you're calling the common event from the map event - they will not work if the common event is called from a skill or triggered as a paralel/autorun.. It's based on object hierarchy, but that will probably go too far into programming logic to explain.


    You can try to have a plugin made that gives event self-variables and enable them to be called from a common event if that common event is part of the map event - that will work. But that is something different from your original description in the first post.
     
    Last edited by a moderator: Jan 2, 2017
    #6
    Nachorl250 likes this.
  7. Shaz

    Shaz Veteran Veteran

    Messages:
    37,103
    Likes Received:
    10,982
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    Do you mean your enemies are map events, and you are just calling the common event?  With a Call Common Event command, the common event behaves as if it's a part of the map event, so 'self' is the map event.  This means you can use Control Self Switches in a common event, and the event that calls it is the one whose self switches will be changed.


    There are workarounds for both of the problems you mention above.


    1. this._mapId and this._eventId can be used in script calls (and possibly plugin commands) to refer to the current map and current event.  You don't have to hardcode the map id in your calls.


    2. The plugin can be modified to check a game on loading and create the structures required if they don't exist in the saved game.


    I suggest you decide which plugin you want to use, and then make a request for the changes you need.
     
    #7
    Nachorl250 likes this.
  8. Nachorl250

    Nachorl250 Veteran Veteran

    Messages:
    34
    Likes Received:
    2
    First Language:
    Spanish

    Thank you for all the help guys! The common event is a parallel process, not being called, so I guess there's something setting the enemy's HP somewhere and that's why the self-switch is 'working', or rather another event is doing its work. 


    I guess my best bet will be to change the way I'm doing this stuff, as my plan explicitly needed self-variables. 


    In case anyone is curious:

    If you want to know and didn't fully understand my explanation above, I can make and post a more graphical explanation of my idea with screenshots. 
     
    #8
  9. ICF-Soft

    ICF-Soft Veteran Veteran

    Messages:
    202
    Likes Received:
    90
    First Language:
    Spanish
    Last edited: Feb 3, 2017
    #9
    Nachorl250 likes this.
  10. Nachorl250

    Nachorl250 Veteran Veteran

    Messages:
    34
    Likes Received:
    2
    First Language:
    Spanish
    I will try them and let you know! 
     
    #10
  11. Nachorl250

    Nachorl250 Veteran Veteran

    Messages:
    34
    Likes Received:
    2
    First Language:
    Spanish
    Wow. Just checked your blog. You're from Argentina? I am too!
     
    #11
  12. Andar

    Andar Veteran Veteran

    Messages:
    27,483
    Likes Received:
    6,131
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    @Nachorl250, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.


    Additionally, please don't quote entire posts for simple and direct answers, it makes the topic difficult to read. If you have to reference someone, use the @username shortcut like I did above.
     
    #12
    Nachorl250 likes this.
  13. ICF-Soft

    ICF-Soft Veteran Veteran

    Messages:
    202
    Likes Received:
    90
    First Language:
    Spanish
    Well. I'm from Spain. Blogger switchs domain extension based on country.
     
    #13

Share This Page