Ultimate Noob Coding

This might seem too obvious to be correct:

You say ${namer2} (with an R) where I’d think it should be ${names2} (with an s), because earlier you say ${names1}. Is this intentional or a spelling error?

1 Like

{namer2} is your police partner/romance option {names1} is the NPC/suspect your are questioning. they are gender flip so I coded the names as variable to avoid too many repeats

Also just to clarify, the codes work, there are no errors when I run tests.

It is just the freezing stats screen and never-ending loading bar lol

Apologies if I’m nitpicking, but it seems that you’re missing some #'s before some choices, or the indentation is wrong.

Additional questions:
Is this on Dashindon?; the ChoiceScript IDE; Notepad++; Notepad?
I’ve taken a look, and I can’t figure out for the hell of me why this is happening. Is it possible for you to share the source scene files so we can run a personal test?

1 Like

Maybe it’s the images causing it to load for so long?

The only other thing I can think of is that perhaps there’s a loop that doesn’t exit?

Mind sharing your fuld stats screen code? This looks like more on the stats screen than the actual code. I think you have infini-loop, here.

1 Like

I think there is a loop too, but I can’t find it, well I added it to Dashington, and just tried to play through it and it was kind of slow but did not get stuck…so like you said it might be the pictures but I don’t know.

*label Main

[b]Identification[/b]
*line_break
Name: $!{Name} $!{Surname}
*line_break
Identify as: $!{Identifyas}
*line_break
Eyes Color: $!{Eyes}
*line_break
Hair: ${type} $!{Haircolor}
*line_break
Hairstyle: $!{hairstyl}
*line_break
${face0} $!{facial1}
*line_break
Accessories: $!{access1}
*line_break
Skin Tone: $!{Skintone}
*line_break
Dominant hand: $!{hand2}
*line_break
Body Frame: $!{bod1}
*line_break
Height: ${hei1}
*line_break
Profession: ${travay}
*line_break
Hobby: $!{hob1}
*line_break
Guilty pleasure: $!{plaisir1}
*line_break
Outfit: ${mctop}, paired with ${mcbottom}. [n/] A pair of ${mcfoot} topped with ${mclay}

[b]Family history[/b]
*line_break
${soc1} ${soc2}
*line_break
${com1} ${com2} ${com3}
*line_break
${par1} ${par2} ${par3}
*line_break
${sib1} ${sib2}
*line_break
$!{sibname} $!{Surname}
*line_break
${pib1} ${pib2}
*line_break
${pibname} $!{Surname}
*line_break
${pib00} $!{pib01} $!{Name}
*line_break


[b]Reasons for being in Kastry[/b]
*line_break
${reason1} ${reason2}


*line_break
[b]Possesions[/b]
*line_break
Car: ${carcolor} ${car1}
*line_break
Cell phone: Motorola razr v3
*line_break
Used for work: ${workdev}
*line_break
Apartment decor: ${apttype1}
*line_break
Apartment type: ${aptstyle1}
*line_break



[b]Mental Health[/b]
*stat_chart
 percent Sanity
*choice
 #Your relationships
  *goto Rel
 #Your Skills
  *goto Skills1
 #The friends
  *goto note1
 #Your notes
  *goto note2
 #Leads
  *goto leads0
 #Clues
  *goto clue0


*label Skills1

*line_break 
${intero1} ${intero2}
*line_break 
Accusatory questions asked: ${hard1}
*line_break 
Investigation related questions asked: ${eff1}
*line_break 
Irrelevant questions asked: ${poor1}
*line_break
Amount of cups of coffee you had: ${caffe1}
*line_break
Amount of Alchool beverages you had: ${alco1}
*line_break


[b]Skills[/b]
*stat_chart
 percent Self_confidence

 percent Critical_thinking_skills

 percent Problem_solving_skills

 percent Details_oriented

 percent Attention_seeker

 percent Ethical_behaviour

 opposed_pair comp1
  Competitiveness
  Teamwork

 opposed_pair Joy1
  Introvertion
  Extravertion

 opposed_pair Sacca
  Joyful
  Sarcastic
*choice
 #Your relationships
  *goto Rel
 #Your personal info
  *goto Main
 #The friends
  *goto note1
 #Your notes
  *goto note2
 #Leads
  *goto leads0
 #Clues
  *goto clue0


*label note1

[b]List of ${sis1}[/b]
*line_break
*line_break
[b]${names1} ${surnames1}[/b]
*line_break
$!{menaj1} of Abigail Greene
*line_break
Originally from Maine
*line_break
Twenty-one years old
*line_break
${s1occu}
*line_break
5'11 Black hair brown eyes
*stat_chart
 opposed_pair bels1
  Truthful
  Untruthful
*if (met_s1=true)
 *stat_chart
  opposed_pair sanitys1
   Sane
   Delusional
*line_break
[b]${names2} ${surnames2}[/b]
*line_break
Best friend of Abigail Greene
*line_break
Originally from Maine
*line_break
Twenty years old
*line_break
${s2occu}
*line_break
5'9 Blond hair blue eyes
*stat_chart
 opposed_pair bels2
  Truthful
  Untruthful
*if (met_s2=true)
 *stat_chart
  opposed_pair sanitys2
   Sane
   Delusional
*line_break
[b]${names3} ${surnames3}[/b]
*line_break
Friend of Abigail Greene
*line_break
Originally from Maine
*line_break
Twenty-one years old
*line_break
${s3occu}
*line_break
5'8 Red hair green eyes
*stat_chart
 opposed_pair bels3
  Truthful
  Untruthful
*if (met_s3=true)
 *stat_chart
  opposed_pair sanitys3
   Sane
   Delusional
*line_break
*choice
 #Your Skills
  *goto Skills1
 #Your personal info
  *goto Main
 #Your relationships
  *goto Rel
 #Your notes
  *goto note2
 #Leads
  *goto leads0
 #Clues
  *goto clue0


*label Rel

[b]Relationships[/b]
*line_break
[b]${namer1} ${surnamer1}[/b]
*line_break
$!{r1race} $!{r1}
*line_break
${menajyou1} ${r1lov}
*line_break
Originally from Maine
*line_break
${r1occu}
*line_break
Eyes color: Hazel
*line_break
Hair color: $!{r1haircolor}
*line_break
Body frame: $!{r1bodyframe}
*line_break
Height: ${r1hei}
*line_break
*stat_chart
 opposed_pair romr1
  Lovers
  Friends
*if (met_r1=true)
 *stat_chart
  opposed_pair sanityr1
   Sane
   Delusional
*line_break
[b]${namer2} ${surnamer2}[/b]
*line_break
$!{r2race} $!{r2}
*line_break
${menajyou2} ${r2lov}
*line_break
Originally from New York
*line_break
${r2occu}
*line_break
Eyes color: Light green
*line_break
Hair color: $!{r2haircolor}
*line_break
Body frame: $!{r2bodyframe}
*line_break
Height: ${r2hei}
*line_break
*stat_chart
 opposed_pair romr2
  Lovers
  Friends
*if (met_r2=true)
 *stat_chart
  opposed_pair sanityr2
   Sane
   Delusional
*line_break
[b]$!{namer3} ${surnamer3}[/b]
*line_break
$!{r3race} $!{r3}
*line_break
${menajyou3} ${r3lov}
*line_break
Originally from New York
*line_break
${r3occu} 
*line_break
Eyes color: Light blue
*line_break
Hair color: $!{r3haircolor}
*line_break
Body frame: $!{r3bodyframe}
*line_break
Height: ${r3hei}
*line_break
*stat_chart
 opposed_pair romr3
  Lovers
  Friends
*if (met_r3=true)
 *stat_chart
  opposed_pair sanityr3
   Sane
   Delusional
*line_break
*choice
 #Your personal info
  *goto Main
 #Your Skills
  *goto Skills1
 #The friends
  *goto note1
 #Your notes
  *goto note2
 #Leads
  *goto leads0
 #Clues
  *goto clue0


*label note2

[b]About the victim[/b]
*line_break
Name: Abigail Greene
*line_break
Originally from Maine
*line_break
Age: 20 years old
*line_break
Description: 5'9, blond hair, blue eyes
*line_break
Occupation: Junior College student at Kastry University
*line_break
Last seen: Saturday October 8, 2005 at Kastry public beach
*line_break
Last seen with: Three friends, ${menaj1}, best friend and a friend
*line_break
Status: [b]${abistat}[/b]
*line_break


[b]Your thoughts about the ${menaj1}[/b]
*line_break
1: $!{s1he_she} was found covered in blood.
*line_break
2: ${s1note2}
*line_break
3: ${s1note3}
*line_break
4: ${s1note4}
*line_break
5: ${s1note5}
*line_break
*image not5.png right
*image not5.png right
[b]Your thoughts about the best friend[/b]
*line_break
1: $!{s2he_she} does not remember anything of the night.
*line_break
2: ${s2note2}
*line_break
3: ${s2note3}
*line_break
4: ${s2note4}
*line_break
5: ${s2note5}
*line_break
*image not3.png none
*image not4.png right
[b]Your thoughts about the friend[/b]
*line_break
1: $!{s3he_she} blacked out right around 11:00 pm.
*line_break
2: ${s3note2}
*line_break
3: ${s3note3}
*line_break
4: ${s3note4}
*line_break
5: ${s3note5}
*line_break
*image not6.png right
*line_break
[b]Your thoughts about the parents[/b]
*line_break
1: ${parnote1}
*line_break
2: ${parnote2}
*line_break
3: ${parnote3}
*line_break

[b]Your progressing thoughts on this case[/b]
*line_break
1: ${prognote1}
*line_break
2: ${prognote2}
*line_break
3: ${prognote3}
*line_break

*if (end1=true)
 *goto end0


*choice
 #Your personal info
  *goto Main
 #Your Skills
  *goto Skills1
 #The friends
  *goto note1
 #Your relationships
  *goto Rel
 #Leads
  *goto leads0
 #Clues
  *goto clue0






