Just to be sure I understand this:
You're specifically referencing the part that didn't work and corrupted the string, and saying that if I want to turn that into a string, then I need to take an extra step.
As opposed to "so the rest of your code may look like it's working, but it's not working right, and you really do need to take this extra step on all the things that so far seem to be working." Which is currently this:
var accessory = globals.state.unstackables.get(person.gear.accessory) var acc = getaccessory(accessory.code) func getaccessory(code): var acc = null match code: "accslavecollar": acc = "collar" "acchandcuffs": acc = "handcuffs" _: acc = null return acc
...with variations for costumes and underwear.
I'm not sure if it's possible to shortcut the first two lines to avoid an extra variable that gets immediately discarded? Something like this:
var acc = getaccessory(globals.state.unstackables.get(person.gear.accessory).code)
I debated about trying that but decided that despite the throwaway variable (three of them, all told), the code just looks nicer and more readable when I separate those two steps.
Anyway, I've gotten to the point of being able to reference and sort by these values, and it's all working pretty smoothly now that I've put it behind "if x != null" walls (which checks if the variable isn't set -- in this case, if the character isn't wearing anything, as opposed to wearing a different thing). I presume I could do a similar thing using typeof() to make sure it's a string, which is likely a good habit to get into (sanitizing input), but at present all I am looking for is whether it's null.
(P.S. I understand print() functions to display text on the screen (pop-up box); does it have a different function or multiple functionality in Godot?)
Also, on the up side, I've gotten to the point where nearly all the problems get washed away in a few rounds of basic troubleshooting (e.g. pull the newly added code out to a text file, make sure the base isn't broken, add it back in in pieces, find the part that throws a wobbly, then look extra carefully to see if I've forgotten a quote or colon somewhere or misspelled a variable or the like (Notepad++ is actually really good at reducing the (already low) chance that I'll misspell a variable I've used elsewhere in the code), or if the issue is another round of misunderstanding how the code actually works).
So now it's just... ye gods, that's an ambitious level of fine-tuning my brain wants to do to the script! I'm not even to the fancier parts of the code, just the description you see when you look at a slave and what the slave says to you when you talk to them. I've condensed parts of the description to lines like "You see Wisteria Smithee, a towering, strikingly gorgeous Halfkin Wolf youth with her hands bound behind her" (which also omits the average part, unless both height and beauty are average, in which case it says "unremarkable" for humans and "typical" for non-humans) and fancy descriptions for costumes based on whether the character is handcuffed or wearing a collar (and the collar description changes when the character is more loyal).
Tomorrow, if all goes well, I'm gonna tackle separating the upper body description from the lower body description so that the eye flows seamlessly down the body. And then figure out which parts of the character traits I'd like to weave into the description and where. It'd be nice to see bits of description that combine e.g. beauty and strength (Strong, Frail), or agility and charm to add up to gracefulness, or like have a foul-mouthed character in handcuffs with low obedience throw you the bird.