Check on name change

Discussion in 'RPG Maker VX Ace' started by Kes, Apr 16, 2018.

Thread Status:
Not open for further replies.
  1. Kes

    Kes Global Moderators Global Mod

    Messages:
    17,235
    Likes Received:
    8,990
    First Language:
    English
    Primarily Uses:
    RMVXA
    I am giving the player the choice to change the name of the main characters.
    I am doing this via Show Choices
    If yes, then Name Input command
    If no, then some dialogue.

    I want to change some future dialogue based on whether the name was changed or not.
    I have set a switch ON in the yes branch of the choices. However, it would be possible for a player to choose Yes, and then decide to accept the default name anyway.
    I need to be able to check if a change was actually made before turning that switch ON.
    How would I do that?

    Thanks.
     
    #1
    Dreadshadow likes this.
  2. Dreadshadow

    Dreadshadow Lv 38 Tech Magician Moderator

    Messages:
    3,012
    Likes Received:
    1,858
    First Language:
    Greek
    Primarily Uses:
    RMMV
    Probably using Control Variables: Script.
    Let me try finding the name reference in the rgss3 give me a minute.
     
    #2
  3. Another Fen

    Another Fen Veteran Veteran

    Messages:
    490
    Likes Received:
    210
    First Language:
    German
    The "Conditional Branch" command should actually provide the option to check an actors name (if I'm not horribly mistaken, the 2k3 definitely had this feature and I don't remember its successors removing it).

    Edit: A bit too slow again... =)
     
    Last edited: Apr 16, 2018
    #3
    Kes, Dreadshadow and Faherya like this.
  4. Dreadshadow

    Dreadshadow Lv 38 Tech Magician Moderator

    Messages:
    3,012
    Likes Received:
    1,858
    First Language:
    Greek
    Primarily Uses:
    RMMV
    This is the command,hopefully it will work:

    $game_variables[n] = $data_actors[k].name

    where n is the variable id of your choice and k the id of the actor in the database.

    So you set the default name to a variable and then do your magic.

    Inspired from this:

    Script Call Equivalent of Events

    The rest is just a comparison.


    Ace also got this. So, @Kes you either hardcode the default name in (case solved) or if you wanna do even more complex stuff, you can use script. But to be honest, in your case, @Another Fen delivered!
     
    Last edited: Apr 16, 2018
    #4
    Kes and Another Fen like this.
  5. Andar

    Andar Veteran Veteran

    Messages:
    25,054
    Likes Received:
    5,307
    Location:
    Germany
    First Language:
    German
    Primarily Uses:
    RMMV
    there is no need for scripts, the conditional branch allows a direct check of an actor name compared to a string - that is what is for example used for passwort checks.
    and because you want to check only if the (known) default was changed, you can check against the default name with that.

    the script variant would only be needed if the name to check isn't default, that is if you allow multiple changes of the actor name.
     
    #5
    Kes likes this.
  6. Kes

    Kes Global Moderators Global Mod

    Messages:
    17,235
    Likes Received:
    8,990
    First Language:
    English
    Primarily Uses:
    RMVXA
    @Dreadshadow and @Another Fen and @Andar
    Thank you all so much. I have to admit, after all these years I'd never actually noticed that possibility in the conditional commands.
    This solves my query totally.

    Your help is much appreciated.

    Closing

     
    Last edited: Apr 17, 2018
    #6
Thread Status:
Not open for further replies.

Share This Page