<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Dahlia, your scenario seems appropriate
for this. The module would hook on one of the movement events that
scene generates.<br>
<br>
I'm glad to see Melanie making these real events; it will make the
LSL code look a little nicer. But independent of the syntax, it's
good to know what events people would like to get in their
scripts. I did those two in the example because I needed them.
I'll be happy to add more. The module is here:<br>
<a class="moz-txt-link-freetext" href="https://github.com/diva/diva-distribution/blob/master/addon-modules/Modules/ScriptEventsModule.cs">https://github.com/diva/diva-distribution/blob/master/addon-modules/Modules/ScriptEventsModule.cs</a><br>
<br>
Diva<br>
<br>
<br>
On 11/18/2012 6:48 PM, Dahlia Trimble wrote:<br>
</div>
<blockquote
cite="mid:CAAQTD4X-+yAZEt8kNhRmhi9YgS=8JXvUnUEZJXvuVTs2q4Qs+Q@mail.gmail.com"
type="cite">Hi Diva,
<div><br>
</div>
<div>With pathfinding, a NPC has to navigate between virtual
"waypoints" along a path to reach a goal. Currently I have a
region module that can be queried by scripts and will generate a
path that a NPC should be able to follow, then the NPC
controller script checks the position of the NPC every 0.5
seconds and makes a decision if a waypoint has been reached or
passed and which direction to travel in to reach the next
waypoint. One problem I have is that the NPCs don't have a
"at_target" event and that the 0.5 second default minimum timer
interval is really too long to wait. Another issue is knowing
when a NPC has reached a waypoint; it's possible that something
may have influenced the NPC's direction and position while
travelling to a waypoint and it has deviated from the straight
path that was assumed when the path was generated. This becomes
especially difficult when navigating around narrow areas with
tight corners and many potential obstructions. Ideally I'd like
the NPCs to be controlled by scripts but if I could generate
events from a region module that the script could process, then
the region module could use more complex logic to determine how
well a path is being followed and if any corrections are
necessary. I've not researched how such events can be passed to
a script yet, but if you think this may be a potential
application for your event system, I'd like to look into it
further and maybe try a few ideas.</div>
<div><br>
</div>
<div>-dahlia<br>
<div><br>
<div class="gmail_quote">On Sun, Nov 18, 2012 at 5:28 PM, Diva
Canto <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:diva@metaverseink.com" target="_blank">diva@metaverseink.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I am working on a module that passes interesting scene
events up to the scripts in a manner that's very easy to
act upon. An example is attached at the end of this
message.<br>
<br>
Question: What other events would people like to grab? The
idea is to have the module do all the complicated logic,
and pass only simple facts to the scripts.<br>
<br>
<br>
state_entry()<br>
{<br>
llSay(0, "Script running");<br>
modSendCommand("Script Events",
"subscribe|AvatarArrived", llGetKey());<br>
modSendCommand("Script Events",
"subscribe|LastAvatarLeft", llGetKey());<br>
}<br>
<br>
link_message(integer sender_num, integer num, string
message, key id)<br>
{<br>
list parts = llParseString2List(message, ["|"],
[]);<br>
if (llGetListLength(parts) >= 2) {<br>
if (llList2String(parts, 1) ==
"AvatarArrived") {<br>
// message is: event|AvatarArrived|True or
False <-- LocalTeleport or HG Teleport<br>
if (llGetListLength(parts) >= 3) {<br>
if (llList2String(parts, 2) == "True")
{<br>
llInstantMessage(id, "Welcome to
the Gateway! Choose your destination by walking into one
of the teleporters.");<br>
llRegionSay(region_channel, "ports
foreign");<br>
} else {<br>
llInstantMessage(id, "Welcome to
the Virtual Lab's Gateway! Choose your local destination
by walking into one of the teleporters.");<br>
llRegionSay(region_channel, "ports
local");<br>
}<br>
} else {<br>
llSay(0, "Malformed message " +
message + " " + (string)llGetListLength(parts));<br>
}<br>
play_music();<br>
} else if (llList2String(parts, 1) ==
"LastAvatarLeft") {<br>
// message is: event|LastAvatarLeft<br>
llRegionSay(region_channel, "ports
reset");<br>
}<br>
}<br>
}<br>
<br>
_______________________________________________<br>
Opensim-dev mailing list<br>
<a moz-do-not-send="true"
href="mailto:Opensim-dev@lists.berlios.de"
target="_blank">Opensim-dev@lists.berlios.de</a><br>
<a moz-do-not-send="true"
href="https://lists.berlios.de/mailman/listinfo/opensim-dev"
target="_blank">https://lists.berlios.de/mailman/listinfo/opensim-dev</a><br>
</blockquote>
</div>
<br>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Opensim-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Opensim-dev@lists.berlios.de">Opensim-dev@lists.berlios.de</a>
<a class="moz-txt-link-freetext" href="https://lists.berlios.de/mailman/listinfo/opensim-dev">https://lists.berlios.de/mailman/listinfo/opensim-dev</a></pre>
</blockquote>
<br>
</body>
</html>