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.
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)
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.
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
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 *mumblemumble
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.
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 ?
#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
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 ?