Up until now you've always written scripts based upon the assumption that you have to start from scratch, and build up your script; creating, naming, describing and moving your rooms, npc, items, and forcing people to do things.
The point of Situtation-Centric Scripting is you can make assumptions about the 'context' in which the script is running, greatly reducing the ammount of work that accualy has to go into your script.
Let's start with an example:
Normally to make a NPC do something you'de have to create, or find the npc, and basically set him up. Well, there's accualy a way to run a script in the 'context' of a existing NPC doing something in response to a player. This is called an NPC-Centric Script. This allows us to basically do away with the work necessary to create or find the NPC, and force him to do things. We can simply assume that were running under the 'context' of a NPC, and use NPC specific commands like the following.
emote "eyes %N warrily."
to %player "Are you sure you really want to do this?"
to %player "Because if your not sure, you should walk away right now."
do "remove overcoat"
do "give overcoat to %N"
Now you'll notice that I've not specified WHO is doing this emoting, talking, and acting. Astute observers will also take note of the complete lack of pauses.
Yes, that's right ladies and gentlemen, no more pauses. You see, this is a NPC-Centric Script. It runs in the context of a NPC, so whichever NPC is running this script, he/she's the one who's doing these actions. %player is not the NPC. %player is the person who did something to cause this NPC to run this script. And example of this is they said a keyword, or handed them a package or something like that. If your wondering, the NPC is avablie in the script as %npc. But you probablly won't use that.
'But why no pauses!?' I'm sure your screaming by now. Well, I'll tell you.
All NPC centric commands are 'queued' for replay, and -AUTOMATICALLY- paused, based upon their lenght; That is to say: The longer the command, the longer the pause after they say it before they say the next thing.
Neat, huh?
'So it's really that easy?' Well, almost. There's one thing you have to do to make your script a NPC-Centric Script.
You have to make the FIRST LINE in your script:
uses $npc_centric_script
This tells the Scripting engine to use a different script runner than the default script runner. The $npc_centric_script defines ADDITIONAL commands which are NPC centric specific. So you get all the commands you have in a normal script, AND in addition, you get the NPC centric script commands. But as you can see, the NPC centric ones make alot of the normal commands unnecesssary.
In case your wondering, if you don't specify a 'uses' line as the first line, it's assumed you'll be using the $default_script runner. This is identical to having the first line in your script being:
uses $default_script
So in conclusion, you should be writing "NPC-Centric Scripts" when you have a existing NPC doing something in response to something, and "regular" scripts when your just doing general ambience spoofing or dreams or things like that.
So, here's the command reference:
say STRING message
<message> is the message you want the %npc to say
If %npc is not defined, an exception will be raised.
This uses $npc_centric_script:pronoun_sub, see its help.
Ex. say "I'm gonna keel you!"
to OBJ player, STRING message
<player> is the player to talked to directly
<message> is the message you want the %npc to say
If %npc is not defined, an exception will be raised.
This uses $npc_centric_script:pronoun_sub, see its help.
Ex. to %victim "I'm gonna keel you!"
do STRING action
<action> is the command you want the NPC to 'type'
If %npc is not defined, an exception will be raised.
This uses $npc_centric_script:pronoun_sub, see its help.
Ex. do "kill %N"
emote STRING action
<action> is the command you want the NPC to 'emote'
If %npc is not defined, an exception will be raised.
This uses $npc_centric_script:pronoun_sub, see its help.
Ex. emote "does a really long emote."
mumble STRING action
<action> is what you want the NPC to 'mumble'
If %npc is not defined, an exception will be raised.
This uses $npc_centric_script:pronoun_sub, see its help.
Ex. emote "does a really long emote."
whisper OBJ player, STRING action
<player> is the player to be whispered to
<action> is the command you want the NPC to 'whisper'
If %npc is not defined, an exception will be raised.
This uses $npc_centric_script:pronoun_sub, see its help.
Ex. whisper %victim "I'm gonna enjoy slicing you open and eating your liver!"
ooc STRING action
<action> is what you want the NPC to 'ooc'
If %npc is not defined, an exception will be raised.
This uses $npc_centric_script:pronoun_sub, see its help.
Ex. ooc "Quite with the OOC already!"
social STRING action
<action> is what you want social you want the NPC to do
If %npc is not defined, an exception will be raised.
This uses $npc_centric_script:pronoun_sub, see its help.
Ex. social "smile %N" would make him smile at %player
I'm sure there will be questions concerning this. Feel free to post, and bug me to try out your scripts.
-Kevlar