New account registration is temporarily disabled.

ADVICE NEEDED

Posts

Pages: 1
Ok so here's the thing: I'm creating a new game based on decision making that can lead to multiple endings and my intention is to create a lot of questions and dillemas. My problem is I'm so confused about variables that I don't know where to start, I keep thinking that I always need to create two variables for each thing and maybe I'm missing the point.
Is it better to just work with switches? Like you choose A and switch x activates, you choose B and switch y activates? Then put conditional branches in the endings and fix the whole thing? But that may lead me to create just 10 or more conditional branches inside each other.
I'm not even sure I'm thinking the right way since it's my first time working with so many switches or variables.
I'm still new to this so please bear with me.
Thanks in advance.
unity
You're magical to me.
12540
It all depends on what you're using. In some instances, switches are the way to go. Sometimes it's variables. Here's some examples.

Situation 1: The hero and Jessica can start a whirlwind romance, but only if the player talks to her once a chapter. You'd use a Variable to track how much affection Jessica has for the hero, and you'd use switches or self-switches to make sure that Jessica's affection variable can only be raised once a chapter (so the player can't just keep talking to her in the same chapter to raise the variable way sooner than it should be). Each time you talk to her, increase a variable by 1, but put that in a conditional branch where the switch (named TalkedtoJesChapt1 or something) has to be off for the number to rise. Or just make a new event page each chapter where she says "Hey, it's been fun talking to you, but I should let you get back to saving the world" each chapter where the variable can't be raised again.

Situation 2: The Gate of Oblivion can only be open once the sixteen Power Wraiths have been slain. You can simply use variables here to tally how many the player has killed, especially if each Wraith has it's own on-map sprite. Just have the battle, have the variable increase by 1, and use a self-switch to remove the sprite.

Situation 3: Possessing the Fruits of Valor open different doors and change how NPCs talk to you. Each fruit is different and each does a different thing. Therefore, using switches is the way to go.

I don't know if that helps, but that's some examples. Pretty much, use Variables for linear things or those where storing a number would be useful, and rely on switches for everything else. It's okay if your switches and conditional branches get complicated; sometimes that's necessary.
Marrend
Guardian of the Description Thread
21806
If there is only ever two choices to make, you can probably do it with a variable, though, yeah, it's a bit tricky and involved (try to ask me about "structure factors" in the Heroes of Might and Magic series). If players are presented with more than one choice, and each one "matters", then, switches might be the better route.
First of all thanks for your replies.
Unity - I think what I'm trying to do is similar to Situation 3.

Don't know if you remember but there's a game called Alter Ego, over 30 years old I think, that goes from your birth to your death and you keep on having to make choices that affect your life, normally there's 3. I'm trying to do the same thing(not exactly in terms of story, more of mechanics) but at the same time trying to simplify it. There's no true right or wrong, just designed to make the player think, and in the end those choices affect how the ending is going to play out, or even if you reach certain areas accessible only for specific choices or combination of choices.
If you have something that needs to be counted, variables. If you have something that only happens once and you need to refer back to it later, switch. If it only happens once and never needs to be referred back to, self switch.

So if you have a choice through the game that will make you turn evil if you do a certain amount of evil acts, every time you commit an evil act you'd increase a variable by one point. At the end of the game do a check to see if that variable is over a certain amount and if so, you get the evil ending.

If saving the prince means you marry him at the end of the game, that's a one-off instance, so a switch would be used to count that. Turn on the switch when you save him and at the end of the game check to see if that switch is on. If so, then marry the prince.

Now it's interesting when you have more choices. Say there are three princes and depending on who you're closest to in romance is who you marry. So each prince would have a variable assigned to his affection points and if you do something they like you'd add points to it and if you do something they don't like you can subtract points. At the end of the game you do a check to see which has the higher points and they'd be the one you marry. Unless you had an awakening at a certain point and realised that you were gay, in which case, if the gay switch is on, then you don't marry any of them - instead you trigger them as your best buds or something like that.

Hope that gives you a good idea. I mean, there's a lot more to using variables but this is a general idea.
Pages: 1