Ultimate Noob Coding

Does it not show at all or is it just not formated right?

With opposed pqirs you only need to *create one of them and raise or lower that one, Choicescript still shows both if you code it.

Just in case you miseed a step here’s what works for me:

If you want to check for Merciful, you create that in startup.

*create Merciful 50
You can set it to another value, if you need.

In your choicescript_stats.txt you put:

*stat_chart
	opposed_pair Merciful 
		Merciful 
		Ruthless 

I use one tab for the line opposed_pair is on and two for the names of the variables, in this case Merciful/Ruthless.

This works for me, hope it helps.

I have SUCH a hard time with *if statements that have more than two segments. I get it in theory, but as soon as I’m working with booleans it all goes out the window.

Does this, like. Work?

*selectable_if (((not (touchingokay)) or (demi)) or (aro = 3)) #Text of the choice.

I think the way you’ve done it is OK, but it might be easier to read like this - I tend to do it this way to reduce the number of brackets I’m dealing with:

*selectable_if (((touchingokay = false) or (demi)) or (aro = 3)) #Text of the choice.

Something I really love about using the VS Code ChoiceScript extension is that it shows an error squiggle if the brackets aren’t right, so I can catch and correct it before running QuickTest or RandomTest - it might be worth looking at, if you find this kind of thing slows you down a lot (I do find that myself, heh).

2 Likes

Thank you! I had no idea you can do booleans with an = false, I thought they had to use the Not!

1 Like

I got this error when creating an array:
image

just WHY oh WHY? the value “001” is not even numbers

( or I didn’t declared it as numeric because it was supposed to be a text / string, but I don’t see the option to tell CS if I wanted to create a numeric variable or a text ones )

and WHY it has to be greater than 0? 0 is a valid value, I don’t understand why it has to be greater than 0

please help me understand, thank you :pray:

If the length is 0, then the array would be empty. The very first value after the name of the array should be its length, in your case: 7. You start with a string, that’s why it’s complaining.

*create_array a1_atr 7 "001" "001" "001" "001" "001" "001" "001" 
2 Likes

oh, I forgot to define the length of the array, which is 7

thank you

Hey all, I’m trying to make a choice with layers of failing- and I want to know if that’s even possible.

What my intention is is to make it so that a certain attribute must be at a certain level to pass completely. If it does not exceed this pass threshhold but exceeds a secondary (yet lower) threshold, you would get a different line of text. Finally, if neither threshold was passed, you just straight up fail. Is such a thing possible?

You want an if statement.

*if (attribute >= 20)
   Full pass... 
*elsif (attribute > 10)
   Partial pass... 
*else
   Fail... 

You can take a look at the basic tutorial to start familiarizing with ChoiceScript’s features.

Alright, that’s what I thought. Now, the issue that I’m running into is that those who play through the game can only see one option. The way I wanted this to work is for there to be multiple options each with the levels of success/failure, but only one option can be seen. Here is the shortened code (just taking out narrative things to make it easier to read):

Blockquote
*choice
#You pick option one. This is the only option players would see, even if they maxed the discipline stat.
*if (Discipline >=30)
Full success.
*goto_scene NEXT

  *else 
      Full Failure.
      *goto_scene NEXT
  
#You pick option 2.
  *if (Discipline >= 40)
      Full Success.
      *goto_scene NEXT
   
  *elseif (Discipline < 40) and (Discipline >= 20)
      Partial Success
      *goto_scene NEXT
    
  *else
       Full Failure
      *set PCohesion %-10
      *goto_scene NEXT

Sorry, I don’t understand the problem. Can you word it differently? You can use *if and *selectable_if in the choice options to hide or gray out options.

*choice
   *if (stat > 40)
      # Option can only be seen when stat greater than 40.
         ... 
   *selectable_if (stat < 40)
      # This option is only available when stat below 40, but can be seen. 
         ... 

The issue is that only the first option can be seen and selected. The other options don’t even come up. It is just that first option that shows up when there should be three (As there are three options.)