Most effective/accurate way to accomplish progressing dialogue

● ARCHIVED · READ-ONLY
Started by WrathfulCupcake 4 posts View original ↗
  1. Hi everyone,

    So, super new to MV and never programmed before so stumbling through and I think I worked out this way to do progressing dialogue - but I am not sure if this is the most effective solution, as you will see. Also, I am having a slight problem with some of the dialogue repeating itself.

    I hope I explain this clearly, it's a bit wordy!

    Okay so the setup:
    Characters are trying to solve a murder mystery clue-style and throughout the game, various NPCs die. As NPCs die, the dialogue from the remaining NPCs will temporarily change so each NPC says something about the dead person, and then once you've heard the line of dialogue it reverts back to some default line repeated each time you talk to them.

    The problem(s):
    1. Because multiple characters will be dying, and you will be talking to multiple characters, I figured a simple "if character is dead turn switch on" for the dead player, and then a simple "turn switch off" once you spoke with an NPC wouldn't work, because that would then turn the switch off for every NPC the player spoke to after.

    The only way I could think of to get around this would be
    Bob Dies
    <Turn bob dies switch on for Sally>
    <Turn bob dies switch on for Fred>
    <Turn bob dies switch on for Jessica>
    so on about 20 times...

    Then for each NPC I'll need a statement to check and see if a live/dead switch for each character is on.
    - > Talking to Sally
    <Is Sally Bob Dies switch on>
    If so, do X, then Turn switch off
    <Is Sally Fred Dies switch on>
    If so, do X, then Turn switch off
    <Is Sally Jessica Dies switch on>
    If so, do X, then Turn switch off
    so forth about 20 times...

    Is this the most effective solution? That's a lot of switches

    2. If Bob isn't dead, she needs to say something other than her introductory dialogue of "hi I'm sally" so I created a switch to turn introductory dialogue off, then check to see if switch for Bob is on or off. Then created an else statement for some basic text she can say if Bob is alive and this is the second time you've spoken with her.

    The problem I am having is getting the dialogue so the basic stand-in text isn't repeated directly after the character death dialogue. To get around this I made an "else" statement, so in the case below, if the "Old Lady" is dead switch is set to off, she will work properly, but if the "Old Man Dies" the NPC will say his death dialogue and then immediately say the "else" statement.

    I could probably create new event pages to get around that, but then I run the risk of running out of event pages, so ideally I would like to accomplish this with as few as possible to save room for other events.


    I've attached my screenshots, and this is still in setup and mostly placeholder text - I also havent added ALL the switches yet but you can get the general idea.
  2. Use variables in addition to switches.

    The idea is to use one variable for each series of "discoveries" or hints, and when you get one hint you count up the variable by one.
    This creates a form of chapter step counter with a lot of tiny steps, and you'll have to record somewhere (outside the game) which step is what part of the story, and have the different NPCs reaction conditioned on those step numbers.

    It is still a lot of work to keep straight, but it is easier than having to handle dozens of switches.
  3. Thanks, Ill look into that! Just to make sure I understand, you would assign each death a variable?
    So Jessica's Death = Variable Jessica Dead - 1= yes, 2 = no
    Then check to see if variable "Jessica Dead" = 1 then do X?
    or would I have a variable of "Death" and then 1 = Jessica, 2 = Bobby, 3 = Sally, etc
    Would I still use if/else statements then?
  4. no, that wouldn't help at all.

    You'll make a variable "jessica's riddle", and assign numbers 1 - still alive, 2 - talked before death, 3- death, 4 - hint from XY gotten, 5 hint from Z gotten and so forth (or whatever story sequence you want about that part).
    That will allow you to have each NPC track what knowledge the player has about that case, and answer with special hints only after the player already found a connection and ask about it and so forth.