Question about stat build

I want to create a stat build screen like the one from ZESH but I run into some problems.
Nested choice doesn’t work and the choice is disabled after it’s been chosen once instead of following the counter.

For example, when I choose #Close Range Combat, it doesn’t lead to the #Increase choice and instead it loops back to *label perks, and the #Close Range Comabt option is disabled after selecting once

Here’s what my code looks like.

*label reset

*temp point
*set point 100
*set closerange 20
*set longrange 20
*set piloting 20
*set situationalawareness 20
*label perks

Your currently have ${point} points remaining.

Which skill do you want to improve?

*choice       
        *disable_reuse *selectable_if (point>0) #Close Range Combat
                *disable_reuse *selectable_if (point>=20) and (closerange<100) #Increase 20%
                *set point -20
                *set closerange +20
                *if (point>0)
                                *goto perks
                *else
                                *goto noperks
                *disable_reuse *selectable_if (point>=10) #Increase 10%
                *set point -10
                *set closerange +10
                *if (point>0)
                                *goto perks
                *else
                                *goto noperks
                *disable_reuse *selectable_if (point>=5)  #Increase 5%
                *set point -5
                *set closerange +5
                *if (point>0)
                                *goto perks
                *else
                                *goto noperks
                *disable_reuse *selectable_if (point>=1) #Increase 1%
                *set point -1
                *set closerange +1
                *if (point>0)
                                *goto perks
                *else
                                *goto noperks

With *disable_reuse you are disabling the choice after selecting it once, and then disabling the next choice increase ##%

Your indentation also looks wrong. With 2 spaces for each indentation its enough and in my opinion it looks and feels more understandable . Like so…

*label reset

*temp point
*set point 100
*set closerange 20
*set longrange 20
*set piloting 20
*set situationalawareness 20
*label perks

Your currently have ${point} points remaining.

Which skill do you want to improve?

*choice       
  *selectable_if (point>0) #Close Range Combat
    *selectable_if (point>=20) and (closerange<100) #Increase 20%
      *set point -20
      *set closerange +20
      *if (point>0)
        *goto perks
      *else
        *goto noperks
    *selectable_if (point>=10) #Increase 10%
      *set point -10
      *set closerange +10
      *if (point>0)
        *goto perks
      *else
        *goto noperks
    *selectable_if (point>=5)  #Increase 5%
      *set point -5
      *set closerange +5
      *if (point>0)
        *goto perks
      *else
        *goto noperks
    *selectable_if (point>=1) #Increase 1%
      *set point -1
      *set closerange +1
      *if (point>0)
        *goto perks
      *else
        *goto noperks

You should get rid of the disable_reuse though, if you want to be able to choose that more than once. If you already have a check system for that you don’t need to disable_reuse it.
like, if the choice says that it only can be used if points>5 you don’t need to disable_reuse it, cause the *if is already doing that function.

2 Likes

I’m actually using Choicescript IDE to write the codes, so the space bar comes automatically. Are there better options? Debugging is a drag on Choicescript IDE because I have to restart the game each time I want to debug

You can set the indent block to two in the settings. What I normally do after debugging is to add *goto_scene and set variables at the beginning of the game, so when I start it, I’m at the spot where I left off at.

2 Likes

As Phantmwolf says, you can set the indent block on the settings tab

You can also set all your variables at the beginning of your first chapter and then use the *goto_scene command to jump at the place you want to debug without having to play everything.

*set var1 4
*set var2 8
…
*goto_scene (name of your chapter) (name of the label, in this case "reset")
*goto_scene chapter_8 reset

Alternatively you can also use the command line to jump between chapters.

CSide is the best option to debug I think. You can also do it with this:

But you still have to restart your game after making a modification. So jumping from your fist chapter to the one you want to debug is maybe the easiest way.

One last thing to note. After you change the indent block to two, right-click on a scene and go to edit. You can convert all spaces to tabs, it will change all indents so you don’t have to do it manually. You just have to make sure you set tab types to tab after you’re done. Conversely, you can change all tabs to spaces to undo the change.