Non-threaded

Forums » Advanced Editor Forum » Read Thread

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

Multiple Variables to Determine Ending

10 years ago

I've decided to start working on a new project. I want to get the coding for how the endings will work out of the way early on.

So I will have 2 to 6 variables that are used to determine what ending you get. These variables are checked in different ways. Some are checked in less than or more than certain numbers. (Ex: variable>3, variable > 9 or variable = 9) Some are looked at ranges. (Ex: 2. - 8) Some endings would treat some varibles as inconsequential.

So how would I do this? Is the link restriction visibility method the best way or would sscripting save me time and effort.

 

 

Multiple Variables to Determine Ending

10 years ago
Could you elaborate on what you are planning to do? From what you have told me, I am inclined to say that Scripting would work best, but it would be easier to offer you relevant advice if you better explained what you were planning to do.

Multiple Variables to Determine Ending

10 years ago

Example:

Variable A value could be any number 0-20
Variable B value could be any number 0-15
Variable C value could be any number 0-5

In order to get Ending one, Variable A must be greater than 10, Variable B must be 2-10, and Variable C can be any number.
In order to get Ending two, Variable A must be lower then 5, Variable B can be any number, and Variable C must be 4.
In order t o get Ending three, Variable can be any number, Variable B must be less than 2, and Variable C can be any number.

Multiple Variables to Determine Ending

10 years ago
Wait... what about other cases?

For example, if A is 6, B is 3, and C is 0, then none of the above conditions are met?

Multiple Variables to Determine Ending

10 years ago

*Replying to both posts in one post because posting from phone is a pain. *

You're the first person to call me that, which amuses me. So thank you for that.

I planning it sort of linear in a sense. It is going to be crime based and you're an investigator. You'll have your choice of cases and actions on those cases. However, there is a terrorist type group planning a bombing in the background. Your actions and to some extent what cases you pick can lead you to clues about this. The more clues you get, the more likely you will realise something is up and be able to convince people do something about it.

 

The example is just for examples sake. My real table of values for each ending is kind of a pain to write up quickly. It has 6 variables and six endings. Plus I left it over my boyfriend's, so I won't have access to it till later today. 

Multiple Variables to Determine Ending

10 years ago
If it is linear, then it seems to me that you will have a single page, near the end, with the links to all of the different endings. If that is the case, then your best bet is to put the appropriate restrictions on each of the links to take you to the appropriate ending.

Multiple Variables to Determine Ending

10 years ago

What about the whole setting text to only show up, if you meet the required variable values thing?

Multiple Variables to Determine Ending

10 years ago

Umm...you could do that. Go to the page script and enter something like:

IF %VARIABLEA > 10 THEN
IF %VARIABLEB > 2 THEN
IF %VARIABLE B < 10 THEN $PAGETEXT := "(Whatever you want the text to be)"

Multiple Variables to Determine Ending

10 years ago
Yup, that way works rather well for me when you want to add text into the page. I've not experimented with trying to add choices that way, but I'm sure you could do that (though it could get silly complex, and the choices would show up in different places than normal).

Multiple Variables to Determine Ending

10 years ago
I think she was trying to say that she wanted one ending page with scripts to alter the text based on the values of her variables.

Multiple Variables to Determine Ending

10 years ago

The reasoning for is that it might be easier to keep all my ducks in a row, so to speak, if I do it that way. I have a hard time keeping numbers in my head and focusing on a bunch of different windows open. I've had problem before with not noticing what was wrong with a link restriction because it involved multiple variables and I couldn't remember all of the numbers than needed to be compared with each other from the multiple Windows.

 

Multiple Variables to Determine Ending

10 years ago
Are you approaching all of the ending pages from one page or from multiple paths?

Multiple Variables to Determine Ending

10 years ago
Dear cake flinging, kitten eared, dress eating wolf,

Indeed, the more detailed information you can provide here, the better. If you want to provide every single instance with examples, you might even get the code written for you here.

But, for example, if you just have one page that's got two possible choices, it might be simpler to just use link restrictions. For example, I've got that in one place in one of my stories, and I have exactly the same text on two links that happen to lead to two different pages. With the link restriction, only one of the two will ever show up. But if you've got more complex situations, scripting might be better.

Edit: Whoops, you posted while I was writing this...

Multiple Variables to Determine Ending

10 years ago

In your case, I would say that the link restriction would be easier.