Right now ghost dialogue is like a state machine, where you have a list of dialogue options and whenever a ghost switches from one state to another it randomly chooses one option to display. (like going from chasing to having caught the player, or swallowing them, etc)
and while it works pretty well, it is somewhat limited. which is why i wanted to suggest the ability to have weights and conditions attatched to dialogue options within one of those "blocks" ("inital_grab", "taking_too_long", etc. are examples of blocks).
weights would allow users to adjust the rarity of dialogue options. for example if the "initial_grab" of a ghost has 2 options then both have a 50% chance of being picked, but if you give them weights of 0.9 and 0.1 respectively then the first one has a 90% chance of being picked while the other has a 10% chance. not specifying a weight just keeps the original behaviour.
now, conditionals would be the big one. having the ability to select dialogue options based on certain conditions in addition to randomness would allow for way more complex ghost interactions and make them feel more alive (pun intended) as you can make them react to certain things. JSON aparrently supports if else statements by default, so it might be possible to shoehorn this into the existing system without breaking any mods.
for a list of conditions i can think of:
- player health
- player health (as a percentage relative to max health)
- maximum player health
- player money
- player kills
- total player deaths
- total player deaths to this specific ghost type (so a ghost could mock you for dying to their kind multiple times specifically)
- current floor number
- current floor biome
- current debuf
- if player was hiding inside a box (so you can check it after the inital grab)
- current battery (as a percentage)
- if a power outage is currently happening
- remaining ghosts in this room
- amount of times player has been grabbed by this type of ghost inside this room (so they can comment on having caught you multiple times, or have special dialogue for catching the player the first time, resets after room clear)
and there are probably way more that would be useful to fun to have. overall this would massively increase the total amount of possible interactions you can have with a ghost as there are way more factors that can change it (depending on what the ghost is programmed to check for of course).
and from just looking at these, you could use conditionals in the "inital_grab" block to completely replace the "entrancement", "shrunk", "plushified", etc blocks as they are functionally identical. same with the "health_milestone" blocks which could just be a conditional option in the "taking_too_long" block. (thought for compatibility reasons with 2.0 mods that likely wouldn't be a good idea).
and to cap this post off, i'd like to shoutout to Psionikal, cause i also think dialogue boxes should automatically be interrupted if you free yourself from a ghost, plus you should be allowed to pause while a dialogue box is on the screen.
anyways, lovely game. hyped to see the next update (whenever that may be), good luck with development!