Support for making talking creatures

So, based on earlier discussions, I decided to try modding in humans. I used the parrot flag that is usually only used on Mi’go to allow them to speak. Since the humans I modded in were meant to be psychotics, it made sense that they were saying random gibberish, but a few lines were kinda off and it wouldn’t work for more complicated humans like rogue army soldiers or dangerous criminals. So, I think there should be an option to have choose what your monster says. You’d find the dialog json file, put in a new entry with the new lines, then put the name of the entry in a part of the monster’s entry.

Another thing could tags for individual lines that make sure they are only said in specific situations. This would prevent enemies from saying lines that don’t fit the context or behaving oddly (Like having no real reaction to their friends dying, or saying “Time to die, motherfucker!” when they haven’t spotted the player), which would be handy.

What do you guys think?

I support this. It also would be quite awesome having the zombies moaning around while walking, or wolfs howling during the night, right before attacking you.

I slurped the existing dialog-handling stuff* into speech.cpp, and added a field to allow differntiating speakers, an entry looks like this now:

{
    "type" : "speech",
    "speaker" : "migo",
    "sound" : "\"Hello?\"",
    "volume" : 10
},
{
    "type" : "speech",
    "speaker" : "creepy_doll",
    "sound" : "Do you really need that much honey?",
    "volume" : 10
}

It’d be pretty easy to add some optional fields for mood or similar.
If we want to do it with more monsters, we probably want to dedicate a speech flag to it that matches the “speaker” field I added, that way you can add everything you need in json. I can see a mod with zombies walking around saying random crap being really funny, just not for the main game :wink:

*Completely independent of this request, heh.

Well, for zombies, I think it’d be just random moans and groans. Of course, this’d actually be a great way to introduce idle actions as well, but that’s another topic.

You’d also need to make sure monsters know who’s making the sound, otherwise they’ll be attracted to their own moans.

Kevin - there should probably be a way to control FREQUENCY of speaking too, through the JSONs. Not sure the best way to add that though.

Also, I’m totally adding a Christian Bale monster once this gets in. “What don’t you fucking understand?”

Seems like frequency would be tied to the monster, not the text.
I’m not sure if anything more sophisticated than, “randomly spout phrases from this list” can be handled automatically from json, but I’d love to be proven wrong.

Make the child zombies all sing ring around the rosie next halloween.

[quote=“Kevin Granade, post:7, topic:4073”]Seems like frequency would be tied to the monster, not the text.
I’m not sure if anything more sophisticated than, “randomly spout phrases from this list” can be handled automatically from json, but I’d love to be proven wrong.[/quote]
Why not have it so that every phrase is tied to a flag? You’d only need a few for various situations that would crop up a lot, like the monster being injured or just idling without having noticed the player.

[quote=“Kevin Granade, post:7, topic:4073”]Seems like frequency would be tied to the monster, not the text.
I’m not sure if anything more sophisticated than, “randomly spout phrases from this list” can be handled automatically from json, but I’d love to be proven wrong.[/quote]
I do agree that it should be defined as part of the monster, I’m just saying it’s worth at least figuring out a way to define it as part of the monster.

Since I’ll be doing the next stage of the monster rewrite this week, I could easily stick an optional “dialogue frequency” variable in if you want to use it.

We could stand to have a little structure, maybe have a speech section with parameters.

{
    "type" : "monster",
    "id" : "migo",
    ...
    "speech" : { "phrase_list" : "migo", "frequency" : 100 }
}

Yeah, that’s the sort of thing I was thinking of. It looks good to me, doing it like that instead of using the flags system.

Agreed, something like that seems like it would work rather nicely. :slight_smile: