Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualsmr

Posted 02 January 2013 - 04:59 PM

Here's how I store conversations a little Javascript RPG I was working on. It gets the job done, but it doesn't address your triggers issue:

 

{
    'start': {
        'text': "Hello! How are you today?",		
        'responses': [
            { 'text': 'Awesome!', 'next': 'great' },
            { 'text': 'None of your business!', 'next': 'rude' }
        ]
    },
    'great': {
        'text': 'That's great! I'll be going now!', 'next': 'end' }
    },
    'rude': {
        'text': 'I was just trying to be friendly. No reason to be a douche about it.',
        'next': 'end',
        'callback': function (conversation, self, other) { 
            self.updateHostility(other, hostility.HOSTILE);
        }
    }
}

 

Each conversation has a 'start' screen, which is the first dialog screen that will be displayed. Each screen has a set of possible responses, with each response indicating the 'next' screen when that response is selected. Additionally each screen has an optional callback that is invoked when the screen is shown. You may not have the ability to integrate scripts within your dialog definitions, but you could accomplish similar functionality without them:

 

'signal': 'set hostility hostile',

#5smr

Posted 02 January 2013 - 04:58 PM

Here's how I store conversations a little Javascript RPG I was working on. It gets the job done, but it doesn't address your triggers issue:

 

{
    'start': {
        'text': "Hello! How are you today?",		
        'responses': [
            { 'text': 'Awesome!', 'next': 'great' },
            { 'text': 'None of your business!', 'next': 'rude' }
        ]
    },
    'great': {
        'text': 'That's great! I'll be going now!', 'next': 'end' }
    },
    'rude': {
        'text': 'I was just trying to be friendly. No reason to be a douche about it.',
        'next': 'end',
        'callback': function (conversation, sourceEntity, targetEntity) { 
            targetEntity.updateHostility(sourceEntity, hostility.HOSTILE);
        }
    }
}

 

Each conversation has a 'start' screen, which is the first dialog screen that will be displayed. Each screen has a set of possible responses, with each response indicating the 'next' screen when that response is selected. Additionally each screen has an optional callback that is invoked when the screen is shown. You may not have the ability to integrate scripts within your dialog definitions, but you could accomplish similar functionality without them:

 

'signal': 'set hostility hostile',

#4smr

Posted 02 January 2013 - 04:53 PM

Here's how I store conversations a little Javascript RPG I was working on. It gets the job done, but it doesn't address your triggers issue:

 

{
    'start': {
        'text': "Hello! How are you today?",		
        'responses': [
            { 'text': 'Awesome!', 'next': 'great' },
            { 'text': 'None of your business!', 'next': 'rude' }
        ]
    },
    'great': {
        'text': 'That's great! I'll be going now!', 'next': 'end' }
    },
    'rude': {
        'text': 'I was just trying to be friendly. No reason to be a douche about it.',
        'next': 'end',
        'callback': function (conversation, sourceEntity, targetEntity) { 
            targetEntity.target(sourceEntity);
            targetEntity.updateHostility(sourceEntity, hostility.HOSTILE);
        }
    }
}

 

Each conversation has a 'start' screen, which is the first dialog screen that will be displayed. Each screen has a set of possible responses, with each response indicating the 'next' screen when that response is selected. Additionally each screen has an optional callback that is invoked when the screen is shown. You may not have the ability to integrate scripts within your dialog definitions, but you could accomplish similar functionality without them:

 

'signal': 'set hostility hostile',

#3smr

Posted 02 January 2013 - 04:53 PM

Here's how I store conversations a little Javascript RPG I was working on. It gets the job done, but it doesn't address your triggers issue:

 

{
    'start': {
        'text': "Hello! How are you today?",		
        'responses': [
            { 'text': 'Awesome!', 'next': 'great' },
            { 'text': 'None of your business!', 'next': 'rude' }
        ]
    },
    'great': {
        'text': 'That's great! I'll be going now!', 'next': 'end' }
    },
    'rude': {
        'text': 'I was just trying to be friendly. No reason to be a douche about it.',
        'next': 'end',
        'callback': function (conversation, sourceEntity, targetEntity) { 
            targetEntity.target(sourceEntity);
            targetEntity.updateHostility(sourceEntity, hostility.HOSTILE);
        }
    }
}

 

Each conversation has a 'start' screen, which is the first dialog screen that will be displayed. Each screen has a set of possible responses, with each response indicating the 'next' screen when that response is selected. Additionally each screen has an optional callback that is invoked when the screen is shown. You may not have the ability to integrate scripts within your dialogs, but you could accomplish similar functionality without them:

 

'signal': 'set hostility hostile',

#2smr

Posted 02 January 2013 - 04:50 PM

Here's how I store conversations a little Javascript RPG I was working on. It gets the job done, but it doesn't address your triggers issue:

 

{
    'start': {
        'text': "Hello! How are you today?",		
        'responses': [
            { 'text': 'Awesome!', 'next': 'great' },
            { 'text': 'None of your business!', 'next': 'rude' }
        ]
    },
    'great': {
        'text': 'That's great! I'll be going now!', 'next': 'end' }
    },
    'rude': {
        'text': 'I was just trying to be friendly. No reason to be a douche about it.',
        'next': 'end',
        'callback': function (conversation, sourceEntity, targetEntity) { 
            targetEntity.target(sourceEntity);
            targetEntity.updateHostility(sourceEntity, hostility.HOSTILE);
        }
    }
}

 

You may not have the ability to integrate scripts within your dialogs, but you could accomplish similar functionality without them:

 

'signal': 'set hostility hostile',

#1smr

Posted 02 January 2013 - 04:48 PM

Here's how I store conversations a little Javascript RPG I was working on. It gets the job done, but it doesn't address your triggers issue:

 

{
    'start': {
        'text': "Hello! How are you today?",		
        'responses': [
            { 'text': 'Awesome!', 'next': 'great' },
            { 'text': 'None of your business!', 'next': 'rude' }
        ]
    },
    'great': {
        'text': 'That's great! I'll be going now!', 'next': 'end' }
    },
    'rude': {
        'text': 'I was just trying to be friendly. No reason to be a douche about it.',
        'next': 'end',
        'callback': function (conversation, sourceEntity, targetEntity) { 
            targetEntity.target(sourceEntity);
            targetEntity.updateHostility(source, hostility.HOSTILE);
        }
    }
}

 

You may not have the ability to integrate scripts within your dialogs, but you could accomplish similar functionality without them:

 

'signal': 'set hostility hostile',

PARTNERS