Plugin to save common events

Discussion in 'RPG Maker MV' started by Nilom, May 27, 2019.

  1. Nilom

    Nilom Veteran Veteran

    Messages:
    178
    Likes Received:
    39
    First Language:
    German
    Primarily Uses:
    RMMV
    Hello!

    Is there a plugin that can save common events when transfering on a different map?

    I have the following situation:

    Common Event:
    - code
    - code
    - code
    - player transfer to shop
    - code
    - player transfer back to map

    - code
    - code
    - code
    - etc.

    Instead of continuing the red parts above, the map will completely reset and the common events will restart from the beginning.
    Sure, I could use a bunch of variables inside the common events to disable all parts that would come before the "red parts", after the player was transferred. Thus would basicly lead the common event to continue where it was. But that would overly complicate eventing by a huge degree.



    Does anyone know a plugin that will save common event execution?

    Thanks in advance! :smile:
     
    #1
  2. Dreadshadow

    Dreadshadow Lv 38 Tech Magician Moderator

    Messages:
    3,840
    Likes Received:
    2,488
    First Language:
    Greek
    Primarily Uses:
    RMMV
    How about that:
    Let's say this code is consisted by
    Code 1
    Code 2
    Code 3
    Code 4

    What if I told you that you can put each code part on a different Common Event?
    Then you can create a Common Event, that can call only the Common Events you want.
    Yes of course it will be more common events involved that way, but it will be super flexible, modular and simple in the long run.
     
    #2
  3. Andar

    Andar Veteran Veteran

    Messages:
    28,627
    Likes Received:
    6,573
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    what exactly does your common event do?

    There are ways to write the logic of a common event in a way that the interruption doesn't matter.
    Because usually this only happens if you place too much waits into it or if you place a transfer command at the wrong logic place (the map change always resets all events, and commands after it are almost never executed even on map events)

    but we can't tell you how to rewrite your event without seeing what it does.
     
    #3
  4. mathmaster74

    mathmaster74 just...John Veteran

    Messages:
    285
    Likes Received:
    189
    Location:
    Sheboygan, WI USA
    First Language:
    English
    Primarily Uses:
    RMMV
    @XZINED Okay. You have a common event here, which usually means it's code that's always on or a repeatedly called code routine. In it, you "player transfer to shop". I'm not sure if that's a shop map or not, but...I'm guessing it is because you still have to "player transfer back to map". I struggle to comprehend how these things go together unless you're trying to do something like a "Tonberry Shop". Yanfly has a Tips & Tricks video about how to go about this:



    If that's not what you're after, then let's take your idea about:

    Actually, you need just one conditional statement and one switch to turn the green code on or off. Hence, just before the code line for player transfer back to map, you could throw a switch, we'll call it GreenCode to OFF. By placing the green code inside an If switch GreenCode condition, it will only run when switch GreenCode is ON. (You should also initialize switch GreenCode to ON before this common event ever runs, NOT inside this common event.) To finish the act, somewhere in the lines of red code, flip the switch GreenCode back to ON. Code flow problem solved without overly complicating anything. :smile:
     
    #4
    Nilom likes this.
  5. Shaz

    Shaz Veteran Veteran

    Messages:
    37,800
    Likes Received:
    11,507
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    this is not a transfer to a different map, unless you have replaced the Shop Processing command with an actual shop map.
     
    #5
  6. Nilom

    Nilom Veteran Veteran

    Messages:
    178
    Likes Received:
    39
    First Language:
    German
    Primarily Uses:
    RMMV
    Thanks for all your replies. Sorry that I didn't explain well enough what I'm trying to do.

    Actually, that's exactly what I do. I broke and sorted the code into different sections that I call phases. Some of them have own events that they call, as needed. This way I have a much better overview, can recycle portions of code and it is easier to modify code sections.

    [​IMG]


    Yes it is a shop map. Just for better looks. :D

    [​IMG]

    Yeah I was thinking of something similar like this too. When the player is transferred back, the setup phase will start again (where the board, variables and game will set themselves up). So I would need an If statement inside the setup phase, disabling all the usual code and redirecting to the movement phase instead (from which the shop is called). Inside the movement phase I would need to disable the first block of code (before shop code) and have the after shop code enable the first block again.

    ...But there could be other issues with the player transfer. I would need a plugin to safe all the event locations. I know there is a good plugin for this.
    But perhaps I should just simulate the shop map and perhaps other enterable buildings and just keep everything on the same map?
    [​IMG]

    I could have the shop on the top left of each map, just far enough that it will never be seen inside the player view. The downside is that I would need to merge some tilesets, so that I have one small and efficient "all kind of shop" tileset that I can use for every map. And that it would make the maps bigger. I guess there will be about 3-10 little buildings on each map, that will be enterable.
    What is the maximum tile size of maps? 100x100, 1000x1000? Are bigger maps more performance heavy, even if they have about the same amount of events, or does RPG Maker MV handle "offscreen" well enough?

    What do you think about this solution instead of a real player transfer? :LZSsmile:
     
    #6
    Dreadshadow likes this.
  7. Dreadshadow

    Dreadshadow Lv 38 Tech Magician Moderator

    Messages:
    3,840
    Likes Received:
    2,488
    First Language:
    Greek
    Primarily Uses:
    RMMV
    Wow. SO many things going on here.
    [​IMG]
     
    #7
  8. mathmaster74

    mathmaster74 just...John Veteran

    Messages:
    285
    Likes Received:
    189
    Location:
    Sheboygan, WI USA
    First Language:
    English
    Primarily Uses:
    RMMV
    @XZINED Max. map size is 256 x 256 grid squares. It won't be much more performance heavy to add that little shop (Little Shop of Horrors...uh oh...stuck in head...darnit...) off to the side of the same map as you have pictured here. That would certainly help to preserve event locations although any active events that remain active and in autonomous motion won't stay still, either...hence they may appear to have lost their location when they have not, they just kept running. Note: Being away from the events may take care of this, so it may be a non-issue. IDK. You will have to try/test it to be sure it works as you desire. It seems a lot easier than any alternatives. Best! :smile:
     
    #8
    Nilom likes this.
  9. Nilom

    Nilom Veteran Veteran

    Messages:
    178
    Likes Received:
    39
    First Language:
    German
    Primarily Uses:
    RMMV
    Thank you. 256 x 256... I think that should be enough. If my maps get too big I could use Shaz' tile copy plugin and try to copy whole houses on the same spot, as needed. That way I would only need a little space for the fake transfer.
    @Shaz Is there a limit in the amount of tiles being copied at once by your plugin? (At once to have the autotiles right)
     
    #9
  10. Shaz

    Shaz Veteran Veteran

    Messages:
    37,800
    Likes Received:
    11,507
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    No limit. There is no "having the autotiles right" - they will be copied from one map to another exactly as they appear. They do not reformat based on what's around them. If you have a pool of water and you copy half of it from one map to another, you will have half a pool of water with a straight line along one of the edges.
     
    #10

Share This Page