Hi! I'm trying to optimice my workflow and wanted some tips!

Discussion in 'RPG Maker MV' started by Ytragof, Jul 24, 2019.

  1. Ytragof

    Ytragof Villager Member

    Messages:
    9
    Likes Received:
    4
    Location:
    Mexico
    First Language:
    Spanish
    Primarily Uses:
    RMMV
    Hey! Me again with yet an other thread for newbie help (Me being the newbie)

    So, I'm still working on the demo I told you guys about a time ago, but now I've come to a complicated scenario:

    I want for X event to Trigger after getting Y item. The specific example:

    You find a Music Box Handle and the Music Box in different rooms and then you bring them to the music room, then you step on a tile with both items in your inventory and a ghost greets you and asks you to assamble it so that she can hear the music box once again by the fireplace.

    Now in order for me to achieve this I did the following:

    Made an event that would trigger with the condition that "Music Box" was in it, and then it would turn on a Switch for the next event to trigger. Now since this is an event that I want to happen without player control, I did it on the ground and with player touch below characters so that it would come out of nowhere. The problem is... The floor is wide so I had to copy paste the event through the entire row of tiles and then the following event a couple of tiles afterwars (Image below) Now...

    I see there's this "R" tab in the Tiles menu and I'm wondering: Is there a way to use the R tiles and assign an event for it? that way I can save up some processing in the engine. I ask this because I noticed the game lagging kinda hard in playtesting after adding the room's events and switches... Or is there a better way to optimice this kind of scenarios where you want voices to trigger out of nowhere?

    Here are some samples of what's going on:

    (5 picture album, The map, the events, and the contents of the events)
     
    #1
  2. standardplayer

    standardplayer Keeper of Kitties Veteran

    Messages:
    410
    Likes Received:
    1,573
    First Language:
    English
    Primarily Uses:
    N/A
    I can't tell which event is which from the pictures you showed, so I don't know what's happening and where.
    But know this. A single parallel event that has a conditional branch, with script selected, with the call
    $gamePlayer.y == 10
    will handle whenever the player steps anywhere on the map where the y coordinate is 10. So that longest row of events could be handled with a single one.
    YtragofExample.png

    Also
    http://www.yanfly.moe/wiki/Region_Events_(YEP)

    The 'R' is for region. It can be accessed in events through the 'Get Location Info' command, but the plugin above is a much more open and better way of using Regions for events.

    However, if you understand the conditional branch I described and where to put that script call, that will work fine for what you're trying to accomplish.


    EDIT If you don't feel comfortable using the script box for any reason, the player's x and y can both be found by using Control Variable/Game Data/Actor/Map X or Map Y

    One last thing, while this isn't necessarily the place to offer edits, the word you're looking for is spelled 'assemble'. I saw it a bunch through the events, that's the only reason i'm mentioning it.
     
    Last edited: Jul 24, 2019
    #2
  3. Ytragof

    Ytragof Villager Member

    Messages:
    9
    Likes Received:
    4
    Location:
    Mexico
    First Language:
    Spanish
    Primarily Uses:
    RMMV
    Thank you very much on your reply. And yeah, thank you for giving me the correct way of spelling the word (English is not my main, sorry).

    I'll try that script of yours. Tho, if we're using the script how can we add the "check for item [Music Box] and [Music Box Handle]"? Also, is there a way that I can use a plugin or something to have the player manually assemble (Got it right this time) the music box like how you do it in like Resident Evil where there's a "Combine" option in the item menu?
     
    #3
  4. Aloe Guvner

    Aloe Guvner Walrus Veteran

    Messages:
    1,626
    Likes Received:
    1,049
    Location:
    USA
    First Language:
    English
    Primarily Uses:
    RMMV
    ^^ please use this approach rather than the script approach. Using scripts inside events is great, but you don't want to do it in a parallel event (executes every frame so 60x per second). The reason is the script options use JS "eval", which is extremely slow. You might not notice it right away, but doing "eval" 60x per second will add to performance issues.

    Another option is a plugin that allows you to make 1 event cross many tiles such as:
    1. https://forums.rpgmakerweb.com/index.php?threads/orange-event-hitboxes-make-larger-events.46958/
    2. https://forums.rpgmakerweb.com/index.php?threads/big-events.89831/
    3. https://github.com/FrogboyMV/TriggerDistance
     
    #4
  5. standardplayer

    standardplayer Keeper of Kitties Veteran

    Messages:
    410
    Likes Received:
    1,573
    First Language:
    English
    Primarily Uses:
    N/A
    You just nest the Conditional Branches inside of one another. When you place a conditional branch inside of another, the inner branch will only be reached if the outer branch passes the check.
    YtragofExample2.png

    In this case, you would begin the event code on the highlighted line, because inside of all three branches is where you'd have the player at Y coordinate 10, they would have the music box and they would have the music handle.

    We're actually just using a 'script call' inside of a conditional branch. Some parts of the Event Commands, such as Control Variable allow you to pass a value with script calls, instead of selecting from just the options the event command makes available.

    As far as combining the items RE style, I don't know if such a plugin exists, I just searched and have seen an old request, but no responses.
    Is it very important for the game that the combine feature be a part of it? Is there a lot of combining like this to happen?
     
    #5
  6. Ytragof

    Ytragof Villager Member

    Messages:
    9
    Likes Received:
    4
    Location:
    Mexico
    First Language:
    Spanish
    Primarily Uses:
    RMMV
    Nah, it's not crucial at all. And all of this is just to try and experiment what I can do with the engine, nothing more than a "tech demo" no story yet, maybe, if I like it enough I would end up writing a story with good characters and a score for it. (Kinda went with a Corpse Party Vibe since I know that game was made in this engine, and wanted to try something other than a classic JRPG formula)

    And yeah, for this part we can just imply that the character did it, without the player actually doing it.

    I really like the limitations in this engine since they kinda make you get creative with what you have. It's simple, easy, and it gives you all the tools you need. Even I, a dude who knows sheep about coding and programing, am able to put up something interesting that someone might enjoy playing.
     
    #6
    standardplayer likes this.

Share This Page