Talk to Followers

Discussion in 'RMVX Ace Tutorials' started by Ebanyle, Apr 24, 2019.

  1. Ebanyle

    Ebanyle Veteran Veteran

    Messages:
    286
    Likes Received:
    164
    Location:
    Brazil
    First Language:
    Portuguese
    Primarily Uses:
    RMVXA
    Do your characters feel lonely even if they are accompanied? Are you lost, with no hints of what to do? With the Talk To Follower system, no more! Unless your follower is also lost, but at least you are not alone.

    Warning: This system mostly requires a "Turn Around" system. You can use sirbilly's or Black Morning Base Script, which features a turn-in-place by maintaining one key pressed.
    You would still be able to use this system even if you don't have any Turn Around system, but without it this system is pretty much pointless.
    I also used a follower control script (Tsukihime Followers Move Routes) to make the follower look at the leader, but that is not required.


    This tutorial is to make your party leader able to interact to their followers like they are events. With that, you can do talk systems and more!
    Currently, I only designed it with one follower in party, or simple only being able to talk to the first follower. I'm not sure if I will try test with more followers and with other scripts that affect movement, though.
    Since it's very long, I'm providing a demo at the end of this topic.

    Let's get started!
    Average things used: 4 switches, 8 variables

    1. Getting the coordinates of the follower

    First, we will get the coordinates of our follower. This is mostly done because of the "looking at the follower" function, so if you are not using that, this step may not be necessary. It depends on how you will build your "Follower Interact" event.
    Anyway, to do so, we will use 4 variables to get the X and Y of both leader and follower.
    Create a Common Event in Parallel Process. For that, we will then set a switch that will make it always active, so it's constantly checking our player's position.
    Don't forget to add a Wait command at the end of the whole process, otherwise your game will freeze.

    [​IMG]
    [​IMG]
    You can also set it to 10 frames. It depends on how many lag it can make in your game

    Getting the X/Y of the leader is easy: in the Control Variable command, we will click at Game Data in the Operand and choose Character > Player's > Map X/Y

    [​IMG]

    [​IMG]

    And thus, we have the player coordinates ready to be checked.
    However, the default commands do not provide a way of getting the followers X/Y.
    Fortunately, we can do it using a script call: $game_player.followers[follower_ID].(coordinate)
    [​IMG]
    Set [follower_ID] to the ID of the follower you wish to interact to (see below), and (coordinate) to either X or Y.

    Notice how you need to specify a value next to followers? This is the follower index. It means that it will retrieve the data from the follower of ID 0. And since follower index starts by 0, we are talking about the first follower.
    So, if you set that value to 7, it will check the 7th follower in the line, 9th actor in the team.

    2. Compare the coordinates of the follower and leader

    Now what we will do is to compare the coordinates of the follower and the leader so we can check in what side is the follower.
    If you wish to, you can set a Condition before all of that to check if the party has only one character. If you specifically check the followers ID, this is not needed, I suppose.

    [​IMG]
    No ghost talking!

    Before comparing our coordinates, we will check if the player is pressing the interact button. We need to do so to guarantee that the directions are being checked properly. Leave an blank Else (Set handling when conditions do no apply) to prevent any bugs.

    [​IMG]
    If you wish to specify the follower's ID, this is where you do it:
    [​IMG]
    Remember that, when dealing with followers, the index will start at zero. But when dealing directly with actors, the index starts at 1 and includes our leader. So we will check our second actor, follower of index 0.

    Now, finally, we will compare the coordinates we picked, alongside checking for the player directions.
    That's a very simple formula that goes like this: $game_variables[Follower_X/Y] == $game_variables[Leader_X/Y] [Operation]=1
    We are not checking any diagonals, so we won't need 2 conditions attached together. Simple check the four sides of your actor. It looks like this:

    [​IMG]
    And then, it will look like this:

    [​IMG]

    REMINDER: Put a 10 frames delay right below the Button Check, so when you finish your conversation it will not toggle it again when you're just pressing the button to close the window.
    [​IMG]

    3. Turning follower and identifying actor

    What we will do know is setting the common event according to the actor we're interacting with. Remember the "Follower 1 ID" variable? That's where we will check it.
    To make it simpler, I'm going to do 3 things now.

    1 - I'm setting a label to whatever comes next, so we don't need to copy and paste all of the actions in the other direction/XY checks. I will name it "Check[ACTOR_ID]", and will use the Jump to Label command to call it anywhere in the event!
    2 - Before identifying whichever actor we're interacting to, we will make them act. That's where the Follower Control script enters. Since I'm using Tsukihime's, it will look like this (open spoiler below)
    3 - And finally, I will identify the follower ID. Depending on who is it, I will activate a switch. That will be explained in short.

    [​IMG]
    (I forgot the 10 frames delay, but don't forget it D:<<)
    [​IMG]

    4. Making the "talk"

    Here's up to you, really. In my case, I'm making a very simple conversation. The demo has a more complex one that involves switches, more labels, and choices that affect the gameplay.
    I'm creating a new common event, set with Parallel Process that is activated by the "Actor [ID] Interaction" switches I previously activated. In reality, you could event set just one and check in that common event the "Follower ID" variable, but since you may add up a higher quantity of commands over time, it's good to separate between actors. In fact, sometimes it can get so big, it's good even to separate one actor conversations in another common events.
    Remember to always set a switch to the common event and activate it to call the conversation. Do NOT call the common event, as some commands may loop.

    [​IMG]
    Reminder: I made a mistake and placed the Follower Direction Variable in the wrong place. If you place it in the character Common Event, they will be already turned so the check will be useless. Place it HERE:
    [​IMG]

    [​IMG]
    Don't forget the delay or it will freeze!
    "Wait, what is that first variable and that "Turn Back" common event? Weren't common event callings prohibited?"
    We'll check that below! ↓

    5. Exiting processing and making the characters turn back

    Finally, we're in the last step of our tutorial! So, let me explain the purpose of this unknown commands:
    In the "Follower 1 Direction", we'll simply store what direction the follower was facing before our leader came to bother them.
    You can store the Leader direction in the Game Data section of variables, but no the follower.
    So we will use the script call: $game_player.followers[FOLLOWER_ID].direction

    Remember that the values returned will be the same as those of the computer keypad:
    2 ↓ Down
    4 ← Left
    6 → Right
    8 ↑ Up

    And that another code...
    $game_player.turn_away_from_character($game_player.followers[FOLLOWER_ID]
    ...is to simply make our actor turn away from the follower within the specified ID.
    As mentioned before, if you're not turning the followers (and that needs the help of a script), ignore the turning commands and only deactivate the switches.
    Yep, deactivate them. Otherwise, your conversation common event will keep looping. Forever. Ever.
    SO REMEMBER TO DEACTIVATE THEM!!!

    [​IMG]

    Notice that not only I deactivated ALL the interactions switches, since this same common event will serve to exit any of them; I also deactivated them by batch. If they are all lined up, you can simple do that this way:

    [​IMG]

    [​IMG]

    And of course, you can't be too careful.
    [​IMG]

    Finally, this will be our ending result:

    [​IMG]

    I'm not an expert with events, so please if you have any bugs, report them to me and maybe I can try solving them!
    It's preferable to download the demo and copypaste the example Common Events, since the event can be really complicated to build.

    >Download Link<
     
    Last edited: Aug 17, 2019
    #1
    SoftCloud likes this.

Share This Page