Non-threaded

Forums » Advanced Editor Forum » Read Thread

Get help from the experts on variables, scripts, items, and other scary things.

Using variables to progress to different endings?

8 years ago

Hello!

SHORT VERION BECAUSE DAMN I RAMBLE: How the hell do I keep track of all the options a player goes through ala explore-the-haunted-house, to ensure they get the right corresponding ending, and how do I block off links/options that loop back to previous pages that aren't directly after each other after a bunch of misc stuff happens?

Am I just going to have to math it up and keep track of a load of variables that add up to different numbers depending on rooms/events triggered?

----

I'm new to the site and I've messed around a little bit with the story creator. I know I shouldn't jump in right away with the advanced editor, but I felt like it would allow me to progress a story the way it's intended to go because the options can loop back on themselves quite often. (It's already completely written in a document; I just need to piece everything together, and this site seems the easiest to use).

Throughout the story you're mainly exploring (think cliche haunted mansion), so the endings are dependent on whether or not you trigger certain events in certain rooms, plus one additional option event Y near the end. Those are the conditions that need to be met, in some way or form, and they all trigger different final endings (7 endings). There's also a hub event that happens in every play through, but what happens is dependent upon if you did additional option event X or not (there are only 2 differences for that). This is further limited by the fact you can only explore two of the four available rooms in one play through, so once you explore two, it needs to automatically skip ahead to the next hub, and not let you go back to select another, while keeping track of what you did so you stay on the ending that corresponds with what you did.

I've figured out how to limit how many times you can go back and select things since that happens often, in a linear way, and I've sort of got how to push you to the next page automatically after you deplete it. Like if you can only click on 3 of the 5 links once, it'll skip you ahead and won't take you back to that selection page once you hit the limit of 3. BUT, I'm getting really confused about how to set up that up on a grander scale, and more importantly, how to set the variables so they put you on the correct path! Like, compounding those variables into a giant web. It's not just a simple "choose 3 then skip to the hub," because there's several things you can do in the room itself before going back that matter, and again, depending on which rooms you chose/what you do, the ending changes, so there's way too much crap to keep track of (a lot of it doesn't matter and is just there for fun, but it's still in the room itself). I guess the hard thing is there is no set order, it's all dependent on what the player wants to explore, but I still need to block off paths. It's more of a ... giant circle that bottle necks a couple times rather than a linear path.  I know I can go through every single possible order a player may pick, and put them all on linear paths, but that is way, way too much work and just no.

Sorry I'm rambling! I'm having a really hard time explaining it, although I feel it's something lots of people have done, as it seems like a common style of exploration game. If I had to somehow explain a condensed progression of the story on the parts I don't know how to link, it would be sort of like this:

beginning (always the same) -> room selection (4 rooms) -> pick one room -> explore a bunch of random stuff in it and potentially die a bunch; when you've exhausted your options (how do I make sure it always blocks out a link after a few other events contained within? it's like ... link inception..), you're looped back to room selection -> pick another room (3 rooms left) -> explore a bunch; when you're done, automatically jump to hub 2 (always the same) -> event X (choose A or B) -> hub 3 (outcome A or B, depending on what you chose during event X, but it always happens) -> some linear stuff -> event Y (choose A or B) -> ENDINGS (outcomes 1-7, dependent on two events that happen in two separate rooms, plus whether or not you chose A or B at event Y). 

