Non-threaded

Forums » Feature Wishing Well » Read Thread

Suggestions for improvements and additions to the site.
This feature was rejected 8/5/2011: Zikara is a boss

Text Toggles

14 years ago

Basically what I'm suggesting is being able to place "toggles" on the text of a page, by typing &&1/&&2/&&3 etc. These would work in a similar way to displaying variables on the page with %%VARIABLE%%, except instead of showing variable values it would show text that is defined in the page script. Currently, $PAGETEXT can get the same results as what I'm proposing, but it's messy and time-consuming, as you will see in the examples below:

Currently, if I had the following page, where the part in brackets is the part I want to appear only if the variable %VARIABLE equals 1:

A stun spell is a wise move. Not only will you stop the goreworm from devouring you, you won't kill it in the process. (Usually your stun spells aren't even strong enough to temporarily paralyse a frog, let alone a giant worm, but you know that with your master channelling his power through you nothing can go wrong.) You start picturing the two basic symbols for electricity that you know in your mind.

Now usually, I would have to write in the script:

IF %VARIABLE = 1 THEN
$PAGETEXT := "A stun spell is a wise move. Not only will you stop the goreworm from devouring you, you won't kill it in the process. Usually your stun spells aren't even strong enough to temporarily paralyse a frog, let alone a giant worm, but you know that with your master channelling his power through you nothing can go wrong. " + $PAGETEXT
ELSE
$PAGETEXT := "A stun spell is a wise move. Not only will you stop the goreworm from devouring you, you won't kill it in the process. " + $PAGETEXT

..where I would have the last sentence from the italicised paragraph above on the regular page (ie. out of the script).

Now, this isn't really much of a big deal in the example I gave - but what if there are five sentences that appear/disappear based on different variables, and they have non-changing sentences in between them? If you wanted to do this currently, you would have to make a super long page script detailing every combination of sentences. Now what if we did something like this:

A stun spell is a wise move. Not only will you stop the goreworm from devouring you, you won't kill it in the process. &&1 You start picturing the two basic symbols for electricity that you know in your mind.

And you would have the script read:

%%1 := "Usually your stun spells aren't even strong enough to temporarily paralyse a frog, let alone a giant worm, but you know that with your master channelling his power through you nothing can go wrong."

# this part of the script defines &&1 as the text you see above (this also opens up a whole new doorway for defining toggles based on variables etc.)

IF %VARIABLE = 1 THEN
$&1 := 1

# $&(number) signifies a system variable, 0 means that in any instances where the toggle is written on the page (for example, in the second italicised example above) that it is ignored and not displayed - 1 means that it is displayed.

"$&" seems a bit weird looking, but it'd make sense because the $ makes it a system variable, any suggestions for this?

* * *

Okay, does that actually make sense? What do you guys think of the idea?

(If you don't know how to script, there's no need to post in this thread, so please don't.)

Text Toggles

14 years ago

Oops, just after where it says "And you would have the script read:" it's meant to be &&1, not %%1.

Text Toggles

14 years ago
I'm not sure if I am reading this right, but why can't you just do this:

$PAGETEXT := $PAGETEXT + "A stun spell is a wise move. Not only will you stop the goreworm from devouring you, you won't kill it in the process."
IF %VARIABLE = 1 THEN
$PAGETEXT := $PAGETEXT + "Usually your stun spells aren't even strong enough to temporarily paralyse a frog, let alone a giant worm, but you know that with your master channelling his power through you nothing can go wrong. "
$PAGETEXT := $PAGETEXT + "Whatever the rest of your story is."

Only put the variable condition for the part that you want to change based on variables and have the other parts static in the PAGETEXT.

Text Toggles

14 years ago

Does this work? It'd be a compromise but for the time being it'd save a lot of work.

Text Toggles

14 years ago
I think I see why you had problems with this. I think you feel that it all has to be in one gap, because of how $PAGETEXT works with each other when you have stuff in and out of scripting (which is why I write ALL of my pages in a script, and the regular text box outside of it is always left blank)

I think for you, you'd have to do this:

IF %VAR = 1 THEN
$PAGETEXT := " Usually your stun spells aren't even strong enough to temporarily paralyse a frog, let alone a giant worm, but you know that with your master channelling his power through you nothing can go wrong. " + PAGETEXT
$PAGETEXT := "A stun spell is a wise move. Not only will you stop the goreworm from devouring you, you won't kill it in the process. " + $PAGETEXT

Text Toggles

14 years ago

Yes, but what if you have six different variables that each turn on sentences in the middle of paragraphs? You'd have to make what you did above... 720 times to get every combination.

Like I said in the original post, it's possible to do what I'm proposing using $PAGETEXT but it's just messy and takes way longer.

Text Toggles

14 years ago
Nope.

Say you have a paragraph like this:

Blah blah. First something. Second something. Third Something. Fourth something. Fifth something. Sixth something. Blah blah blah.

You want the blah blah sentences to be static. So, if none of the variables were on you'd get 'Blah blah. Blah blah blah.' And you had six different variables, each switching on whether its respective sentence showed up or not. All the code you'd need is this(you can do the switching it around so that its in order though cuz honestly it makes my head hurt):


$PAGETEXT := $PAGETEXT + "Blah blah."
IF %VAR1 = 1 THEN
$PAGETEXT := $PAGETEXT + "First something."
IF %VAR2 = 1 THEN
$PAGETEXT := $PAGETEXT + "Second something."
IF %VAR3 = 1 THEN
$PAGETEXT := $PAGETEXT + "Third something."
IF %VAR4 = 1 THEN
$PAGETEXT := $PAGETEXT + "Fourth something."
IF %VAR5 = 1 THEN
$PAGETEXT := $PAGETEXT + "Fifth something."
IF %VAR6 = 1 THEN
$PAGETEXT := $PAGETEXT + "Sixth something."
$PAGETEXT := $PAGETEXT + "Blah blah blah."


Tada. Done. Its actually as simple as that. There's no need to type the whole thing in each $PAGETEXT you change, as it doesn't -replace- what is there, it -adds- to it, so long as you have the $PAGETEXT variable on the right hand side of the equation.

Text Toggles

14 years ago
Check it out: Test for October

Took less than 10 minutes.

Text Toggles

14 years ago

Can't see scripts as the co-author but I know what you did so it's all good.

Text Toggles

14 years ago
Wait. You can't see scripts as a coauthor?? That should be a feature.

Text Toggles

14 years ago

Ah okay, I get you. I wasn't aware that doing multiple $PAGETEXT scripts add together (ie. they don't cancel each other out). If that's the case, there's no need for my suggestion. Thanks for clarifying that Z!