Non-threaded

Forums » Advanced Editor Forum » Read Thread

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

Gender Choice How-To for Idiots

5 years ago
Commended by mizal on 2/15/2019 9:21:07 AM
Make a variable called %GENDER that is set to 1 if the player chooses male and 2 if they choose female. (there are no other genders) To do this, write in the link script (accessed via the little icon besides the link you've added) either %GENDER := 1 or %GENDER := 2. The variable will be set when the player clicks it. You can then have the game check the variable at any time and send the player to specific pages based on it. IF %GENDER := 1 THEN $DEST := @P47 Or use Link Restrictions (the stop sign icon) to control whether certain links show up at all depending on what %GENDER is set to. If you don't want dramatic changes to happen but just wanted a little customization for the character, you can use on page scripting. In the text box with the rest of the story, you can change specific lines or words by inserting scripting like so: %%GENDER%=%1%boy%% %%GENDER%=%2%girl%% "None of your business, little %%GENDER%=%1%boy%%%%GENDER%=%2%girl%%!" the man sneers, slamming the door in your face. Any text you want can go in the place of 'boy' or 'girl' so this is also how you'd handle pronouns like him and her or even changing entire sentences. It might be difficult to remember exactly where the percentage signs at first, which is why I always kept a snippet of text like %%VARIABLE%1%text goes here%% in my Notepad when I first started using it and just copy and pasted and then altered it when needed. It's also easier to script it out on seperate lines like in the first example, but you'll have to fold it all together in a block at the end so that you don't wind up with a lot of blank spaces within your story. Although there are only two genders, you can use as many variable states as you want anywhere in a story passage to allow for the story to react in small ways to a wide variety of player choices. A combat scene for instance could be altered to show how skilled or clumsy, weak or strong their moves are based on whether they have any training or experience from a decision point earlier in the story. Remember that a gender choice isn't needed at all for many stories, especially if it's just a cosmetic change that doesn't effect the plot. In a lot of cases it's preferable and allows more depth to tell a story about a character you created yourself, but if you DO want to offer the option for whatever reason, you need to know the basics of how variables and scripting works. (As an aside, if I see one more game with 'if you choise boy clik here' as a stand in for actual choices in an otherwise linear story, I will castrate the author with a pair of rusty garden shears so that there's no more need for the question.) Oh and also, if you learn to do the things in this guide, you can now do 90% of other things you might think of to do with variables in your story. IF/THEN and checking and reacting to variables, once understood, can be used to do elaborate and complex things as well as this simple bit of text swapping.

Gender Choice How-To for Idiots

5 years ago

Awesome! is idit

Gender Choice How-To for Idiots

5 years ago

"there are no other genders"

Honestly this was the most important part.

Gender Choice How-To for Idiots

5 years ago

I do remember that half of the terrible Warrior Cats games gave the player the option to play as male or female... But they didn't actually know how to code, so they'd just keep asking you the same question several times. cheeky

Gender Choice How-To for Idiots

3 years ago
Oh GOD you just gave me horrible flashbacks. the cringe...