I’m having trouble with creating certain skills as a count rather than a percentage.
My current code works, I’m not getting any error messages, but I’d like to clean it up a bit if I can.
Here’s what the skills look like on the stats page:
The trouble comes from those identifiers: “knowledgeable”, “dabbling”, etc. I have to repeat the same lines of code, three times, in order for them to work. Is there a way to condense them so I only have to do it once?
My code looks like this:
*label skillDesc_lang
*if lang >= 10
(Expert)
*return
*elseif lang >= 8
(Highly Skilled)
*return
*elseif lang >= 6
(Skilled)
*return
*elseif lang >= 4
(Knowledgeable)
*return
*elseif lang >= 1
(Dabbling)
*return
*else
(Unfamiliar)
*return
That’s the code for languages, and I’ve copy/pasted it again for history and again for technology. It would be nice if I only had to do it once.
I saw something like this in Choice of Magics, so I went and did some code diving. It looks like the author used params, but when I tried to mimic their coding, I couldn’t get it to work. Any suggestions?
Here is a complete working example of how it might work in your case (all of the code is in a single scene file. If you want to access it from multiple scene files, you can use *gosub_scene instead)
Omg thank you quartz!!! This is exactly what I was looking for. I’ve struggled with this for an annoyingly long time. Thank you to everyone who responded; I appreciate the help, truly.