aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/NPC_tool_help.txt
diff options
context:
space:
mode:
authorDavid Walter Seikel2014-03-02 22:34:54 +1000
committerDavid Walter Seikel2014-03-02 22:34:54 +1000
commit9c9a333860debf85b403a79bd6ee93b4f6bc5ded (patch)
treea04fe89e2467782129dc6aba7b82d7e8cf57e97a /NPC_tool_help.txt
parentInitial commit (diff)
downloadNPC-tool-9c9a333860debf85b403a79bd6ee93b4f6bc5ded.zip
NPC-tool-9c9a333860debf85b403a79bd6ee93b4f6bc5ded.tar.gz
NPC-tool-9c9a333860debf85b403a79bd6ee93b4f6bc5ded.tar.bz2
NPC-tool-9c9a333860debf85b403a79bd6ee93b4f6bc5ded.tar.xz
Initial import of everything.
Diffstat (limited to 'NPC_tool_help.txt')
-rw-r--r--NPC_tool_help.txt171
1 files changed, 171 insertions, 0 deletions
diff --git a/NPC_tool_help.txt b/NPC_tool_help.txt
new file mode 100644
index 0000000..53eb5a3
--- /dev/null
+++ b/NPC_tool_help.txt
@@ -0,0 +1,171 @@
1NPC tool.
2-------------
3
4This notecard documents onefang's "NPC tool" script. It needs another script called "onefang's utilities" to also be inside the prim. You can also include the "NPC menu" script to get the menu system.
5
6NOTE - this is an early release, there's things that are likely to change, but apparently lots of people are asking for it. Open source, release early, release often.
7
8Menu system.
9--------------------
10
11When you click on the object with the NPC tool script, you get it's menus. In general that just calls the below listed commands, presenting menus for picking avatars, objects, NPCs, and note cards as needed. This menu includes the "Backup NPCs", "Restore NPCs", "start recrording", and "stop recording" options that are not available as commands.
12
13The "nearby NPCs" option lets you select from the NPCs that are close to you, "Local NPCs" to select from any within sensor range, and "NPCs in sim" selects from all the NPCs in the sim.
14
15As a safety feature, if the NPC tool script is in an NPC's attachments, the script gets deleted.
16
17
18Script and chat command system.
19-----------------------------------------------
20
21All of this is subject to change as the tool is still under development. In particular, I plan on changing the commands to be more conversational.
22
23The commands can be said in local chat, or put into notecards to script NPCs. Script notecards need to have ".npc" at the end of their name. In a script notecard, lines starting with # are ignored, and so are blank lines.
24
25In general, each command is followed by the name of the NPC, then any other arguments. The NPC in these examples is "onefang's clone". UUIDs can be used to.
26
27Any objects mentioned by name have to be close enough to the prim with the NPC tool script in it for a sensor() to find it. If there are multiple objects with the same name, the closest one is chosen.
28
29There are three special notecard scripts for the backup and restore system. "Restore.npc" is created or over written each time you do a backup from the menus. When doing a restore, first "Restore.before.npc" is run, then "Restore.npc", and finally "Restore.after.npc". Any of those scripts that are missing are skipped. A restore is done automatically 60 seconds after the sim restarts. Or more, depends on when the script itself starts running again.
30
31There is also the "Recorded.npc" notecard, it holds anything you recorded with the "start recording" menu option.
32
33You can send these commands from some other LSL script in the same object. Add something like this to your script -
34
35string LIST_SEP = "$!#"; // Used to seperate lists when sending them as strings.
36integer UTILITIES_CHAT_FAKE = -19;
37key NPCscriptKey = llGetInventoryKey("NPC tool");
38sendCommand(key user, string command)
39{
40 llMessageLinked(LINK_SET, UTILITIES_CHAT_FAKE, llDumpList2String([0, llKey2Name(user), user, command], LIST_SEP), NPCscriptKey);
41}
42
43
44Creation / deletion commands.
45 These commands mostly deal with avatar appearance notecards, which are XML formatted notecards with their names ending in ".avatar". These cards are in the format that the OpenSim appearance functions use.
46
47clone onefang rejected
48 Creates an appearance notecard of the named avatar. In this example, that will be "onefang rejected.avatar". Yes, you can clone NPCs as well.
49
50create onefang's clone <1.0,2.0,3.0>
51 Creates an NPC from the named notecard, "onefang's clone.avatar" for example, at the given position. The new NPC will be named after the card, "onefang's clone" in this case. The position is optional, in which case the NPC is created close to the prim holding the NPC tool script.
52
53change onefang's clone other avatar
54 Causes the named NPC to change to match the appearance notecard named, "other avatar.avatar" in this example.
55
56delete onefang's clone
57 Remove the named NPC.
58
59nuke
60 Remove all NPCs in the sim.
61
62
63Animation commands.
64 The animation has to be in the same prim as the NPC tool script. Multiple animations can be on an NPC at once, that's why there's start and stop commands.
65
66animate onefang's clone animation name
67 Start animating the named NPC using the named animation.
68
69stopanim onefang's clone animation name
70 Stop the named animation from animating the named NPC.
71
72
73Chatting commands.
74 The named NPC say, shouts, or whispers the rest of the text in the command. If the text is just a number between 1 and 11, then that sets the number as a chat channel for that NPC to relay chat from, either said, shouted, or whispered to match. Using 0 will turn off chat relay for that NPC. The relay channel will be displayed in the NPCs menu.
75
76say onefang's clone Stuff to say.
77shout onefang's clone Stuff to shout.
78whisper onefang's clone Stuff to whisper.
79
80
81Moving commands.
82 The go, fly, and land commands can have various ways of providing the destination. A vector position <1.0,2.0,3.0>, the name of an avatar or NPC, the name of an in world object, or a UUID of an avatar, in world object, or NPC. Note that's easily possible for a NPC to get stuck. They just don't understand navigating around a 3D world. If they get stuck, then they will get deleted and recreated at the destination.
83
84come onefang's clone
85 The NPC walks to the person using this command, or the person running the script via the menu system.
86
87complete onefang's clone
88 Wait for their movement to be completed. Only covers come, goto, flyto, and landat.
89
90go onefang's clone <1.0,2.0,3.0>
91 The NPC walks to the given destination.
92
93follow onefang's clone <-3.0, 0.0, 0.0>
94 Start to follow you at the (optional) distance.
95
96fly onefang's clone <1.0,2.0,3.0>
97 The NPC flies to the given destination, then remains hovering.
98
99land onefang's clone<1.0,2.0,3.0>
100 The NPC flies to the given destination, then lands.
101
102rotate onefang's clone 180
103 The NPC rotates to the given direction in degrees. Note that there seems to be an OpenSim bug, not getting the rotations I expect.
104
105stalk onefang's clone onefang rejected <-3.0, 0.0, 0.0>
106 Start to follow the given avatar or NPC at the (optional) distance.
107
108stop onefang's clone
109 Stops the NPC from moving to a destination.
110
111
112Scripting commands.
113
114link 1 2 Third thing to send.
115 Sends a link message "Third thing to send.", to link number 1, with num being 2. No key is sent, but that should be added later.
116
117listen 123
118 Changes the NPC tool to listen to commands from a different channel.
119
120script scriptcard.npc
121 Runs an NPC script. If you use this inside another script, that script will wait for this new script to finish running. Circular references to scripts is not a good idea, it will eventually run out of memory. Note that it is theoretically possible for scripts running from scripts to get a little confused when running the same script multiple times, but hopefully that's rare.
122
123sleep 10.0
124 Stops a script from running for the given number of seconds. Can be fractional seconds. Note that currently NPC tool only runs one command from the script every half a second.
125
126
127World interaction commands.
128 The objects named in these commands have to be scripted. Names and UUIDs can be used for the objects.
129
130locate onefang's clone
131 Hangs a giant red beacon above the head of the NPC, so you can see where they are. Clicking on the beacon opens up the map to their position, with the TP beacon set. Honestly, just use your viewers radar. Only one beacon allowed.
132
133sit onefang's clone object to sit on
134 The NPC sits on the named in world object.
135
136stand onefang's clone
137 The NPC stands up.
138
139touch onefang's clone object to touch
140 The NPC touches the named in world object. If the object does things to avatars that touch them, it will get triggered. Things like dance balls will get automatic permission to animate the NPC.
141
142
143
144Copyright (C) 2013 David Seikel (onefang rejected).
145
146Permission is hereby granted, free of charge, to any person obtaining a copy
147of this software and associated documentation files (the "Software"), to
148deal in the Software without restriction, including without limitation the
149rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
150sell copies of the Software, and to permit persons to whom the Software is
151furnished to do so, subject to the following conditions:
152
153The above copyright notice and this permission notice shall be included in
154all copies of the Software and its Copyright notices. In addition publicly
155documented acknowledgment must be given that this software has been used if no
156source code of this software is made available publicly. This includes
157acknowledgments in either Copyright notices, Manuals, Publicity and Marketing
158documents or any documentation provided with any product containing this
159software. This License does not apply to any software that links to the
160libraries provided by this software (statically or dynamically), but only to
161the software provided.
162
163Please see the COPYING-PLAIN for a plain-english explanation of this notice
164and it's intent.
165
166THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
167IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
168FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
169THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
170IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
171CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.