JavaScript behind the set command

I know it’s a common issue that using the *set command in the stats screen might not actually change the variable being affected until players move on to the next page in the story. What I’m wondering is, for this difference between how the *set command functions, is it coded into the stats screen or the *set command itself.

I was thinking of brushing up a sort of custom javascript *set_menu command that would work in the stat menu screen and I’d use a different tracking method to avoid it being abused for the few times it’s used, but I need to know how *set is being limited in the stat menu.

I think if you’re planning to extend ChoiceScript, you can/should go and look at how it’s implemented yourself. You’ll need at least that much knowledge to be able to create an alternative.

Really though, I advise you don’t do that and instead use redirect_scene.

3 Likes

Choicescript is open source (edit: or at least it’s publicly posted), so you can look at the code in GitHub to see the JavaScript behind it.

I agree with CJW, though!

Well, aktchually, :point_up::nerd_face: just because a codebase is publically posted doesn’t mean it’s open source, and ChoiceScript is most certainly not open source. Sorry about that. :sweat_smile:

1 Like

It doesn’t use a typical open license and it’s definitely not “you can do anything you want with it,” but the choicescript license permits “non-commercial usage and modification” of choicescript–even if it’s pretty restrictive compared to something like the MIT license.

But yeah, you’re right–describing it as “open source” is sloppy and not quite accurate, even if it is kind of aligned with open. (I’m a librarian and mostly work with open access publishing, which has much more variation in terms of the licenses, so I tend to forget that the term has a much more specific meaning in software!)

3 Likes