Designing a dialog system?

0 favourites
  • 1 posts
From the Asset Store
A collection of retro game sound effects made in classic style, including 111 sounds.
  • I'm trying to design a dialog system and I am thinking about the structure for the data. I want to make sure I can cover a wide array of possibilities, but I'm unsure if I'm on the right track.

    This is what I have currently in xml:

    <game>
    
    <layout id='layout 104'>
    	<interaction id='0' with='1'>
    		<condition prerequisites='none' disqualifiers='boughtFarm'>	
    			<speaker id='npc' pos='right'>Hello, welcome to the farm.\nThe place is a bit old.</speaker>
    			<go to='menu' value='0' />
    		</condition>
    		<condition prerequisites='boughtFarm' items='farmDeed'>
    			<speaker id='npc' pos='right'>Congratulations on your new- I mean, old farm.</speaker>
    			<event action='createcondition' value='welcomeFarm' />
    		</condition>
    	</interaction>
    	
    	<menu id='0'>
    		<item disqualifiers='dontMind' goto='1'>I don't mind.</item>
    		<item disqualifiers='howOld' goto='2'>How old is it?</item>
    		<item prerequisites='howOld' goto='3'>This place is too old.</item>
    		<item prerequisites='howOld' goto='4'>A place with some history can be interesting.</item>
    	</menu>	
    	<menu id='1'>
    		<item prerequisites='(money>=5000)' goto='5'>I would like to buy it.</item>
    		<item goto='6'>I'll think about it.</item>
    	</menu>
    	
    	<interaction id='1' with='1'>
    		<speaker id='player' pos='left'>I don't mind.</speaker>
    		<speaker id='npc' pos='right'>Great!\nWould you like to buy it?\nIt costs 5000 dollars.</speaker>
    		<event action='createcondition' value='dontMind' />
    		<go to='menu' value='1' />
    	</interaction>
    	
    	<interaction id='2' with='1'>
    		<speaker id='player' pos='left'>How old is it?</speaker>
    		<speaker id='npc' pos='right'>It's about 100 years old.</speaker>
    		<event action='createcondition' value='howOld' />
    		<go to='menu' value='0' />
    	</interaction>
    
    	<interaction id='3' with='1'>
    		<speaker id='player' pos='left'>This place is too old.</speaker>
    		<speaker id='npc' pos='right'>Yeah, it requires a lot of work.</speaker>
    	</interaction>
    	
    	<interaction id='4' with='1'>
    		<speaker id='player' pos='left'>A place with some history can be interesting.</speaker>
    		<speaker id='npc' pos='right'>Not much happened here.</speaker>
    	</interaction>
    	
    	<interaction id='5' with='1'>
    		<speaker id='player' pos='left'>I would like to buy it.</speaker>
    		<speaker id='npc' pos='right'>Okay, that will be 5000 dollars.</speaker>
    		<event action='giveMoney' value='5000' />
    		<speaker id='npc' pos='right'>Thanks! Here's the deed to the farm.</speaker>
    		<event action='getItem' value='farmDeed' />
    	</interaction>
    </layout>
    [/code:2p3dc7aq]
    Perhaps someone who has more insight into this sort of thing can lend me some tips/advice. I'm not sure if I like what I have.
  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)