Non-threaded

Forums » Advanced Editor Forum » Read Thread

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

Question about page redirection and variables

5 years ago

I have always wanted to write my own choose your own adventure. This site looks fun. I have a question about variable evaluation and using that in navigation. Is it possible to check some variables to determine what page to direct to? I know there are variable events that direct to a page. But what about evaluating one or more variables that havent changed to determine where to navigate. example: If wisdom > 20 and intelligence > 15 direct to page "Super Wizard" 

Question about page redirection and variables

5 years ago
Yes there is. Try here for info on limiting page links. That's probably the easiest way to do it.

Question about page redirection and variables

5 years ago

Thanks Ogre. I have more reading to do. :) 

 

Question about page redirection and variables

5 years ago
Ogre's link is perfect for this and is the simplest way to do it.

But, for future reference if you want to look into the more advanced scripting techniques similar to this I thought I'd add on to it a bit.

To expand on the info in the article Ogre linked, you can use this kind of variable system to double as a way to also script the text on your pages to reflect the status of the variables. For example, if you have an optional scene in your story where the player can visit a certain character or not, then you can assign a variable to track whether or not they did so. Then in subsequent scenes, you can use scripting to change key paragraphs on a single page to reflect whether or not they visited the person or whatever other optional action you gave them earlier on in the story. I really like this system just because it can be used both for link direction and on page scripts for varied text. More about that technique here.

There is also the more advanced scripting where you can write out a script on a single link to automatically filter through which page destination to send them to based on variable scores which is explained here.

Question about page redirection and variables

5 years ago

awesome, thanks for the help!

Question about page redirection and variables

5 years ago
Yeah, there are multiple ways to do most things. Variable restrictions like Ogre described are probably easiest for someone new but if she just wants to direct someone to a new page she can also put something like

IF %INT > 10 AND
WIS > 10 THEN
$DEST := @P31 (where 31 is the page number) in the link script to reroute them if that checks out.

On page scripting like Sabley described looks intimidating at first but it's really just plugging variables and text into a template. It's a godsend if you're just making small changes to a page based on various factors and don't want to have to make half a dozen slightly different copies of it:

http://chooseyourstory.com/help/articles/article.aspx?ArticleId=3850

Question about page redirection and variables

5 years ago

excellent. Thanks mizal!