Show Stats Bug?

So, you’re saying no options show up if you only have one weapon. Is that an issue? Because then you can just make an option that always comes up where you can return to the stats screen or something like that.

Or do you want to give the players the ability to unequip all weapons and fight without them? Because then you can just use *if to change entire lines so the ${weapon} doesn’t even come up while playing. Would be a bit of a hassle.

2 Likes

Oh- wait yea. My bad, you’re right.

I hadn’t realized simply adding another #go back
worked.

Thank You!

1 Like

Thank you Everyone!

I hope I don’t waste all your amazing solutions today. :grin:

@Szaal @Miseri @Minnow @seabean

1 Like

If anyone’s still here,

Got a quick question…

I just don’t know anymore. So I made an inventory thing just like the equipment one, but modified a bit to decrease variables everytime players use them. Like potions and stuff. looks something like this:

        *label consumable
          You go through your things…
          *choice
            *if (potion_got) #Potion
              A potion that can increase your vitality…
              
              Potion: ${potion}
              *choice
                *selectable_if (potion >0) #Use Potion (1)
                  You chug down a potion…
                  *set potion -1
                  *set health +200
                  
                  *goto consumable
                #(back)
                  *goto consumable

The problem now is that everytime I press the Return to Game button and then back to the Show Stats then navigate my way to inventory, the potion variable bumps itself back to the number (like it was never used) but it still increases the health by 200. Is this some sort of bug? Because I see nothing wrong with the code (i think). Sometimes it even increases by it itself. (surpassing the original variable change that I did *set variable +1" (becomes 2)

Well… the truth is, any variable changes that made inside the stats_screen is only applied when you press any “Page_Break” button on the real game.

It’s to prevent “cheating the game” by returning to stats_screen everytime you make certain choice, IIRC. It’s already by design. :frowning_face:

1 Like

Dang it, so I can’t make an inventory thing in the stats screen?

Check out the redirect_scene command mentioned on the Advanced ChoiceScript page and, when you’ve done scratching your head trying to figure out how this might help with your problem, also check out the original discussion / announcement of this command in this old thread.

I’ve not yet ever had occasion to use the command myself but I keep that old thread bookmarked as the very epitome of “spark of genius”—since it just seemed to come out of the blue as a result of the thread discussion itself. :smiley:

3 Likes

Wait.
How come I’ve read that holy epitome of wiki-page multiple times and I didn’t noticed it until now?

ALL HAIL THE TRINITY OF CSCRIPT CODER/CREATOR/WIKI-ADMIN :raised_hand: :raised_back_of_hand:


But it’s kinda tricky and code-heavy, tho. The command is literally acts as *goto_scene instead of normal “Return to the Game” button, in which you’ll have to keep track of the player/reader current scene-label to make it work as intended :thinking:
*mumblemumble

3 Likes

Why not just include an option to “check your inventory” in the normal set of choices you have, wherever you would feel appropriate, instead of only being able to do inventory stuff in the stats screen?

This way when you pick the inventory option, you can go to an inventory scene, and have everything work normally.

If you do that, you just need to keep track of where you were, like what scene and what section, to go back to once you “exit” the inventory screen.

2 Likes

I’ve only noticed the redirect_scene command! wow, thanks!

Still scratching my head on the old thread… have no idea what the guy is saying…yet…

Sorry, wha- who- whu- ?

I am so confused… :dizzy_face: hahaha,

Still trying to figure things out. But what if I make a separate scene like: item_use.txt
then in the stats scene I use the command *redirect_scene item_use potion

then in the item_use scene I input said commands say:
*set health +400
*set potion -1
and use the *return command to return the player back into the stats screen?

or will that just return them into the item_use page when they click return to game ?

How do we even keep track of the scenes…

ayayayayayay-

You can skip the stats screen completely.

Let’s pretend these were your normal choices:

#Go to the market
#Go to the inn
#Go to the temple

So you add an “inventory” choice to whatever existing set of choices you have:

#Go to the market
#Go to the inn
#Go to the temple
#Check your inventory

The inventory choice goes to an inventory scene, like item_use.txt, just like you mentioned.
But before that we need to figure out where we were.
So if those choices were part of a scene called chapter1 and we were at section7a, just as an example, you could put those things into variables to keep track.
Maybe:
*create whatscene
*create whatsection

So when you pick the inventory choice…

#Check your inventory
 *set whatscene chapter1
 *set whatsection section7a
 *goto_scene item_use

Now you are in the item_use scene, and you know exactly where to go back to, because you just stored that in your two variables. See what I did there?

1 Like

Well… *redirect_scene = *goto_scene:white_check_mark: , which is not *gosub_scene:x:. I don’t think *return command will work with it :thinking:


But what does @Carlos.R mean is that… Um…

You can use your [item_use.txt] alongside the normal “combat/fighting/whatever” sequences the MC might encounter. So you’ll have something like

*choice
   #Attack
      You hit the blob with your palm.
   #Defend
      You block the blob's blow.
   #Heal
      *goto_scene item_use potion

Edit: already ninja-ed :v

2 Likes

Ahhh I see, that will definately work too.

Though, since the show stats screen inventory thing did’nt work I was making some modifications to my combat scene which uses the *gosub_scene command to make things easier. Will this work as well? Or do I still have to use the *goto_scene ?

      #Use Item
        *label item
        *choice
          *if (potion_got) #Potion (${potion})
            A potion blah blah blah…
            
            Use potion?
            
            Potion: ${potion}
            *choice
              *selectable_if (potion >0) #Use Potion (1)
                *gosub_scene item_use potion 
                *goto item
                
          #(back)

The scene then enters the necessary parameter changes and uses the *return command.

@Szaal

Hmmm… Hngggg… Gggrrrgrgrgggg… :confounded:

Yeah :grinning:
That code should work fine.

1 Like

Why what’s wrong? Did I just coded something stupid? :confounded:

1 Like

Not rly.
It just takes more brainpower than I thought to “compile” your snippet imaginary-ly. :sweat_smile:

2 Likes