by Matt » Fri May 21, 2021 9:40 pm
I want a clean way to have a monster do things other than/along with it making its seesound and going into see state, that shouldn't be done repeatedly but only when the monster first acquires its target.
Use cases can include:
- Playing a seesound at a different pitch (this is what I was trying to do - each individual monster would have a slightly different voice pitch, which is fairly easy to do for idle, pain and death but not sight)
- Playing a different seesound depending on other circumstances (e.g., multiple pronoun options for "It's ___! Get ___!" depending on player settings, or different responses depending on whether a certain quest item is in the player's possession)
- Summoning an ally, shield, etc. that's only supposed to happen once per fight
- A different opening attack that isn't repeated again (good for characters with very limited ammo like throwing axes or whatnot)
- A flying monster launching itself into the air if it's on the ground
Something equivalent for when a monster loses/defeats its target and goes into spawn/idle would be great too.
Workarounds I'm trying to avoid include:
- constantly comparing the monster's current and immediately preceding target (can be done as a last resort)
- inserting all this stuff into the spawn/idle/see states of each monster (there are quite a few so it gets unmaintainable quickly compared to having them all inherit from another monster)
I want a clean way to have a monster do things other than/along with it making its seesound and going into see state, that shouldn't be done repeatedly but only when the monster first acquires its target.
Use cases can include:
- Playing a seesound at a different pitch (this is what I was trying to do - each individual monster would have a slightly different voice pitch, which is fairly easy to do for idle, pain and death but not sight)
- Playing a different seesound depending on other circumstances (e.g., multiple pronoun options for "It's ___! Get ___!" depending on player settings, or different responses depending on whether a certain quest item is in the player's possession)
- Summoning an ally, shield, etc. that's only supposed to happen once per fight
- A different opening attack that isn't repeated again (good for characters with very limited ammo like throwing axes or whatnot)
- A flying monster launching itself into the air if it's on the ground
Something equivalent for when a monster loses/defeats its target and goes into spawn/idle would be great too.
Workarounds I'm trying to avoid include:
- constantly comparing the monster's current and immediately preceding target (can be done as a last resort)
- inserting all this stuff into the spawn/idle/see states of each monster (there are quite a few so it gets unmaintainable quickly compared to having them all inherit from another monster)