can someone tell what to add to this?
mob/verb/shout(msg as text)
set category = "Commands"
if(usr.drunk == 0)
world << "[usr]: [msg]"
else
/*what do i put here to scramble the letters?*/
if there is a way please tell.
ID:154424
Sep 30 2001, 9:53 am
|
|
SonVegitto wrote:
can someone tell what to add to this? Well, I haven't worked too much with strings in BYOND yet, but if you can access the characters directly as in a list, then it should be possible to do this: for(var/i=1,i<=length(msg),++i) Failing that, this should work: for(var/i=1,i<=length(msg),++i) Now of course, that will scramble indiscriminately, switching around capital letters and lowercase, spaces and punctuation, etc. The result will be quite chaotic. Lummox JR |
In response to Lummox JR
|
|
thank you
|
In response to SonVegitto
|
|
Now you can make drunk people.
|
In response to Lummox JR
|
|
Well, I haven't worked too much with strings in BYOND yet, but if you can access the characters directly as in a list, then it should be possible to do this: I don't think that's been implemented yet. Fortunately, you can still use copytext() to find any given letter, and you can use my replace_text() proc that I've included in s_admin as a good inspiration about how to replace a particular section of a string. |
In response to Lord of Water
|
|
Whats the point of making a pub, if there arent nifty end results? :-D
|
At the same time, you dont want for the same words to be slurred each time. You need a substitution list.
Pick a bunch of words (50?) and misspell them the way that a drunk would pronounce them, and add them to a list. Make a list with the correct spellings as well. Put the words in the same order in both lists. These words should be central to the plot of your game.
Next take the text that is spoken and compare it to the correct spelling list. Get the index number of a word in its list, and use it to find the incorrect spelling. substitute the slurred word for the correct one and output it to the listener. The drunk var could be used to determine the number of word substitutions.