RPG Dialogue Test
by Sam Fereday
JavaScript
/*
- Each actor will have a unique name that can be found in the conversational content.
- What you can do is 'pass' various conditions to said actor in order for it to respond in different ways.
- Each actor will have a set of things that it will say (this exists in the data).
- What they say depends on what you pass in to the arguments.
- So, prior to a door being open, you might pass in the current storyPosition id / index. This way the actor knows what state the world is in relating to what you've done. It might be that they don't say anything different, as the change might be tiny. But, if it finds a matching position id, it'll use that.
- The next issue is that, if that npc is also a quest giver, you'll need to factor that in also.
- Now, what you might want to do for this is to have another bit of data strapped in to the conversation data that considers quest-related data as well. So you might be able to pass it 'two' ids. One for the quest, one for the story. Then you can have another unique string to be said.
- Again, it might just be the case that they listen to the quest data on its own, and not care about the story.
- But, later on, if the right position in the story is hit, then you can just say that instead.
- Finally, when it comes to story driven events, such as conversation scenes (not the same as idle world banter or summaries), you can simply either create the npcs you need to be present, or, use the entity to trigger an event from within it.
- I might fair better just making this in to a nice plugin, as it's less arsing around with Constructs randomness.
// States in conversation must be saved, that's the name of the game here. It means that entities in the world feel aware of what's going on.
*/
// ryans ideas:
/*
[16/02/2016 11:24] Ryan Morrin:
well I have little experience with game development, so I am sure there are better ways but could you not just have a 'pool' of all possible things that an entity can say, then some conditional to...