Code Help - physical description not displaying properly

Hi, so I’ve recently added the option of my MC having a headscarf and it completely screwed with my physical description display. For reference, this is what my code looks like for the following options.

No headscarf, not bald:

*if (characterdesc="true") and (welcomehome="false")
    *line_break
    [b]Description:[/b] You are a ${sexuality} ${gender} in your ${age} who prefers to go by ${subp}/${objp}. You are of ${height} height and you have ${hlength}, ${hstyle} ${hcolor} hair and ${ecolor} eyes. You are an employee at a dingy diner called Al's Joint, occasionally working other temp jobs, and barely getting by.
    *goto descend

This is what’s displayed:
Description: You are a man in your early 20s who prefers to go by he/him. You are of average height and you have short, wavy brown black hair and hazel eyes. You are an employee at a dingy diner called Al’s Joint, occasionally working other temp jobs, and barely getting by.

Bald:

*if (((characterdesc="true") and (welcomehome="false")) and (hlength="bald"))
    *line_break
    [b]Description:[/b] You are a ${sexuality} ${gender} in your ${age} who prefers to go by ${subp}/${objp}. You are of ${height} height, bald and have ${ecolor} eyes. You are an employee at a dingy diner called Al's Joint, occasionally working other temp jobs, and barely getting by.
    *goto descend

But this is what’s displayed:
Description: You are a man in your early 20s who prefers to go by he/him. You are of average height and you have bald, hair and hazel eyes. You are an employee at a dingy diner called Al’s Joint, occasionally working other temp jobs, and barely getting by.

Headscarf:

*if (((characterdesc="true") and (welcomehome="false")) and (hscarf="true"))
    *line_break
    [b]Description:[/b] You are a ${sexuality} ${gender} in your ${age} who prefers to go by ${subp}/${objp}. You are of ${height} height and you have ${hlength}, ${hstyle} ${hcolor} hair wrapped in a headscarf and ${ecolor} eyes. You are an employee at a dingy diner called Al's Joint, occasionally working other temp jobs, and barely getting by.
    *goto descend

But the “wrapped in a headscarf” doesn’t get displayed.

For reference, this is how I’ve coded them completely:

code in text
*if (characterdesc="false")
    *line_break
    [b]Description:[/b] You have no distinct features to note yet. 
    
    
*if (characterdesc="true") and (welcomehome="false")
    *line_break
    [b]Description:[/b] You are a ${sexuality} ${gender} in your ${age} who prefers to go by ${subp}/${objp}. You are of ${height} height and you have ${hlength}, ${hstyle} ${hcolor} hair and ${ecolor} eyes. You are an employee at a dingy diner called Al's Joint, occasionally working other temp jobs, and barely getting by.
    *goto descend
    
    
*if (((characterdesc="true") and (welcomehome="false")) and (hscarf="true"))
    *line_break
    [b]Description:[/b] You are a ${sexuality} ${gender} in your ${age} who prefers to go by ${subp}/${objp}. You are of ${height} height and you have ${hlength}, ${hstyle} ${hcolor} hair wrapped in a headscarf and ${ecolor} eyes. You are an employee at a dingy diner called Al's Joint, occasionally working other temp jobs, and barely getting by.
    *goto descend
    
    
*if (((characterdesc="true") and (welcomehome="false")) and (hlength="bald"))
    *line_break
    [b]Description:[/b] You are a ${sexuality} ${gender} in your ${age} who prefers to go by ${subp}/${objp}. You are of ${height} height, bald and have ${ecolor} eyes. You are an employee at a dingy diner called Al's Joint, occasionally working other temp jobs, and barely getting by.
    *goto descend

I have absolutely no idea if it’s an indent or a parenthesis problem.

1 Like

I think the issue is that your if statements aren’t mutually exclusive so the order they’re in matters. The first one needs characterdesc=T and welcomehome=F then goes to descend. The second one needs characterdesc=T and welcomehome=F and hscarf=T then goes to descend.

But the issue is, if the second statement is true, so is the first. So your code goes through the first if statement and then skips to descend.

You probably want to do if and elseif statements like:

*if (((characterdesc="true") and (welcomehome="false")) and (hscarf="true"))
    *line_break
    [b]Description:[/b] You are a ${sexuality} ${gender} in your ${age} who prefers to go by ${subp}/${objp}. You are of ${height} height and you have ${hlength}, ${hstyle} ${hcolor} hair wrapped in a headscarf and ${ecolor} eyes. You are an employee at a dingy diner called Al's Joint, occasionally working other temp jobs, and barely getting by.
    *goto descend
*elseif (((characterdesc="true") and (welcomehome="false")) and (hlength="bald"))
    *line_break
    [b]Description:[/b] You are a ${sexuality} ${gender} in your ${age} who prefers to go by ${subp}/${objp}. You are of ${height} height, bald and have ${ecolor} eyes. You are an employee at a dingy diner called Al's Joint, occasionally working other temp jobs, and barely getting by.
    *goto descend
*elseif (characterdesc="true") and (welcomehome="false")
    *line_break
    [b]Description:[/b] You are a ${sexuality} ${gender} in your ${age} who prefers to go by ${subp}/${objp}. You are of ${height} height and you have ${hlength}, ${hstyle} ${hcolor} hair and ${ecolor} eyes. You are an employee at a dingy diner called Al's Joint, occasionally working other temp jobs, and barely getting by.
    *goto descend
*else
    *line_break
    [b]Description:[/b] You have no distinct features to note yet. 
    *goto descend

Basically, you need to start with your most restrictive criteria and go down to the others.

3 Likes

That fixed my problem, thank you so much! I keep forgetting the rules about *if, *elseif, *else statements and it always drives me insane whenever I hit a coding block on how to deal with it.

2 Likes

This topic was automatically closed 24 hours after the last reply. If you want to reopen your WiP, contact the moderators.