I want to randomize NPC genders without linking them to the player’s. Much obliged if you’d let me know whether or not I’m on the right track with coding. Variables limited for brevity’s sake.
To code for situations like this throughout the body of the text?
!{npcheshenb} can say yes, or {npcheshenb} can say no. $!{npchishernb} disposition might allow you to remedy the situation, or it might not. Do you trust your own judgment enough to take that risk? Are you strong enough to accept the consequences if your gamble goes awry?
And if there is a gosub, would it go into a separate .txt file, or can I tack it on at the end of startup?
If you use *gosub it must be on the same text file other wise you use;
*gosub_scene (scene/text_file_name) (label_name)
Otherwise I think this would work.
Make sure however that you have a *goto Between the *rand and the *label’s to continue to the rest of the story.
Code looks good to me. Except for the *create variable 1. That should probably be without the 1. I’m not sure if quicktest/randomtest will like that though (in startup.txt). When I used the *rand command I had the “variable” as a temp at the top of the page where I later ran the *rand variable.
I’m not really sure why you need the go sub when you could have all the *set commands under the variable. e.g.
in startup.txt
*create npcheshenb ""
*create npchishernb ""
Top of the page where the *rand command will later be used.
*temp variable
You could probably have this at the top of the page or where ever you want before the body of text uses the gendered code.
Your go sub can be anywhere in your page but preferably where it wont run into your text again. You don’t want your work to be caught in a loop, or creating unnecessary bugs. You shouldn’t need a *gosub_scene for what you want to create. Unless you want to keep it all separate. Like, one whole page for all the *rand commands to set the genders and then pop back to your story.