Non-threaded

Forums » Advanced Editor Forum » Read Thread

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

Nested variable text

11 years ago

I know how to make text change based on variable
%%VARIABLE%=%0%Text 1%%%%VARIABLE%=%1%Text 2%%
but in my story game I want the character to have different names based on gander and class. I thought the most logical way to do this would be to check for gender and then inside that check for class, something like
%%GENDER%=%0% %%CLASS%=%0%Name 1%% %%, but that doesn't work for obvious reasons. I was wondering if there was a way to do this kind of nested variable text, or if it would just be simpler to make multiple pages.

Thank you for your help in advance ^_^

Nested variable text

11 years ago

IF %GENDER = 1 THEN

IF %CLASS = 1 THEN

BEGIN

$PAGETEXT := "Your gender is 'x' and your class is 'x'" + $PAGETEXT 

END

Is this what you're looking for? 

Nested variable text

11 years ago

Thank you for the quick reply. This works fine. 

Nested variable text

11 years ago

Of course. @ISentinelPenguinI

IF you want line breaks then just put:

$PAGETEXT := "Your gender is 'x'" + "</BR>" + and your class is 'x'" +"</BR>" + $PAGETEXT 

Nested variable text

11 years ago

Most logical way would be to make a third variable, which you calculate after their gender and class has been chosen. That way you only need to check that variable when finding out their name.

Nested variable text

11 years ago

Or if you want to complex it up a bit, you could do something like this:

Variables_
%GENDER
%CLASS
%NAME

Variable Use During Character Creation:_
Gender Choice creates %GENDER Value (Female = 1; Male = 10)
Class Choice creates %CLASS Value (Fighter = 1; Thief = 2; Cleric = 3; Wizard = 4)

After that, set %NAME := %GENDER * %CLASS

Then Place your On-Page Script_
%%NAME%=%1%Porche the Fighter%%%%NAME%=%2%Lili the Thief%%%%NAME%=%3%Mother Maud the Cleric%%%%NAME%=%4%Malificent the Sorceress%%%%NAME%=%10%Throg Snart the Fighter%%%%NAME%=%20%Black Cloak the Thief%%%%NAME%=%30%Father Clovis the Cleric%%%%NAME%=%40%Zorchradex the Wizard%%

Nested variable text

11 years ago

Why are your codes always so clogged up? 

"%%NAME%=%1%Porche the Fighter%%%%NAME%=%2%Lili the Thief%%%%NAME%=%3%Mother Maud the Cleric%%%%NAME%=%4%Malificent the Sorceress%%%%NAME%=%10%Throg Snart the Fighter%%%%NAME%=%20%Black Cloak the Thief%%%%NAME%=%30%Father Clovis the Cleric%%%%NAME%=%40%Zorchradex the Wizard%%"

Nested variable text

11 years ago

Magic. ^v^

Nested variable text

11 years ago

 ^v^ Is this a penguin smiley face? 

Nested variable text

11 years ago

But of couse.

Nested variable text

11 years ago

Dam. I gotta teach that to Sentinel sometimes.

Nested variable text

11 years ago

Better not, it's Trademarked.

Nested variable text

11 years ago

Well...he could always change it up somehow. 

^N^

Nested variable text

11 years ago
That is such a ridiculous looking penguin face.