Persistent Map Events

Discussion in 'RGSS3 Scripts (RMVX Ace)' started by DerTraveler, Sep 5, 2013.

  1. DerTraveler

    DerTraveler Veteran Veteran

    Messages:
    48
    Likes Received:
    38
    Location:
    Osaka, Japan
    First Language:
    German
    Persistent Map Events v2.0
    by DerTraveler

    Introduction

    Adds the possibility to make map events persistent between map and/or page changes. That means that you can leave a map (change a page) and when you return it will be in the exact same state as last time.

    This includes following properties: 

    • position
    • direction
    • position in the current move route
    • changes to the events appearance by the "Set Move Route..." command
    • changes to the movement style (speed, frequency) by the "Set Move Route..." command
    • execution progress of  parallel events
     

    Please note:

    • Autostart events are never saved.
    • All the changes are also included in your save files. Thus, old save files probably won't be compatible anymore.
    • Even though I don't think that this will be any problem with today's hardware, you should note that the event data of potentially every map event the player has met is stored in memory and in your save files. If you have exceptionally many events in your game, this could become a problem.
    It is also possible to only make some of these properties persistents by using notetags on event pages.

     

    Features
    - Set the default persistence behaviour of map events

    - Change the persistence of particular event pages with notetags in comment boxes

    - It is fully customizable which event properties should be persistent via notetags

    Screenshots

    Not necessary. See demo.

    How to Use

    Paste it anywhere in the Materials section.

    Be sure to set the default behaviour in the options section.

     

    Demo
    Download here

    Script

    Can be found in this pastebin.

    Credit and Thanks
    - DerTraveler

    Author's Notes

    Free to use in any non-commercial project. For use in commercial projects please mail me.
     
    Last edited by a moderator: Sep 10, 2013
    #1
    ct_bolt, Archeia, Ravenith and 2 others like this.
  2. Shaz

    Shaz Veteran Veteran

    Messages:
    37,549
    Likes Received:
    11,258
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    Maintaining the position in the move route is a nice addition that I haven't seen in any similar scripts before.
     
    #2
  3. DerTraveler

    DerTraveler Veteran Veteran

    Messages:
    48
    Likes Received:
    38
    Location:
    Osaka, Japan
    First Language:
    German
    Actually it's a very simple approach... I'm just saving away the whole Game_Event objects and restore them in the map initialization process instead of initializing the event...

    I was also thinking about, whether there would be any unwanted side effects of saving the whole object instead of just the position data etc. - by now I have found none.... but perhaps someone else has an idea or finds some bug ;)
     
    #3
    Shaz likes this.
  4. Shaz

    Shaz Veteran Veteran

    Messages:
    37,549
    Likes Received:
    11,258
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    In that case, it would also save changes to the sprite that had been done in a move route (those are usually reset when you leave and re-enter the map). Very nice.
     
    #4
  5. Tsukihime

    Tsukihime Veteran Veteran

    Messages:
    8,230
    Likes Received:
    3,060
    Location:
    Toronto
    First Language:
    English
    Bug: move route saving does not work correctly.


    Steps to reproduce: in your demo


    1. Double-click the brown boulder


    2. Create a new page


    3. Set page condition to Switch 1


    4. Start game, let the boulder move around


    5. Go to map 2


    6. Turn switch 1 ON


    7. Go back to map 1


    8. Brown boulder is now gone as expected


    9. Turn off switch 1


    10. Boulder re-appears.


    11. Bug


    Can't think of when this would be a problem but since the purpose is to remember event details it would seem significant.
     
    Last edited by a moderator: Sep 6, 2013
    #5
  6. DerTraveler

    DerTraveler Veteran Veteran

    Messages:
    48
    Likes Received:
    38
    Location:
    Osaka, Japan
    First Language:
    German
    Thanks for the hint Tsukihime... 
    This is the normal behaviour of the event when the page changes would have occurred both on the event's map.

    Now the question is, what kind of behaviour would you expect of an persistent event? Or is it now a question of different event design?

    I'm thinking about several additional features (which will be able to change globally and with notetags on particular events):

    1. Save event details between page changes - so that when you return to another page, apart from the position everything would be the same again (would fix Tsukihimes bug).

    2. Reset event details completely everytime a page change occurs outside the event's map (would return the boulder to it's original position when switch 1 would be activated on map 2)

    Any other ideas or possible scenarios?
     
    #6
  7. Tsukihime

    Tsukihime Veteran Veteran

    Messages:
    8,230
    Likes Received:
    3,060
    Location:
    Toronto
    First Language:
    English
    I think the event's position should remain the same across page changes. It's the same event after all.


    Or better, provide that as an option for each individual event and let devs decide which one they want to use. Maybe certain events should reset completely while others don't.
     
    Last edited by a moderator: Sep 6, 2013
    #7
  8. DerTraveler

    DerTraveler Veteran Veteran

    Messages:
    48
    Likes Received:
    38
    Location:
    Osaka, Japan
    First Language:
    German
    MAJOR Update including Demo update that demonstrates new features.

    New Features are:

    - Included Own Notetag Code, so no more dependencies ;)

    - Added support for page changes!

    - Added more notetags for full customizability of persistence behaviour

    Have Fun ! :)

    And I'm always happy about feedback or new ideas or bugs. So if you can break the demo, please tell me ;)
     
    #8
    Slight0 and Archeia like this.

Share This Page