Non-threaded

Forums » Newbie Central » Read Thread

Introduce yourself and get to know the community.

Trouble With Links

3 years ago

Hi, I'm copying my first story game from Word to this site and need help with linking. Here's the situation: on p9, you can choose p10/p11 or p10/12. Regardless which you choose, P11 or P12 will be followed by p13/14/15/16. But if you choose p10/11, you will end up with p18 after p17. If you choose p10/12, you will end up with p19 after p17. How do I make this happen? I don't want to create a whole different set of p13 to p17 for each option because there is another instance down the road when another crossroads like this will occur. It'll be too tedious.  Thanks for your time.  

Trouble With Links

3 years ago
Correct me if I misunderstood what problem you have, but the pages are numbered based on the order they are created. So if you have a page 10 with 2 choices, and you develop one(11,12,13,14,15,16,17) all the way to the end, and then you turn to develop the other, it will start at 18.

Trouble With Links

3 years ago
You can use variables to track these kinds of delayed branching. There are conditions you can set on a link to make them only appear if the variable is set, so you might set one called "page10path1" if you choose the first, and on page 17, a conditional link to go to 18 only if the variable was set

Trouble With Links

3 years ago
The way you've phrased this question is quite odd: "on p9, you can choose p10/p11 or p10/12. Regardless which you choose, P11 or P12" So I'm on page 9. I have options. I'm not sure if I have two (p10/p11 + p10/12), three (page 10, 11, or 12), or four (p10, p11, p10b, 12) options. I might guess two. But the next part is more confusing. I don't know if I'm going to page 11 or page 12. And what is with page 10? Is that sequential? Why is my option on p9 if I ALWAYS go to p10? Anyway... all that aside... You can create a variable in your story properties, up there at the top menu, where it says "variables." Since I don't know what's happening with your question, I'm going to pretend the variable is for drinking a potion of power. I'll name the potion POWPOT because I want to. I might set the min value to 0, the max value to 1, and the starting value to 0. Then, on page 9 (or wherever you want to do this), one of my options is going to be to drink the potion and go on. I'm guessing, based on your question, that another option on that page is to just go on without drinking the potion. So that option will be just a normal link to page 10. The option to drink the potion and go on will also be a simple link to page 10. That way whether they drink the potion or not, they're going to page 10. But, on the link for the drink a potion option, I'm going to set a variable. To do that, I'm going to the link to Page 10 and I'll click on the percent sign to modify variables. That will open a new window and window will have a list of my variables. I'll go to my POWPOT row, select addition for my change type, and put a 1 in the change box. Then I'll save those changes and close. Now that the variable's set, I can go to the other page. I don't know if that's page 12 or 17 in your example, but that doesn't matter. At some point, I want to go to a different page. In my example, I'm going to have an option to attempt to crash through a door. I want the reader to have one option, attempt to crash through the door, that will result in page 403 if they have already taken the potion, but page 101 if they have not taken the potion (and there might be another option or four, like turn the handle and open the door, what I'm doing here won't care if you have other options). To do that, I'll create two links that appear identical, but go to different pages. Just create the two links to page 403 and page 101. For the text of each link I'll put the same text, "Attempt to crash through the door." But on each link, I'll add a link restriction by clicking on the little square inside the circle to the left of the link text. That will open a new window. In the top menu of that new window, I'll click on the "Variable restrictions" option. That will show me a list of my variables, where I'll see the POWPOT row. For the page 403 link, I'll select = from type and put 1 in the value. For the 101 link, I'll select = from the type and put 0 in the value. Once that's saved, it should work as I have described here. You can do this with any number of variables and links in any number of places in your story at any time. Have fun!

Trouble With Links

3 years ago
Once you know how to create a variable, $DEST is quite useful.

What you need would be to open the link script (the icon that looks like := next to the choice where you want the story to diverge) and type something like:

IF %VARIABLE = 1 THEN
$DEST := @P12

Substituting whatever variable you want it to check and whatever the page number is. This will make it ignore whatever page the link is pointed at and redirect the player to another one if the conditions are met when the player clicks it.

Trouble With Links

3 years ago

@PerforatedPenguin

 

Oh yes you’re right. In the hustle to post I’ve mixed up the numbers.

 

@Ogre11

 

I put the choice on page 9 even though the player will go to page 10 regardless and the choice will only affect whether the player goes to page 11 or 12 because the page following page 9 would be too long if I combine my current page 10 with either page 11 or page 12. And it helps with building suspense to split things up.

 

Yup after tinkering with the variables for nearly an hour, I figured out how to use your way. Your potion example Made things clearer though. Thanks much.

 

@mizal

 

Thanks so much for your reply. I was just moping over how to shorten the time taken to complete this. Manual is just too tedious and frustrating. Just forgetting to put in one value, something goes wrong and I have to comb through the editer to find that bug.

Trouble With Links

3 years ago
Glad it worked out for you! Sorry it wasn't that easy. Many are intimidated by the scripts (mizal's example), so I thought I'd show the intended design way that doesn't use scripts first. Obviously, either way works, so do whichever way you like!