Branching story and multiple ending question

Hi guys, I read that you can have a branching story as well as multiple ending but I couldn't find a more detailed answer. Was wondering if any of you guys can give an example on how to do the branching story that would result in different endings depending on your choice. Thank you in advance!

PS: Was wonderin also if you guys know of where I can find a good tutorial on how to make my own custom window for the general menu (so i want a different window for the dialogue and a different window for the menu)
For your PS: you would need to change the windowskin setting (via script) of each window for the main menu if you want it to use a different windowskin than the message boxes...


For the main question: well, there are so many ways to do this... like using choices and switches or variables... basically, when you do something that should make the ending different, you can set a switch or a variable to a certain value then check that during the ending to determine which ending to show...


PS: oh, filipino?
For your PS: you would need to change the windowskin setting (via script) of each window for the main menu if you want it to use a different windowskin than the message boxes...

For the main question: well, there are so many ways to do this... like using choices and switches or variables... basically, when you do something that should make the ending different, you can set a switch or a variable to a certain value then check that during the ending to determine which ending to show...

PS: oh, filipino?
._. is there a site that perhaps can give me a tutorial on how to do the script? Also do you happen to know if there's any way I can adjust the placement of the text inside the dialogue box because they're too high xD in mine. 

For the multiple: Would variables be better you think? I use variables to permanently end an event. For some reason, when I use switch, it doesn't work =/. I'm actually restarting my project from scratch too. 

PS: yeah pinay =) pero nakatira na ako sa america xD pilipino ka prin pala > 🙂
it's easily explained, but difficult to do - whenever you get to a story branch, you record the player's choice by a switch or variable.


At every point where that choice have different effects, you make the event with several pages and have them conditioned to those switches, displaying different texts or sequences depending on previous choices.


And at the end, you select the ending (or the maps that the player can go to) depending on the same switches and variables.


The difficulty is keeping track of the variables used and making different events and maps for every story branch, and keep that consistent through the game...


Edit:

I use variables to permanently end an event. For some reason, when I use switch, it doesn't work =/. I'm actually restarting my project from scratch too.
It should be easier with switches, so you're doing something wrong.
My guess would be that you're getting tricked by the priority of the pages in an event - please show screenshots of all pages in an event where it goes wrong, and we can tell you how it's done correctly.
I actually did it on my projects, but I'm not on my comp (I'm at the office, working) so I can't fetch it up...

but basically you will go to each window that you wanna change, find the start method, and put a line there saying:

self.windowskin = "NameHere"

where NameHere is the name of the windowskin file inside the Graphic\Systems folder of your game...

alternatively, you could just probably add a new method inside each of the window classes that you want to change

def windowskin return "NameHere"endFor the endings, if it's so many endings, I would suggest variables...PS: I think using the native tongue isn't much allowed in public conversations... (not sure for private but it's private so I guess they won't have much problem with that)
it's easily explained, but difficult to do - whenever you get to a story branch, you record the player's choice by a switch or variable.

At every point where that choice have different effects, you make the event with several pages and have them conditioned to those switches, displaying different texts or sequences depending on previous choices.

And at the end, you select the ending (or the maps that the player can go to) depending on the same switches and variables.

The difficulty is keeping track of the variables used and making different events and maps for every story branch, and keep that consistent through the game...

Edit:

It should be easier with switches, so you're doing something wrong.

My guess would be that you're getting tricked by the priority of the pages in an event - please show screenshots of all pages in an event where it goes wrong, and we can tell you how it's done correctly.
Thank you! I think I understand what you mean, I scrapped my old project but I'll do some test runs to see if I can do the switch properly. Also thank you for your patience with breaking down the explanation for me. 

I actually did it on my projects, but I'm not on my comp (I'm at the office, working) so I can't fetch it up...

but basically you will go to each window that you wanna change, find the start method, and put a line there saying:

self.windowskin = "NameHere"

where NameHere is the name of the windowskin file inside the Graphic\Systems folder of your game...

alternatively, you could just probably add a new method inside each of the window classes that you want to change

def windowskin return "NameHere"endFor the endings, if it's so many endings, I would suggest variables...PS: I think using the native tongue isn't much allowed in public conversations... (not sure for private but it's private so I guess they won't have much problem with that)
Do I make a new custom script for it or do I go to the main script? Btw, for the graphics of the windows of the menus, can I use the original window template for it as my template?
Well, it's either you edit the default scripts or just make a new one... it really depends...

though well, making a new one might be better... something like

