Can’t display text in an *if statement under choicescript_stats

Hi,

I can’t seem to get some text to display in an *if statement under choicescript_stats. I’m trying to get it so a text variable changes under certain conditions, but it doesn’t display, and leaves it blank. So, below, the menu should display what the PC is currently wearing, under ‘Top:’. However, it’s still blank. There’s no error messages, it just doesn’t display.

I’m a ChoiceScript rookie, so this is probably very obvious. Apologies in advance if so, and thank you!

My code looks like this:

Current Outfit
*line_break
*line_break
Top:
${top}
${top_description}

*if (smartshirtequip)
    *set top "Smart Shirt"

*if (brightrobeequip)
    *set top "Bright Robe"

*if (exquisiterobeequip)
    *set top "Exquisite Robe"

*if (leatherarmequip)
    *set top "Leather Armour”

*if (chainmailequip)
    *set top "Chainmail"

*choice
    #Return to menu.
          *goto menu


Put the part where you display the text below the if statements

*if (smartshirtequip)
    *set top "Smart Shirt"

*if (brightrobeequip)
    *set top "Bright Robe"

*if (exquisiterobeequip)
    *set top "Exquisite Robe"

*if (leatherarmequip)
    *set top "Leather Armour”

*if (chainmailequip)
    *set top "Chainmail"

Current Outfit
*line_break
*line_break
Top:
${top}
${top_description}

*choice
    #Return to menu.
          *goto menu

With your original code, it was outputting “top” and then running through all the checks that set the variable for top. You probably also want to add code that changes top_description.

Brilliant! Thank you so much! That was bugging me for a while :smiley:

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