*label end0
[b]Your conclusion on this case[/b]
*line_break
1: ${endnote1}
*line_break
2: ${endnote2}
*line_break
3: ${endnote3}
*choice
 #Your personal info
  *goto Main
 #Your Skills
  *goto Skills1
 #The friends
  *goto note1
 #Your relationships
  *goto Rel
 #Leads
  *goto leads0
 #Clues
  *goto clue0


*label clue0

[b]${clue01}[/b]
*line_break
1: The letter
*line_break
2: The picture
*line_break
3: The medical report
*line_break
4: The note
*line_break
5: 
*line_break
6
*line_break
*choice
 #Your relationships
  *goto Rel
 #Your Skills
  *goto Skills1
 #The friends
  *goto note1
 #Your notes
  *goto note2
 #Leads
  *goto leads0
 #Your personal info
  *goto Main


*label leads0

[b]${leads01}[/b]
*line_break
1: The fisherman
*line_break
2: Bitsy
*line_break
3: The supplier
*line_break
4: The hidden ingredient
*line_break
5: 
*line_break
6
*line_break
*choice
 #Your relationships
  *goto Rel
 #Your Skills
  *goto Skills1
 #The friends
  *goto note1
 #Your notes
  *goto note2
 #Clues
  *goto clue0
 #Your personal info
  *goto Main


Okay so I am having a bit of a problem with using the if command in relation to true and false.

#Only the Saxons
*if (Saxon >= 40)
*set Saxon true
*set Army + 20
*goto_scene Final
*elseif (Saxon < 40)
*set Saxon = false
*goto_scene Reject

So it works if Saxon is greater then or equal to 40 but if it’s lets say 30 then I always get the error expected at least one line in if true block

Heyo, you might want to check the code:

I’m not sure what sort of Variable ‘Saxon’ should be. You seem to use it a number, and as boolean, which is fine if it’s intentional. Also, you don’t need a ‘=’ sign when you set something to True or False.

Perhaps also just make sure that the indentation is correct. I think that is most likely the cause of the error.

#Only the Saxons
    *if (Saxon >= 40)
        *set Saxon true
        *set Army + 20
        *goto_scene Final
    *elseif (Saxon < 40)
         *set Saxon false
         *goto_scene Reject

I’d also recommend swapping out the *elseif for just *else, since it’ll always ensure that a condition is run if the first isn’t met.

2 Likes

Please, use the pre-formatted option when posting code. This could be a matter of bad grammar. I tested this block of code with proper indentation and it worked fine, except for this line:

Which should not have = between Saxon and false.

2 Likes

I popped your code to my editor and I don’t think I see any cause of infini-loop here. As a kind of last resort, try refreshing your browser. I think you originally had an infini-looping code and you fixed it, but the game did not refresh on the browser; still using the old code.

3 Likes

I changed it else and got rid of the = but it still gives me the same error

Can you post the exact code here?

#Only the Saxons
*if (Saxon >= 40)
*set Saxon true
*set Army + 20
*goto_scene Final
*else (Saxon < 40)
*set Saxon false
*goto_scene Reject

You can format to maintain the coding indents by using this ‘preformatted text’ option, which will help us figure out the problem a bit;

You can also try to include a little bit of code before and after the little bit that is giving the problem.

image

Hello, i have started using CSIDE and i have been playing around with it. I have a question, how do you make a text stat instead of a percentile one? Think of it like the skill stats in Choice of Rebels. I tried to do it with this code but i always get a indentation error.

*stat_chart 
    text Name
    text Title
    text might
     *if might= 0 
        *set text might "Might 0: You are a weak and fragile person physically"

This is the indentation error, i can’t put more left because it would stop being indented to the if.

line 7 of choicescripts_stats: invalid indent, expected 4, was 6

I use notepad so not quite sure what you mean by preformatted text option.

#Only the Saxons
*if (Saxon >= 40)
*set Saxon true
*set Army + 20
*goto_scene Final
*else (Saxon < 40)
*set Saxon false
*goto_scene Reject

#Only the Tudors
*if (Tudor >= 40)
*set Army + 10
*goto_scene Final
*elseif (Tudor < 40)
*goto_scene Reject

To display the text of a stat, you should just use ${variable}, I think.

I’d also not recommend using ‘might’ as number and a text at the same time. Additionally, if you want the value to display the text you set it to, you should set the text before you display the variable.

*if might = 0 
	*set might_text "Might 0: You are a weak and fragile person physically"

${Name}
${Title}
${might_text}
1 Like

I mean, in this Forum, when you post a reply, you hit the </> button, and paste the code you copied from your text editor into the space it prompts you to.

Even if you’re using Notepad, you should still maintain the proper indentation.

1 Like

Thanks for responding!, A question, what do you mean about not making might a number and a text at the same time? Is there any way to make most of my skills variables only text? Thanks once again for responding!

Ideally, you want to track the player’s might throughout the game as a number, so when you change it you can add or subtract from the value.

When you want to display it with text, you should have a separate variable to store the text string, otherwise it will override the number and delete it, meaning you won’t be able to do simple math with it again.

So throughout the game, if the character gets mightier, you’d say:

*set might + 1

Then, when you want to display a text value instead in the stats, you would use the value of might to determine which text to set might_text to.

Does that clarify things a bit?

1 Like