- Joined
- Sep 25, 2016
- Messages
- 32
- Reaction score
- 37
- First Language
- English
- Primarily Uses
So far I've been solo developing a simulator game and came to the point where I'd use help. I would like to have a plugin that would allow players to chat with an npc via text input. Here I've recorded my game play showing how I see plugin in action:
Here on this gif "Player Types" keyboard input is just a '"show picture" and "show text" event command, but I want it to be a real player's input, where they can type anything they want and after plugin analyzes some keywords, it would return a pre-scripted text message.
This is what I imagine the plugin would work like: upon activating an event, it calls a keyboard input window, that is similar to Keyboard Input Dialog by biud436.
This plugin lets players type their message and then stores that message as a string variable. That plugin would be perfect for a keyboard input part, except I do want it to run on the same map where event is located (like when you open RpgMaker's Menu, it transfers you from your map), so it's real time and so there's no lag when loading back to my large map.
Let's say we have our message stored in a variable 1 already, and need to find words that match to deliver according output. I am not a coder, but here is my clumsy explanation:
var var1 = 'Do you like apples?'
if (var1.includes ('?' && 'you' && 'like')
{if (var1.includes ( 'apples' || 'aples' || 'appels' || 'apple' || 'aple') { console.log('I actually hate apples!');
else if (var1.includes ('tomatoes' || 'tomatos' || 'tomatoe' || 'tomatoes') { console.log('Tomatoes are my favorite!'); }
else if (var1.includes ('Daniel' || 'Rick') { console.log('*Blushes* ...he is a nice guy...'); }
else {console.log('Probaby...')} }
/* As you can see I'm comparing our string to some keywords using "if and else" statement. I'm sure there is more intelligent solution to this, especially when trying to deal with typos and words that have similar meaning (perhaps using arrays is the way, idk), but that is where you, coder, come in. */
I don't want you to pre-script my full list of dialogue options - a couple of dialogues would suffice. Then I will do the rest - add all the dialogues I want using your base code as an example.
Let me know if you have any questions regarding this and if you're interested - please give me the quote.
You will also be credited for this in my game, of course.
I look forward to making this happen!
Here on this gif "Player Types" keyboard input is just a '"show picture" and "show text" event command, but I want it to be a real player's input, where they can type anything they want and after plugin analyzes some keywords, it would return a pre-scripted text message.
This is what I imagine the plugin would work like: upon activating an event, it calls a keyboard input window, that is similar to Keyboard Input Dialog by biud436.
Let's say we have our message stored in a variable 1 already, and need to find words that match to deliver according output. I am not a coder, but here is my clumsy explanation:
var var1 = 'Do you like apples?'
if (var1.includes ('?' && 'you' && 'like')
{if (var1.includes ( 'apples' || 'aples' || 'appels' || 'apple' || 'aple') { console.log('I actually hate apples!');
else if (var1.includes ('tomatoes' || 'tomatos' || 'tomatoe' || 'tomatoes') { console.log('Tomatoes are my favorite!'); }
else if (var1.includes ('Daniel' || 'Rick') { console.log('*Blushes* ...he is a nice guy...'); }
else {console.log('Probaby...')} }
/* As you can see I'm comparing our string to some keywords using "if and else" statement. I'm sure there is more intelligent solution to this, especially when trying to deal with typos and words that have similar meaning (perhaps using arrays is the way, idk), but that is where you, coder, come in. */
I don't want you to pre-script my full list of dialogue options - a couple of dialogues would suffice. Then I will do the rest - add all the dialogues I want using your base code as an example.
Let me know if you have any questions regarding this and if you're interested - please give me the quote.
You will also be credited for this in my game, of course.
I look forward to making this happen!
Last edited:

