Sorry to sort of spam help topics here! Um, but I just am wondering something here! I might not do it if it’s too complicated or whatever, but I was WONDERING if, since I have a list of magic spells in my stats screen for my new magic game, I was wondering whether I could like get them to display as “???” until you find the spellbook in the game which would set it to like *set magmaflare true, which would then turn the “???” in the stats screen into “Magma Flare”?
I mean is that POSSIBLE at all to do, and if it is do you think it’d be worth trying, or should I just leave the spells revealed for the player at all times but have them be greyed out until you flip the true choice switch? And how exactly would I do THAT, too? With like an *if magmaflare false or does it do it automatically?
Crap now I’m just confusing myself more… I guess first off I have to ask how the spells list even works? Do I list every single spell in the STARTUP and the stats files, so when I go through the game it will “give them to you”? AGGGGHHHH. BRAIN HURTING.
Let’s see, do you want the spell name itself to be “???,” or just the description? If just the description, @Szaal’s fix will cover it. If you want the name to be “???” too, then you’d want the *if to appear before the name.
You could just start a topic called “vessynessy20’s help thread” and have it all it one place
That sounds right, yes.
For that matter, if you just want to type up what you’d want your screen to look like when you know some spells but don’t know others, we could probably use that as a springboard to work out what code would produce the desired effect.
Okay um, thank you! I’m still really lost on how to make this work…
In startup.txt I put *create magmaflare
In choicescript_stats.txt I put *selectable_if (magmaflare = “true”) #magmaflare This spell is usable by you! to confirm that you’ve unlocked its use in the narrative.
In the narrative, how you unlock it, I put it in a choice as: choice
** #Learn Magma Flare.*
** set magmaflare true*
But it’s giving me an error on startup.txt saying that “invalid create instruction. No value specified:magmaflare” Please what did I screw up here?
Okay, I think the thing is, you’ll to specify *create magmaflare false, so that the variable has a value when you create it… it can’t be empty. The game needs to know that you don’t know the spell at the beginning.
(By the way, if you want to type code on the forum, you can stick ` around text to make that bit of text show up as code, or you can type [code] and [\code] around the part you want to show up as code, and that way it’ll keep the formatting.)
Also, I don’t think you should have the quotation marks around “true.” (You would want the quotation marks for a text-based variable, like the example of “proficiency,” but not for a true/false one!)
Oh wow! That’s a really simple thing and I’m dumb for not realizing it… That fixed it! Thanks again TSSL! Of course, I guess I might’ve just assumed that leaving it blank COUNTED as it being false, but no I actually did have to specify that it was false…DERR. Wow.
Thanks for the code tip!
And okay, I’ll get rid of the quotes on that one and see how it works!
It’s something I’ve forgotten several times myself
Pretty much any variable, when you create it, you need to specify a value for it, whether true/false, a number, or a string of text (the latter of which would go in quotes… and can be blank, if you just use "").
The other thing is, for true/false variables, you can simply the check to be simply *if magmaflare or *if not(magmaflare). It’s a shortcut
Crap. I went wrong somewhere again! It’s telling me invalid indent, expected at least one choice, on the line that has *selectable_if? But that IS a choice, and I formatted it like that on my other game it worked fine…
[code] *label spells
Here is a list of spells available to you at your present experience level.
*choice
*selectable_if (Expelliarmus = true) #Expelliarmus
This spell is usable by you! #See stats.
*goto mainpage [\code]
OH MY GOSH IT’S PERFECTLY PERFECT NOW!!! I LOVE YOU PLATONICALLY!!! Alsoooo I did your OTHER advice and actually changed the entire choice into that *fake_choice thing, and THAT fixed an error where it was telling me to not have a GOTO or something! Now when I click the spell itself it takes me to the “This spell is usable by you” message below it, and then gives me the “see stats” option! Which goes back to the top menu again! Which is really awesome. It’s like a perfect loopy loop!
Thanks so much for sticking with me and helping me iron out these dumb little issues of mine! Probably most of it was due to it being 1 in the morning and I’m probably stupid tired, hence why I didn’t notice the last *goto being off…