class Window_MenuItem def windowskin return "WindowM" endendclass Window_MenuActor def windowskin return "WindowA" endendNote: I'm not sure if using a custom windowskin method works since I haven't tried it (I only realized trying to do it right now, I used the modify the start method up until now) but theoretically, it should work... Now I wonder why I didn't do it the first time I went changing windowskinsAs for the template, yes you can use the original windowskin as a template... you're probably better off doing so actually, to ensure that you get the positions right...
Moreover than the technic to do this, you'll most of all need to planify this extremely carefully if you don't want to end up confused in the middle of your game realising you did something wrong that ruins all the scenario. 
Well let's see...  My game is actually on this very subject!

So, I'll try to give you a rundown of what I'm doing.  At each "story choice", I offer a decision point.  When that decision point is chosen, I flip a switch labeled what that choice was (so I can find it later when I need it).  Once the switch is flipped, I carry out the rest of the cutscene or initial choice like any standard event.  However, whenever I need the game to recall which choice you've made in the game, I have an event (or events) set to only activate if that switch is flipped.  This is the same with using specific dialogue as well.  I do the dialogue instances of your choices with a Conditional Branch that is casually added into the rest of the events that use it (I do the same thing for if you are carrying certain party members with you).  The event then checks to see if the switch has been flipped.  If it has, it plays out the unique dialogue or scene.  If it hasn't, it is ignored and the player never knew it existed.

For storyline purposes, it's best to honestly use switches so that you can just have the system check if the switch has been flipped or not.  It's an easy enough thing to check and/or label and doesn't really waste a variable that way.  I use variables to track things like interaction between party members, morality, item counts, some quest related things (like how many times you've messed with a faction or helped a faction), a hidden variable that determines the ending of the game, other variables that track other things in game (including separate variables for two different skills).

The difficult part about a "branching story" and "multiple endings" doesn't lie in "how do I do this with the program I'm using?".  It honestly lies in how different you want those branches to be.  If you're like me and those branches are fairly significant, then a large chunk of your time in planning and production is going to revolve around writing a new storyline for each choice you make.  You need to figure that out, then figure out how to make those choices somehow converge on an "ending" so that you're not stuck with 27,000 endings depending on which choices you made.  The hardest part in doing one of these systems is simply trying to keep it all straight in your head, keep each choice coherent, and keep each storyline unique enough to warrant its existence.  When each choice makes a new storyline and ending, your game is going to get complicated in a hurry.
Well let's see...  My game is actually on this very subject!

So, I'll try to give you a rundown of what I'm doing.  At each "story choice", I offer a decision point.  When that decision point is chosen, I flip a switch labeled what that choice was (so I can find it later when I need it).  Once the switch is flipped, I carry out the rest of the cutscene or initial choice like any standard event.  However, whenever I need the game to recall which choice you've made in the game, I have an event (or events) set to only activate if that switch is flipped.  This is the same with using specific dialogue as well.  I do the dialogue instances of your choices with a Conditional Branch that is casually added into the rest of the events that use it (I do the same thing for if you are carrying certain party members with you).  The event then checks to see if the switch has been flipped.  If it has, it plays out the unique dialogue or scene.  If it hasn't, it is ignored and the player never knew it existed.

For storyline purposes, it's best to honestly use switches so that you can just have the system check if the switch has been flipped or not.  It's an easy enough thing to check and/or label and doesn't really waste a variable that way.  I use variables to track things like interaction between party members, morality, item counts, some quest related things (like how many times you've messed with a faction or helped a faction), a hidden variable that determines the ending of the game, other variables that track other things in game (including separate variables for two different skills).

The difficult part about a "branching story" and "multiple endings" doesn't lie in "how do I do this with the program I'm using?".  It honestly lies in how different you want those branches to be.  If you're like me and those branches are fairly significant, then a large chunk of your time in planning and production is going to revolve around writing a new storyline for each choice you make.  You need to figure that out, then figure out how to make those choices somehow converge on an "ending" so that you're not stuck with 27,000 endings depending on which choices you made.  The hardest part in doing one of these systems is simply trying to keep it all straight in your head, keep each choice coherent, and keep each storyline unique enough to warrant its existence.  When each choice makes a new storyline and ending, your game is going to get complicated in a hurry.
=D following your advice I was able to make a simple one for testing. I had a dog ask me if I want potions or an axe. The axe would be my "branching event". However, if I do NOT choose the axe from the beginning the option is gone forever. But if I choose the axe, a lady appears going YOU STOLE MY AXE! while the original options are still available from the dog minus the axe. Good so far?

Well, it's either you edit the default scripts or just make a new one... it really depends...

