Ultimate Noob Coding


#241

Im sure it’s the easiest but i can’t pull it off.
So… How can i not display stats screen after every chapter? Thanks :grin:


#242

??? What?
I don’t know what you did, but usually stats screen don’t display automatically to begin with O_o


#243

I saw this in the first day of reply but didn’t have the opportunity to check it out since my pc is broken. While i need to ask something i said it would be nice to let you know i saw it :slightly_smiling_face:
——————————————————
I can’t try the code since my pc is broken so im asking you.

Im confirming few questions if this code works;

1- Does the exclamation mark in “ ${} ” just change the letters to its capitals/lowers
Or reshapes it as, capital on first / full capital, according to the usage of “!” ?

An example: We have a string variable var1 and it’s set to “AaAA
Would putting $!!{var1} Display it as AAAA or aAaa? And is it possible to use “!” when setting the variable?

**2- If an “if” statement works, does it sweep away all the elseif’s and else’s below it. Because if not, even if the reader puts male, their pronouns will reset back to variations of “they”. (See the code below.)

The main reason i need this code is that there are lots of different genders and i can’t put them all in there as a choice. I think putting there male/female/bi would be discriminating for trans people. It would be the same as putting male and not female, in my opinion.

*choice 
    #gender.   
        *input_text Gender 
        *set Gender “$!!{Gender}” 
*if (Gender “MALE”) 
*comment All the pronouns for male will be here with proper code. Then;
    *set Gender “male” 
    *goto orientation

*elseif (Gender “FEMALE”) 
*comment All the pronouns for female will be here with proper code. Then;
    *set Gender “female”
    *goto orientation 

*else (Gender “$!!{Gender}”)
*comment All the pronouns for they will be here with proper code. Then;
    *set Gender “${Gender}” 
    *goto orientation

#244
  1. Two ! capitalize the entire word.
  2. If 1 if fits the others are skipped.

Edit: also you don’t need a qualifier at else.
It’s
If = this thing
Elseif = that other thing
Else = all the things left.


#245

Sorry for being a headache…

Is it possible to implement an “if” statement after a choices option. And if yes, it should be possible to “label” inside that option, right? Or should i just make a new label and direct the reader to it with *goto , right after that option?(I don’t want to do it with goto tho, i feel it’s gonna mess up my code.)


#246

I think it’s up to personal taste of ow you prefer it (though i think massive choicetrees can result in looping)

But otherwise:

*choice
   #option
      *if var = x
         *goto 1
      *else
         *goto 2
   #etc

Works fine.

Edit.
Yes. Labels work too, but only restricted.
Like

*choice
   #option
      *if x
         *label
             *choice
                 #option 
                    *goto label

Etc


#247

Let me post mine so you can get the idea more.

I basically want to let the reader choose if they want the reminders after a choice.

 #"You've never appreciated the hard-work of that door, did you?"
        *if (reminder = true)
        "You've never appreciated the hard-work of that door, did you?" 

*comment And then i want to continue here for both reminder true and false without having to create a new label...

Then what? I can’t fall out of an “if” statement. Only option there is to create a new label? Guess i want the impossible…

EDIT: Solved.


#248

Mhnnn…
It’d simply be a bit of flavor text. So the next would be a

*line_break
*goto next

#249

Am i the only noob here? Why im the only one asking questions, it feels bad… :neutral_face:

This code below should be turning the input to capital on first letter but it doesn’t change anything. I tried lots of variations(since my pc came back and im happy(!)) and mostly it gave me errors.

Also i shouldn’t be needing “=” if i know right, but otherwise it gives error.

*choice
    #State your gender?
        *input_text Gender
        *set Gender "$!{Gender}"
*if (Gender = "Male")
    *set Gender "Male"
*comment set pronouns
    *goto sexual_preferences

*elseif (Gender = "Female")
    *set Gender "Female"
*comment set pronouns
    *goto sexual_preferences

*else 
    *set Gender "$!{Gender}"
*comment set pronouns 
    *goto sexual_preferences

*label sexual_preferences
*input_text Orientation
*set Orientation "$!{Orientation}"

If i can’t work this out, would it be enough to give the reader a double check such as;

You are a/an ${Orientation} ${Gender}, is that right?

So they can go back and type again with proper capitalization.

EDIT: But then their pronouns won’t be right if they go on with MaLe or something… pff


#250

Worry not! You are not the only one; after all, I started this thread for my own noobish inquiries, of which there were many. I’m glad to see it continuing to help other ChoiceScript freshmeat get proper direction. I truly could not have finished my contest entry in time without the helpful people here.


#251

Your code looks fine. Nothing is wrong.

Do you mean that if I input “male”, the code sets it as “male”? And not “Male”?


#252

Exactly. (20 chars…)


#253

Hm. I tried your code and it works just fine.


Just my nitpicking, but I think having a low-case gender is fine. Afterall, if you need the upper-case, you can always put $!{gender} anyway.


#254

The problem is what if you put MalE or MaLe or MAle. Try me… I tried coding for all 64 possibilities and then i had to do it for female… :grin:

Then you would have a male’s pronouns as they variations.


#255

Ah, I see.
Hmm.


Did you know if the code $!!{gender} it will make it “MALE”?

Using this principle, you can rewrite your code to this :point_down:t4:

*choice
    #State your gender?
        *input_text Gender
        *set Gender "$!!{Gender}"
*if (Gender = "MALE")
    *set Gender "Male"
    *comment set pronouns
    *goto sexual_preferences

#256

This gave errors no matter what i did. I will give it a try again and then if not, will tell the reader to put it properly… :slight_smile:

EDIT: AHAHHHAH, drives me crazy… Male and Female works now but for non-binary, it makes it full capital or as the input even though i have *set Gender ${Gender} and input is Aaaa. it displays as AAAA. Whatever, the pronouns will be right for non-binary no matter what they put there so they can have their gender as AsAsA. It’s about inclusivity after all, isn’t it :wink:

Thanks for help.


#257

The error is probably comes from you using *choice instead of *fake_choice :thinking:

Unless you already use the latest CS version and put that *implicit_control_flow true… yadda yadda.


#258

Instead of *set Gender "$!!{Gender}", you could try *if ($!!{Gender} = "MALE"). :thinking: That would only capitalise a copy of the variable, so the original variable Gender remains uncapitalised.

Actually, do you need a *choice there? If there’s only one option, why not just have it outside a *choice?


#259

For the non-binary, there’s a workaround to prevent the player to input messy-case gender. Of course, it requires a pretty advanced coding and dedicated subroutines.

But then, it’s their own problem if they put random words as their gender, isn’t it?


#260

Two questions: how does coding work when you give people the option to write in a name as well as choose a preselected one (MC for my new WIP will be more of a blank slate that NPT’s pre-created characters), and how do you create the credits page? I also want to do a little work getting NPT shipshape so it has less turnaround time between contest end and being ready for publishing.