Non-threaded

Forums » Advanced Editor Forum » Read Thread

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

[Answered] Using 'between' and 'in list'

14 years ago
Okay, so I've read a lot of stuff on scripting lately, both in the articles and in the forum, and its making my head dizzy. So maybe I missed this some where, so I'm sorry if its mentioned elsewhere. In link restrictions, you can use between, =, >, <, >=, <=, and in list as options to restrict whether a link is shown or not. What I want to be able to do is use any of these options for variable specific text. You can use &&VARIABLE%=%1%Blah blah blah.%% And it will say "blah blah blah" if the variable is 1. But what if I want to have the text show up only if the Variable is between 4 and 7? Is there a way to do this? Also, say you have two variables: VARI and ABLES. Is there a way to get the text to show up only if VARI = 1 and ABLES = 0, or something like that? So you could have more complex conditions to variable-specific text. I plan to use variables for all sorts of things in my game, and options like this would be really helpful.

[Answered] Using 'between' and 'in list'

14 years ago

I'm sure JJJ can give you a better explanation, I haven't scripted in a few years so I'd have to read the articles again. But there's a system variable along the lines of $PAGETEXT or something like that, which you can set (:=) to certain words IF variables are within certain numbers. What's also cool is that you can put HTML into these scripts, for example you can put in the Global Script a HTML thing in $PAGETEXT and make the background of every page red and the font another type and colour. There's a thread on it somewhere in the Advanced Editor forum.

But anyway, JJJ's online, I'm sure he'll give you a more detailed response.

 

[Answered] Using 'between' and 'in list'

14 years ago

LINK HERE to that thread I was talking about.

[Answered] Using 'between' and 'in list'

14 years ago
Thanks for the tip. I think that's really cool that you can change the look of the page like that. It gives more options and things, and can help set the mood for the player. Interesting stuff!

[Answered] Using 'between' and 'in list'

14 years ago
You'll want to use $PAGETEXT. So basically:

IF %VARIABLE > 4 THEN
BEGIN
IF %VARIABLE < 7 THEN
BEGIN
$PAGETEXT := "Your variable is between 4 and 7"
END
END

Or, if you have two:

IF %VARI = 1 THEN
BEGIN
IF %ABLES = 0 THEN
BEGIN
$PAGETEXT := "Your vari equals 1 and your ables equals 0"
END
END

Does that make sense? Ask if you need more clarification.

[Answered] Using 'between' and 'in list'

14 years ago
It does make sense. But I think it will only work if I change the way I do things and write my entire page in the page script. Because if I want these things to appear in the middle of a sentence, then there is no way to do that using $PAGETEXT unless I have all of it written in script right?

Its not a huge deal for me, if I can make it work. It'll be worth the extra effort if I can get my game to do what I want it to do.

Thanks for your help! I didn't even think of being able to do this in the page script.

[Answered] Using 'between' and 'in list'

14 years ago
Yeah, that's a downside. I've got the same problem. It also makes your story appear shorter than it is (because the length calculation involves words per page, which will appear lower) but it's not a huge deal when compared with the fact that you can get things working.

Using the %%VARIABLE%=% thing can only be done for specific variable amounts, not ranges. :)

[Answered] Using 'between' and 'in list'

14 years ago
Then again, if you really wanted to have a more accurate length indicator, you could copy of the text you'd have into the regular textbox. Just so that it gives readers a better idea to how long your story is, if you think it would make a huge difference. The page text that actually shows would be overwritten by the page script anyway, right?

Maybe this doesn't matter all that much, but if you had a really long story, with a lot of text and it really should be considered an 8 (especially if it's even long for an 8) and it would show up as being something like a 5 or 6 because you have -no- text in any of the original pages because its all in page script, than that would be a problem I'd spend the time to fix.

[Answered] Using 'between' and 'in list'

14 years ago
Yeah, unless you're using $PAGETEXT := $PAGETEXT + "But . . . . . "

Because then your adding to it.

[Answered] Using 'between' and 'in list'

14 years ago
Okay, so now I am having another issue.

If I am using $PAGETEXT to write things, I can't find a way to get it to show the variable number, like it would if I wrote %%VARIABLE%% in the regular text box.


... scripting is hard.

[Answered] Using 'between' and 'in list'

14 years ago
It's like this:

$PAGETEXT := "Score: " + %SCORE

Make sure you leave a space after the : and before the ".

If you want to colour the number then it looks like this:

$PAGETEXT := "Score: " + "font color='red'" + %SCORE + "/font

If you want more text after, then it's like this:

$PAGETEXT := "Score: " + "font color ='red'" + %SCORE + "/font" + ". Try and accumulate more score!"

Make sense?

[Answered] Using 'between' and 'in list'

14 years ago
But you need < and > before and after the html commands before the "'s. I can't put them in or it obeys it haha

[Answered] Using 'between' and 'in list'

14 years ago
Also, I forgot a " after the first /font.

[Answered] Using 'between' and 'in list'

14 years ago
Okay, thank you. That makes perfect sense.

[Answered] Using 'between' and 'in list'

14 years ago
Your questions are so well timed. I haven't scripted in ages, so I'm constantly looking things up to use them, and then you ask me, right after I've looked it up. I had just used that particular script on my character sheet page.