ChoiceScript Problems

Easy?

I having trouble getting descriptions to display in the stats screen.

*stat_chart
	percent sword_play Swordplay
	percent archery Archery
	percent leadership Leadership
	opposed_pair glory
		Glory
			Your in it for the glory.
		Greed
			Your in it for the gold.

I am not getting an error message it’s just not displaying the descriptions.

I have the same problem its the only thing I can’t code. I just desist about it. No way descriptions appears .

@WinterHawk @poison_mara
I believe the ability to add descriptions to opposed pairs has been removed in more recent versions of choicescript.

When we moved to the new look instead of the old one:

Ok, well that’s unfortunate. I could just add descriptions with *line_break and a new *stat_chart; although it wouldn’t work with *opposed_pair.

Ah, that’s why lol. But the no opposing works? I just text doesn’t show in normal stats I just desisted

@posion_mara
I’m not 100% sure but I don’t think any of the stats support inline variable descriptions in the current version, I think you just have to make do with a separate line of plain text before or after the stat in question.

@WinterHawk @poison_mara
Update on this, whilst they don’t seem to support it as a native option anymore, I just noticed that @Nocturnal_Stillness has emulated them with some clever use of formatting in Rookfall:


*stat_chart
 percent body [b]Body[/b] - [i]your strength, endurance and agility[/i]
 percent mind [b]Mind[/b] - [i]your intelligence, will and creativity[/i]
 percent sense [b]Senses[/b] - [i]your perception and awareness[/i]
 percent Personal [b]Persona[/b] - [i]your charm and wit[/i] 

Does that produce the sort of look you were after?
Sadly it still doesn’t work overly well with opposing pairs though.

@CJW @Nocturnal_Stillness
Nice. That was what I looking for. Thank you both. I may end up dropping the opposed pairs; I was on the fence about them, and didn’t have any great ideas concerning them.
Thanks regardless.

I’m having trouble with the and.

*fake_choice
  #I’m very pale.
    *set skin_color "pale"
  *selectable_if (eye_color!="dark blue") and (hair_color!="red/orange") #I’m fair, but definitely not considered “tan”. Like Dana, my mom.
    *set skin_color "medium light"
  *selectable_if ((eye_color!="light blue") and (hair_color!="blonde")) #I’m tan, just like my father.
    *set skin_color "tan"
  #I’m darker than that.
    *set skin_color "medium dark"
  #I have really dark skin.
    *set skin_color "dark"

ChoiceScript is treating it like an “or”, and blocking out the “tan” option even if you have black hair and light blue eyes.

I know this is @P0RT3R’s thread, but I was just wondering.

First *fake_choice can work oddly. Switch to an actual *choice if you’re doing anything complex. That said, your indentation is all wrong. You #choices need to be indented even when starting with a *selectable_if, and any associated *set commands needs to be indented one more after that, so it looks something like this:

*choices
    #option
        *set var "foo"
        *goto next_part
*lable next_part

No, the indentation is right, it just doesn’t work on the forum. Secondly, even with just the choice, it doesn’t work.

To get the forums to display code, put add a grave accent (not the tilde (~), but the same key on most Qwerty keyboards). Either that or add <pre> to the start and </pre> to the end of your code. Indentation is super important in CS.

Now, to your question, rereading it, I’m a little confused here, as in the code, if you have light blue eyes, that second line should indeed not be selectable, and I don’t know what you’re going for in terms of requirements. That said, I’m pretty sure you could indeed simplify your code to ((eye_color = "light blue") or (hair_color = "blonde")) right now. (I think?). So yea, it is currently functioning similar to an ‘or’.

I’d need to know what you actually want to requirements to be to know what you’ll need the code to read as.

'K, I fixed it (sortof), but now I’m having other problems.
This is the error:

startup *choice 196#4 (line 211) #Athena

RANDOMTEST FAILED
startup line 213: Non-existent variable 'adrian'

And this is the code:

  *if (gender="female") #Athena
    *set name "Athena"
  *if (gender="unknown") #Adrian
    *set name "Adrian"
  *if (gender="unknown") #Sean
    *set name "Sean"
  *if (gender="unknown") #Tyler
    *set name "Tyler"

Side note: Most of the other options work.

That’s strange. Does ‘Adrian’ come up anywhere else in your code?

Or do you have a

*if adrian

or

*if name = adrian

check somewhere, instead of

*if (name = "adrian")

? I’ve done that a few times . . .

Also, which line is startup 213, exactly? It usually helps me to look at the exact line with the error when I’m trying to figure out where I got myself into a knot.

Not that I can think of. I think it has something to do with the fact that its the first one which says

*if (gender=“unknown”)
It happens with all of them, and I have no idea what is wrong.
i.e.
*fake_choice
  *if (gender="male") #Liam
   *set name "Liam"
  *if (gender="male") #Maximus
    *set name "Maximus"
  *if (gender="male") #Arkinsin
    *set name "Arkinsin"
  *if (gender="male") #Hercules
    *set name "Hercules"
  *if (gender="female") #Lilena
    *set name "Lilena"
  *if (gender="female") #Maxine
    *set name "Maxine"
  *if (gender="female") #Arkinia
    *set name "Arkinia"
  *if (gender="female") #Athena
    *set name "Athena"
  *if (gender="unknown") #Adrian
    *set name "Adrian"
  *if (gender="unknown") #Sean
    *set name "Sean"
  *if (gender="unknown") #Tyler
    *set name "Tyler"
  *if (gender="unknown") #Drew
    *set name "Drew"
  #I wanna choose my own name.
    *input_text name

So, in this case it would be Adrian, and Liliena that are the problem. Does it have anything to do with *choice vs. *fake_choice? Wild thing I just thought of.

What blasphemy is this? Using my problems topic for your own problems?

As you might have noticed, I’m not great with cs thus this topic but have you tried changing the *fake_choice for a *choice and adding *goto “insert label name” to see if that makes any difference?

Do not call blasphemy what the Great Admin himself has mandated.

1 Like

@P0RT3R
I tried that. It fixed the problem, but I was wondering why it doesn’t work. In a previous “game” I tried it and it did. Was one a glitch?
@Havenstone Yep, learned it the hard way.