Wildcards

Jack_Cade
26 May 2011, 20:30
Hi again!

I've had a search around the help file for wildcards, and then a search on the forums. Found an old thread where you seemed to be saying that you can achieve a wildcard effect in a roundabout way:

"if you put as the description as "it's a big red car" and call it "big red car"... then you *should* put in the "alt" bit of the object; "car,big red car, red car, big car" ... my car won't work because you haven't said it's your car.."

I'm afraid I'm being a bit thick and can't follow the meaning here. What I was looking to do was simply create a wide range of things the player can type in that aren't necessarily related to moving around or manipulating objects, and elicit a response from an NPC. As an example, I wanted to cater for the puerile player who tests the limits of the game by typing in lewd suggestions, and have a curt or dismissive response come up. So I would want the Command to cover a range of swear words and phrases in different orders. Is this possible?

Thanks again! Sorry if this is something I should have worked out myself - I *am* using the tutorial and help file to work my way around the program, and it does look like an excellent and flexible piece of software.

Alex
27 May 2011, 08:35
You can probably set up some commands to handle this. For example, if you set up a command called "screw #text#" then it will handle "screw" followed by anything. You can use the string handling functions such as $instr$ to see if #text# contains other text.

Pertex
27 May 2011, 08:48
Or you can add a script "Before each turn" in the Advanced-tab of Game. With such a script you can check the complete input of the player.

Alex
27 May 2011, 09:17
Ah yes, even better!

Jack_Cade
12 Jun 2011, 22:28
Thanks, guys!