Non-threaded
Forums
»
Advanced Editor Forum
»
Read Thread
Get help from the experts on variables, scripts, items, and other scary things.
Avery_Moore
Reply
Coding question
5 years ago
Okay, so I can code things relating to one variable, ie:
%%GENDER%=%1%I have a raging boner right now!%%GENDER%=%2%My titties are jiggling with excitement!%%
But is it possible to code things relating to 2 separate variables? ie:
IF GENDER = 1
And
SEXUALITY = 37
Then
"I have a raging boner for furry purple fox creatures!"
... Something like that.
Anybody know if it's possible to code that using the whole %% thingy, and how? :p
Zake
Reply
Coding question
5 years ago
I may be wrong, in which case someone will correct me, but I'm pretty sure that you cannot use the %% on-page scripting for more than one variable.
As an alternative, I think something like:
IF GENDER = 1
AND
SEXUALITY = 37
THEN
$PageText := $PageText + "I have a raging boner for furry purple fox creatures!"
Issue with this is that it is harder to get it in the correct spot, as this method works best for adding text at the start/end of a page.
What I'd do personally is have one variable which just acts as an in between, so like:
IF GENDER = 1
THEN IF
SEXUALITY = 37
THEN
SPECIAL = 1
That way, for that specific combo of the two variables, %%SPECIAL%=%1%would give this text%%.
This can be rather tedious if you have many combinations, and it will likely lead to some text duplication for any similarities, which is why trying to split it up might work better instead (depending on what you are exactly trying to do).
%%VAR1%=%1%And so he said,%%%%VAR1%=%2%And so she said,%% %%VAR2%=%1%"Screw you bastard!"%%%%VAR2%=%2%"Screw you bitch!"%%
Altho, in this case, you can take out the duplicate text that will always show and have:
And so %%VAR1%=%1%he%%%%VAR1%=%2%she%% said, "Screw you %%VAR2%=%1%bastard%%%%VAR2%=%2%bitch%%!"
However, both these things might not be good enough, in which case someone else might have a better solution.
Avery_Moore
Reply
Coding question
5 years ago
Thanks. All good suggestions. In the end I did go for the $PageText thingy. Was hoping not to use code, 'cos it's been really awkward with me so far... But it seems to be working for this at least. ^_^
Killa_Robot
Reply
Coding question
5 years ago
Combine the two is really the best way. Via the page script:
IF %GENDER = 1 THEN %RESULT := 1
IF %GENDER = 2 THEN %RESULT := 2
IF %SEXUALITY = 37 THEN RESULT = %RESULT := %RESULT + 37
[Or something like that, depends on how many combos]
Then on the page:
%%RESULT%=%1%I have a raging boner right now!%%RESULT%=%2%My titties are jiggling with excitement!%%%%RESULT%=%38%I have a raging boner for furry purple fox creatures!%%
Avery_Moore
Reply
Coding question
5 years ago
Page script it is ^_^
Home
Storygames
Random
Search
Newly Created
Top Rated
Fantasy
Grimdark Fantasy
Sci-Fi
Modern
Horror
Love & Dating
Mystery / Thriller
Family Friendly
Historical
Puzzles / Games
Edutainment
Fan Fiction
Forums
Newbie Central
The Lounge
News & Updates
The Parlor Room
Creative Corner
Writing Workshop
Reading Corner
Adv. Editor Forum
Wishing Well
Bugs and Problems
My Stuff
Storygames
Pictures
Messages
Notifications
Duels
Saves
Comments
Points
Commendations
Notepad
Profile
View Profile
Help & Info
CYOA History
About Us
Privacy Policy
Terms Of Service
Logon
version 23.22 | ChooseYourStory © 2001 - 2025, Halogen Studios Entertainment |
contact us