Input text, output an action?

Get help using Construct 2

Post » Sat Dec 28, 2013 1:02 pm

Remember how old text based adventures, and early adventure games allowed you to type actions to get the player character to interact with the world?

I want to do something similar, although I just want to be pointed in the right direction, I'd like to figure out the detail by myself, but what functions should I be looking into?

E.g.

"What do you want to do to this barrel?"

Player types - Action

"Smash" - Player smashes barrel
"Climb" - Player climbs barrel
"Break" - Player breaks barrel (same as smash)
etc. etc.

I am guessing I will need a list of action "words" for each interactive instance, but I don't know how I would implement it - how can you make player input text and then have that text be checked against a list of words?
B
9
S
3
Posts: 151
Reputation: 1,749

Post » Sat Dec 28, 2013 1:37 pm

It is a Dialouge between Player with NPC?
Maybe you can do this,

NPCtext | Text is "What do you want to do to this Barrel?
-AnswerTextBox | Text is "Smash" -> The Action
-AnswerTextBox | Text is "Climb" -> The Action
-AnswerTextBox | Text is "Break" -> The Action

I hope you Understand :)

Creating games makes your imagination realized
B
14
S
4
G
1
Posts: 55
Reputation: 1,130

Post » Sat Dec 28, 2013 1:40 pm

Maybe this thread will help?

http://www.scirra.com/forum/efficient-text-parsing-for-textadventure_topic56478.html

The Wiki is a little thin on text parsing, but it may give you ideas:
http://en.wikipedia.org/wiki/Text_parser
B
239
S
62
G
33
Posts: 903
Reputation: 40,562

Post » Sat Dec 28, 2013 2:36 pm

Thanks! The mechanic in my game is like a really simple version of a text parser, in that I only want it to recognize words, kind of like how scribblenauts does, but with a far less ambitious dictionary.
B
9
S
3
Posts: 151
Reputation: 1,749


Return to How do I....?

Who is online

Users browsing this forum: Lordshiva1948 and 5 guests