ID:149281
 
Ok, lemme see how to start...well, I need a bit of help with changing a string of characters. As the topic says, I want to make it so when someone says something like, "who r u?" it would appear as "who are you?" I just think that it could actually make it seem like players know the English language! I can show you all the code I have so far:

mob/verb/say(msg as text)

Helpful? No? Didn't think so. I guess I just need help with checking msg to see if it contains the character sequence, let say..." u ", for example. Then I need that to be changed to " you ". I think it's safe to say I don't know very well how I would do this.
Any help is appriciated.


- Joe, the guy who hasn't worked on a game in a long time.
The trick is that while() " u " or whatever is found in the message, copytext() the message so that it copies the portion before the word, and copies the portion after. Then set the text you want to replace the word with, which is " you " in this case, and stick that in the middle of a combined result that looks like this: "[before][replacement][after]".

Have fun building that. I would help you, but I might be infringing on one of Spuzzum's snippets :oP
In response to Foomer
Hrm, thanks. I have the general idea. Now it will just take some tinkering, but I'll get it.

Thanks again.

-Joe