Gosub for randomizing NPC genders?

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.

*rand variable 1 3
*if (variable = 1)
    *set npcheshenb "he"
    *set npchishernb “his”

*elseif (variable = 2)
    *set npcheshenb “she"
    *set npchishernb “her’"    		
    
*elseif (variable = 3)
    *set npcheshenb “the boss"
    *set npchishernb “the boss’"

Then continue on with your text.


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.

Here is some info on using the *rand command


AH! I got ninja’d to it :smiley:

1 Like