- crashdown 11m
- FancyPenguin 14m
- MrJDucky2 21m
- Baron17 0s
- Grey0 51m
- Stelpher 1m
- Ryuzaki4Days 2h Shoot your ace in the face.
j Johnny 2h New Code Written Nightly. Not a GM.
- coconut 29m Partially inactive during summer.
- himble 57m youtu.be/og243Dom4Sw
- attaboy 11s
- jsmith225 7h
a Cerberus 2h Head Builder & GM when I need to
- Dorn 25s https://www.youtube.com/watch?v=7OUqUiZQxs4
- Chrissl1983 8m working on my @history for too long...
- Azelle 2h
And 17 more hiding and/or disguised
Connect to Sindome @ moo.sindome.org:5555 or just Play Now

NPC Responses in scripts
Hookie turns to you and says, "Say what?"

After a brief battle with some basic code design problems which lead me to write and rewrite a very complex and important piece of code, I was able to quickly and easily (using 12 lines of code I might add) make the following addition:

On $npc_centric_script:

waitfor OBJ who, STR speach type, STR response variable
�<who> is who you want to wait for a response from
�<speach type> is the 'response type' you want to wait for. Presently only "speach" is supported.
�<response variable> is the variable to hold what the response was.
�This causes the NPC to wait for <who> to say something to them, and puts what they said in the variable <response variable>. It returns 1 if it got a response within 2 minuits, else 0.

Why is this useful you ask?

Let's give an example.

Your NPC says something to the player, then needs to wait for a response from them. Depending on what the player says, (assuming he says anything at all) the NPC might do different things.

So Let's just do a basic script with this example.

uses $npc_centric_script

say "Say something."
if waitfor %player "speach" "response"
�say "You said: " %response
�if match %response "fuck" or match %response "shit"
� �say "Hey man, that's a dirty word."
�say "I didn't hear you say anything."

We can call this the 'polly parrot' script because it makes the NPC say something, then repeats what the player says, and potentially makes a comment about it. In the case where the player dosn't say anything in 2 minuits or less, the NPC says "I didn't hear you say anything." after the 2 minuits are up.

Yes, 2 minuits is easily adjusted. No, we don't have a way to set it but were thinking there should be one.

Questions, comments, screams of agony, and other cries for help go below.



As an aside: In embarking in the journey that was writing all the complex underlying code necessary to make something like this possible, and even simple, (and changing a few existing things in the process) I was make very aware of the following interesting bit of trivia:

The average person dosn't like 'big' words. I define big words as ones that are not commonly used in every day usage like 'Transient' and 'Mutually Exclusive'. They see or hear them and are daunted by them. They cry out 'You use big words, and I don't understand!', yet they are english words with dictionary definitions. They even go as far in their fear of these words as to accuse the user of the words of having a 'superiority complex', which is ironic because 'superiority complex' are big words. They ignore their context, and their provided definition. They can't see past the number of letters and through to the meaning.

To these people I offer my appologies. My intention was not to confuse you, but to enlighten you. I use big words because we have a rich language which supports complex concepts such as 'Transient' when refering to something that is on the move, temporary, or fleeting, or 'Mutually exclusive' when refering to two conditions which cannot co-exist. I provide definitions of these words there with their usage so that you need not look further than the words after the word you don't understand in the hopes to allow you to easily follow.

If I had a superiority complex, I would not bother to do these things. I would say, "Bah, your all dumb. Figgure it out your damn self." and just use big words to spite you. But that's not the case.

Instead I'll use another big word: Ignorant.
Because we all are. You, me, and everyone else in this world, there's all things we don't know; that were ignorant about. But we learn. We grow. Don't be afraid of doing it.

(Edited by Kevlar at 3:01 am on Oct. 30, 2002)

That's sort of insulting. Because I was drunk, stoned, and bored, when you started to explain the concept of Mutex(MUTually EXclusive locks) - I couldn't really keep up with you and the 6 other people I was aim-ing with. (btw, you never really said what they were mutually exclusive for, ie: users, code, rooms, connections) But please, feel free to fire away with all the technical wisdom you may provide, so I may - in a more sober state - absorb it and potentially use it in the future. :)

(Edited by Hunter at 12:35 pm on Oct. 30, 2002)

Hunter: Not you man. You were very gracious in your requesting me to explain, and certianly never accused me of having a superiority complex.

(Edited by Kevlar at 11:29 am on Oct. 30, 2002)