The 7 endings' conditions are:

  1.  missed both trigger 1 and trigger 2 (event Y option doesn't matter for this one)
  2. got trigger 1 (missed trigger 2); event Y option A
  3. got trigger 1 (missed trigger 2); event Y option B
  4. got trigger 2 (missed trigger 1); event Y option A 
  5. got trigger 2 (missed trigger 1); event Y option B
  6. got trigger 1 and 2; event option A
  7. got trigger 1 and 2; event option B

If someone can help me wrap my head around how to set up the variables so they keep track of the correct paths and rooms, I would be very appreciative. Again, sorry this is long and confusing; I guess having a difficult time understanding what I need to do makes it harder to explain what I need. 

And uh, if I end up not even needing to use the variables to keep track of all of this and there's a better way to do it, then I'm ALL EARS because I have no idea what I'm doing suddenly.

Thanks guys!

 

Using variables to progress to different endings?

8 years ago
Your "load of variables" seems to amount to 3. Trigger 1, 2 and event y.

Use Variable restrictions under link restrictions (it will be a stop sign on the link options). Then just match each restriction to what the variables need to be.

Using variables to progress to different endings?

8 years ago

I think the thing that's confusing me is the fact the variables are numbers -- since I only have 3 loads (thank you for clarifying that for me; I thought it would be at least 8, because of the 7 endings, but I guess the values will determine which ending it goes to?), I'm assuming I can only mark the pages that are necessary with the variable, and give them low numbers to add up to the final number to trigger the correct ending. For some reason I was thinking I had to keep tally of numbers/variables throughout a much larger part of the story, but if it only has to link to those exact pages being hit, that makes it a lot easier. I think I also got confused because I'll be using the variables in an unrelated way to the endings (the blocking off of options after you select X many), and for some reason thought it all had to link up. 

Thank you! 

Using variables to progress to different endings?

8 years ago

The thing with scripting, the most important aspect of it, is the ability to wrap your head around if statements. Once you got that down, there is literally nothing that you cannot script. The most complex scripting, is still essentially made up of a bunch of if statements. When using if statement, you'll need to keep in mind, that there are different ways of organizing them.

There are two ways. Or essentially, two keywords you need to keep in mind. 

<---AND and OR---> 

For example, you want to buy some clothes at the store, but you'll only buy it if the color is green AND blue, so the only way the if statement will pass is if both those conditions are true. However, when you use an OR statement, the shirt only have to be green OR blue. Once you wrap your head around these, you'll need to ask yourself when you want a condition to be executed, and wrap that inside the specific if statement to execute that statement. 

Easy as pie.  

Using variables to progress to different endings?

8 years ago

 This hurts my brain... ;(

Using variables to progress to different endings?

8 years ago

Well then why the fuck read it or respond?

Using variables to progress to different endings?

8 years ago

Oy, if you're not going to contribute, why the fuck post?

Using variables to progress to different endings?

8 years ago

I'm sorry! I didn't mean to be complicated. I appreciate the fact you took the time to tell me it was confusing, I don't feel as dumb thinking I was the only one. 

Using variables to progress to different endings?

8 years ago

Um, you aren't on threaded view, are you?

Using variables to progress to different endings?

8 years ago

But... it makes sense whom they replied to.

Using variables to progress to different endings?

8 years ago

But....the girl responded to Nmeslxx, and Bubo told her that he was sorry for his writing.

Using variables to progress to different endings?

8 years ago

Crap, whoops. Just ignore that, please. I thought that person was replying to my overall post, not the reply itself. 

Using variables to progress to different endings?

8 years ago

It's okay, m9.

Using variables to progress to different endings?

8 years ago

This makes sense. I guess I understand I need the and/or statements, and I understand what I need to do theoretically, but when I try to turn it into variables (i.e. numbers), I get a little stuck. I can also visualize it like a network of train cars -- the ands/ors switch things on and off and set you in different directions based on if you meet the condition or not. 

Should I just try and set numbers, and set the conditions up to add up to specific numbers for events? Or should each ending get its own variable set, and each one is triggered by a different number based on what was selected? For example, if I want the shirt to be green AND blue in order to buy, would I do something like green (+2 variable), blue (+2 variable); variable 4 = switches the path the buy it; but if it's only green (+2) it doesn't trigger because it didn't add up to 4. Someone else commented that my load (for the endings, anyway), is actually 3 -- should I set final numbers to correspond to endings 1-7 (like ending 1 added up to 6; ending 2 added up to 8; etc) or oh god damn it I'm confusing myself again. 

Thank you very much for the reply and help.

Using variables to progress to different endings?

8 years ago

I would use two variables for this. The two variables I would use would be green and blue. Set the variables to one if it is true and leave it alone if it's not. Then when it's time to check whether you should buy the shirt or not just check to see if the variables are set to one or not. This way is less confusing.

Also, always remember to pick relevant variable name so you won't be confused when you reread your codes.

Using variables to progress to different endings?

8 years ago

Whoa whoa, can you make multiple variable loads affect a single page/progression? Like if the two separate variable loads are green and blue, I can make ending X happen if both variables are "1", even though they're not the same variable? If this is the case then that just made it waaaaaaaay less complicated. I wasn't aware you could do that. 

Thanks!

Using variables to progress to different endings?

8 years ago

Haha. Yes. Of course you can.

Otherwise, if scripting were to be limited to only one variable per execution, it would get really confusing, not to mention tedious.

Using variables to progress to different endings?

8 years ago

Thanks so much for this. I guess that's where all my confusion stemmed from. I feel like the clouds have parted and I can finally see what the hell I'm doing, hahaha.