I recognize what the problem here is, and the code otherwise works fine, so I'm not asking for the problem, just a solution.
The setup
One member of the party is a telepath and has an ability called "Detect". This is an enemy scan that first shows stats for the individual monster, and then has a follow-up where the telepath describes the monster, gives suggestions on strategy, describes its attacks, and so on, which is customized to each monster.
That part works exactly the way I want it to. I do not need help with that part.
If you use Detect on a monster type that you have already used it on in the past, the telepath gives the individual stats and then says (paraphrased) "I've described one of these before. Want to hear it again?" Say yes and she repeats the follow-up for that monster. Say no and she doesn't.
The problem
This part seemed to work just fine... until I realized that this doesn't save properly. She only remembers whether she described the monster in the current session - if you save, completely close the game, and completely re-open it, she'll forget she ever used Detect on anything.
On the flip side, if you, say, use Detect on a boss, get a Game Over, re-start the save (from before you fought the boss), and use Detect on the boss again, she'll insist that she has talked about that boss even though there's logically no way she should know that.
I recognize that the reason for this is because I set a has_scanned? flag on the enemy object in my Ruby script, and the Save/Load function doesn't actually pay any attention to that since it's not exactly built-in.
One solution would be to use Switches, but that carries the problem that I'd need to devote one switch per monster type on that - and I currently have no idea how many monster types there could be. Potentially hundreds! And I'd need to be careful to have no collisions with the other switches I'm using, which is hardly a simple matter when I haven't yet worked out how many monsters there are or how many non-"I've used Detect on this monster" switches I'll need yet. All in all, it would be the exact sort of hassle I was hoping to avoid by using a Ruby script in the first place!
Obvious other solutions would be "always have the telepath ask" or "never have the telepath ask", but is there another more elegant solution I'm overlooking?
The setup
One member of the party is a telepath and has an ability called "Detect". This is an enemy scan that first shows stats for the individual monster, and then has a follow-up where the telepath describes the monster, gives suggestions on strategy, describes its attacks, and so on, which is customized to each monster.
That part works exactly the way I want it to. I do not need help with that part.
If you use Detect on a monster type that you have already used it on in the past, the telepath gives the individual stats and then says (paraphrased) "I've described one of these before. Want to hear it again?" Say yes and she repeats the follow-up for that monster. Say no and she doesn't.
The problem
This part seemed to work just fine... until I realized that this doesn't save properly. She only remembers whether she described the monster in the current session - if you save, completely close the game, and completely re-open it, she'll forget she ever used Detect on anything.
On the flip side, if you, say, use Detect on a boss, get a Game Over, re-start the save (from before you fought the boss), and use Detect on the boss again, she'll insist that she has talked about that boss even though there's logically no way she should know that.
I recognize that the reason for this is because I set a has_scanned? flag on the enemy object in my Ruby script, and the Save/Load function doesn't actually pay any attention to that since it's not exactly built-in.
One solution would be to use Switches, but that carries the problem that I'd need to devote one switch per monster type on that - and I currently have no idea how many monster types there could be. Potentially hundreds! And I'd need to be careful to have no collisions with the other switches I'm using, which is hardly a simple matter when I haven't yet worked out how many monsters there are or how many non-"I've used Detect on this monster" switches I'll need yet. All in all, it would be the exact sort of hassle I was hoping to avoid by using a Ruby script in the first place!
Obvious other solutions would be "always have the telepath ask" or "never have the telepath ask", but is there another more elegant solution I'm overlooking?