Indie Dev

Hello Guest!. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, sell your games, upload content, as well as connect with other members through your own private inbox!

Anyone good with if statements, please help!

Status
Not open for further replies.

Micro

Dragon Goddess
So I'm trying to make a flashbacks system. Basically, each new bed you sleep in gives +1 point, and every certain amount of points you get, you have a flashback. I got that working just fine, but the thing is... I want these flashbacks to be accessible at every save point in case you want to watch them later.

I can't get the if statements to work correctly since I'm a noob at them. It always ends up just showing Flashback 1 in the list instead of both Flashback 1 and Flashback 2--Flashback 2 is only visible AFTER watching Flashback 1 from this menu and I don't know how to make it work.

Screenshots to illustrate what I'm talking about:
ingame1.png So when you have both flashbacks unlocked, it just looks like this...

Then after you watch Flashback 1, it turns into this immediately after:
ingame2.png
But I would like it to have Flashback 1 and Flashback 2 on the same page, or at the very least a "Next" option that leads to Flashback 2 lol.

Looking at the event I made, I can see WHY it doesn't work the way I want to, but I don't know how to make it work the way I want to. Please help!

Screenshot of the event: The ifs.png
I just don't know how they are supposed to be lined up/how to get them to line up correctly to make it work. My first time trying to do something like this, but I'd like to learn. Thought I'd ask you guys for help!

Thanks in advance. :)
 

MinisterJay

Administrator
Staff member
Administrator
When the most restrictive to the least restrictive is known up front, it is best to start with the most restrictive. In other words, Flashback 2 is contingent on Flashback 1 occurring, so I personally would put that within the conditional branch first. I also recommend using the Create Else Branch, which you can activate by pressing the box at the bottom of the conditional branch section. This feature becomes really nice if you start getting branches within branches.
[doublepost=1451789557,1451789018][/doublepost]This should auto-merge...

Secondly, how does your choices event look like? Is it one of the common events?
 

Micro

Dragon Goddess
When the most restrictive to the least restrictive is known up front, it is best to start with the most restrictive. In other words, Flashback 2 is contingent on Flashback 1 occurring, so I personally would put that within the conditional branch first. I also recommend using the Create Else Branch, which you can activate by pressing the box at the bottom of the conditional branch section. This feature becomes really nice if you start getting branches within branches.

Well, Flashback 2 can happen regardless if Flashback 1 has been activated (or at least that's what I intend)

How do you use the Else branch? I'd need to see a visual example to understand what you mean, since I am new to this and am a visual learner (I cannot learn by reading your explanation, I need a picture along with it)

like i said, I'm completely new to this.
 

cward3223

Villager
Xy$
0.00
I think what he means is something more like this



After checking that you Variable 'First Sleep In Bed' is >= 1 and you select the choice to watch a Flash Back you will check that if Flashback2 switch is on and make it show a choice for both Flashback 1 and 2, ELSE (meaning that Flashback 2 is off) check to make sure Flashback1 is on if it is show a choice menu to allow the player to select Flashback 1 from the menu.

I hope that makes sense.
 

Micro

Dragon Goddess
I hope this helps a little.

View attachment 1395
Yea I already knew about the existence of the else branch since it shows up when you make a conditional branch, but how do I use it? that's what I meant haha.

@cward3223 Thanks! that's pretty helpful, I'm going to look at it now.

this is exactly what I was asking for! thank you very much, I appreciate it the screenshot.

so basically, you create an additional switch if you have more than 2 of the flashback switches on?

I mean, clump all the switches together in one? dang that doesn't make sense lol not sure how to say it...

like, if you have Flashback 1 and 2 on, you make a 3rd switch that clumps them together to put into the if statement? (so it would be like, fb1.2 or something) just making sure I understand what you mean

again sorry, I'm totally new to all of this so it's a little confusing right now haha.. if this seems to be too complicated to do, I may try to think of an easier way to make it work. (such as linking the flashbacks to the specific place you sleep)
 

cward3223

Villager
Xy$
0.00
Yeah the more Flashback scenes you have the more if/else statements you would need to have in order to show them all in 1 menu, this may be something that would be easier to create a plugin for with a custom menu.

I am still in the learning process of creating plugins, but if I get the extra time it seems like an interesting plugin to make I may be able to make one for you, but in the meantime (because I can't make any guarantees on a plugin) the easiest way would be as you said and link a flashback to specific places you sleep, and for every other place you sleep (that doesn't link to a new flashback) just making a choice menu to watch flashbacks that you already know that the player has watched so you don't have to check if the switch is on because you know that it has already been watched previously.
 

Micro

Dragon Goddess
Yeah the more Flashback scenes you have the more if/else statements you would need to have in order to show them all in 1 menu, this may be something that would be easier to create a plugin for with a custom menu.

I am still in the learning process of creating plugins, but if I get the extra time it seems like an interesting plugin to make I may be able to make one for you, but in the meantime (because I can't make any guarantees on a plugin) the easiest way would be as you said and link a flashback to specific places you sleep, and for every other place you sleep (that doesn't link to a new flashback) just making a choice menu to watch flashbacks that you already know that the player has watched so you don't have to check if the switch is on because you know that it has already been watched previously.
ah i see. thanks for the explanation.

hehe aww thank you! no worries about it, but if you do happen to make it someday I'd love to see!

yes, I will probably just link them to the place instead of going through all this trouble lol, seems like it would be very time-consuming and annoying. that said though, I really appreciate you taking the time to explain all of this to a newbie like me. thank you very much!
 
Status
Not open for further replies.
Top