Setting variables in ChoiceScript_Stats


#1

Right so, I don’t have an actual problem, so much as a question.

I’ve been playing Saga Of The North Wind, amazing game. What I noticed is that, you have the option to change your name and tribe name in the ChoiceScript_Stats page. And I thought to myself… How did they code that?

Usually, when I’m writing, the ChoiceScript stats page basically resets everything as soon as you go back out of it and into the actual game, so whatever changes you make in the choicescript stats page won’t transfer over to the actual gameplay.


The question is, Can you make a choice to set a variable in the ChoiceScript_Stats.txt?

Because that would be very useful to set up difficulties and other stuff mid-playing and such…

It would practically make the ChoiceScript_Stats act like a pause feature

Thank you in advance, and sorry for your troubles. :sweat_smile:

P.S: If the solution was to change something in the Javascript, I may be able to do so since my co-author has decent experience with it.


#2

Yeah, it is very much possible. I’ve been thinking of using that trick in my latest WIP.:grinning:


#3

It is. There was a post a few days ago using the stats sceen to equip and unequip items. You can treat it like its own scene, and try things out to see how it goes. A difficulty option could work…


#4

How… exactly do you do it? I tried to find the thread, but I can’t find it… :sweat_smile:


Choicescript stats page and variables
#5

This was a change to CS. You can now *set a variable in the stats screen and it will update. Normally you’ll see the change after going to the next page, but you can push it to the current page with *redirect_scene which otherwise works like *goto_scene


#6

I got it! Wow, all this time, I was completely oblivious that there was an update to the CS.

I updated my files and tried it out. At first, I had a problem with the save plug in I was using, but then I realized I just had to redo the intergration.

The new scrolling animation is AMAZING! Wow, this is all so amazing :joy: Thank you so much, and sorry for the troubles.


#7

DAVUUUUK!!!
So now we’re no longer need to use the *redirect_scene !!!

We… have… to… SPREAD THE WOOORRDDD!!!
(yeah, sorry. I just can’t contain my excitement. It’s flooding my room, now :rofl:)


Edit:
I’ve tried several scenario, and I think I’ll put my conclusion here as well.
Take an example of the player drinking a HP potion via stats screen.

  1. After drinking the potion, the {HP} inside the stats_screen will adjusts accordingly, but not yet with {HP} on the actual game.
  2. ${HP} on the actual game will adjusts after you press the “Next” button and proceed to the next vintage/event.
  3. Player can choose to go stats_screen > Drink x HP potion > return to game > stats_screen > Drink y HP potion > return to game.
    In this case, the number of potion that will be taken by the player is y potion :ballot_box_with_check: and not x :x:

This means that the player can choose to “reset” the number of HP potion they take by cancelling via <<return to game>> and correct it by going back to <<stats_screen>>.


#8

Can we use *temp instead of *create in startup.txt?


#9

Yes, but it will only work within the startup.txt file…


#10

I don’t get it. Explain pls.


#11

Using the *temp command creates a temporary variable that will work, until you move onto a new scene file. When you move onto a new scene file, the variable made with the *temp command will no longer exist.


#12

If you have read Ever tree inn you would observe that after creating character background you would see that suspect percent has ???, until you meet that character then the name of that character met displays. Do you know how he did that.


#13

I think it’s just a simple boolean variable which changes to true when your PC met this suspect.

Something like

if not (suspect)
   The suspect is: ???
if suspect
   The suspect is: $(suspect}

And you don’t need to declare any variable in stats_screen for that.


#14

Most grateful to everyone who helped me.