though well, making a new one might be better... something like

class Window_MenuItem def windowskin return "WindowM" endendclass Window_MenuActor def windowskin return "WindowA" endendNote: I'm not sure if using a custom windowskin method works since I haven't tried it (I only realized trying to do it right now, I used the modify the start method up until now) but theoretically, it should work... Now I wonder why I didn't do it the first time I went changing windowskinsAs for the template, yes you can use the original windowskin as a template... you're probably better off doing so actually, to ensure that you get the positions right...
I tried doing this (both making a new script and goin through the default window scripts) and no luck =(. I also have galv's character menu layout script installed but I should still be able to force change through the default window scripts right? In any case when I put the code there along with the mock template I get error (default windows script). PS I put the template in system tab

hmhmhmm, I wna make a custom battle menu too =( sigh...

BTW again, thank you for your patience >_<
try putting it below Galv's scripts

btw, the Picture should be in Graphics\Systems not the other System folder

otherwise show a screenie of the error and the code too

EDIT

Oh wait I think I get why it errors... looks like using a method for windowskin collides with the window base since it has a line which says self.windowskin = something

so I think you better just replicate the start method and do

self.windowskin = Cache.system("NameHere")

(yeah, forgot that it needs Cache.System)

so for example

Code:
 class Window_MenuCommand  alias init_adi initialize  def initialize    init_adi    self.windowskin = Cache.system("WindowM")  endend
and well, if you do it this way, put it below any script that might be overwriting the initialize method of the windows
Aight! Did what you said, also I had the script at the very bottom just to be safe. I get this error "Script 'Scene_File' line 60: Arguement error occurred. Wrong number of arguements 2 for 0"

I'm doing the save menu as my testing so I changed it to Window_SaveFile and made sure my graphic template has the same name as WindowM
Show the screenshot of the error and the code that you used...

I think I know your error, it's because window save file's init method takes 2 parameters...

so the code for that should be

Code:
class Window_SaveFile  alias init_adi initialize  def initialize(height, index)    init_adi(height, index)    self.windowskin = Cache.system("WindowM")  endend
The windows have different initialize behaviors so you might need to check first the initialize method of the window you want to change so that you can determine what code to put...
Show the screenshot of the error and the code that you used...

I think I know your error, it's because window save file's init method takes 2 parameters...

so the code for that should be

class Window_SaveFile alias init_adi initialize def initialize(height, index) init_adi(height, index) self.windowskin = Cache.system("WindowM") endendThe windows have different initialize behaviors so you might need to check first the initialize method of the window you want to change so that you can determine what code to put...
DUDE IT WORKED! =D how may I check the initialize method? So that means for every new window I do this to I gta make sure I got the initialize method correctly

PS: CHU A GENIUS >_< !!!! 
Go to each window default script and click it... the initialize method is normally always on top...
Ohh! ok so let's say for map name, the initialize would be:

def initialize

    super(0, 0, window_width, fitting_height(1))

    self.opacity = 0

    self.contents_opacity = 0

    @show_count = 0

    refresh

  end

 

o.o how exciting. Would I be able to move around parts of the menu this way or make a custom battle menu? or would that be too advance for me as of now. By the way thank you again =))))
yeah, since that one's initialize method doesn't take any parameter

Code:
def initialize
then the first code I posted will work, and the one for the save file won't

Code:
#this is SaveFile's init method#takes 2 parameters which is why we needed to make#the alias method take and pass those two parameters toodef initialize(height,index)
Well, moving menus are not that hard, normally... making a new one completely is another thing... you could practice first on moving and modifying things shown on the menu before you try making a completely new one...
kk I'll take it slow for now. Also, is it possible to change the color of menu's background? It's still the same color I have for my dialogue window. When I looked at the save file window script, i saw this,

def refresh

    contents.clear

    change_color(normal_color)

    name = Vocab::File + " #{@file_index + 1}"

    draw_text(4, 0, 200, line_height, name)

    @name_width = text_size(name).width

    draw_party_characters(152, 58)

    draw_playtime(0, contents.height - line_height, contents.width - 4, 2) 

is this where I can change the color?
normally, I think yes... just change that change_color(normal_color) into something else...
Do i input that code into my custom script or change it in the default script (I tried it on the default and I used rgb change_color(130, 70, 34) and I got error xD 

Welllll egg on my face, I did some research and I wrote that wrong. Can I somehow have it be the color of what I have on my graphic?

Original thread: https://forums.rpgmakerweb.com/threads/branching-story-and-multiple-ending-question.21064/