On Thu, Oct 13, 2011 at 3:00 PM, Ai Austin <span dir="ltr"><<a href="mailto:ai.ai.austin@gmail.com">ai.ai.austin@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
I am wanting to have a set of NPCs as assistants set up with MyCyberTwin chat capabilities and left in I-Rooms to assist users.  Rather than simple 3D people like objects.  But of course they all need to be set back up after server restart.<br>
<br></blockquote><div><br></div>This is fairly simple to script if you're controlling your NPC from an unattached object. When you create the NPC, you'll first want to store the UUID you're given somewhere persistent, like a notecard or the description field of the object running your NPC script. If your NPC script resets, it will be able to retrieve your NPCs UUID and continue merrily on its way.</div>
<div class="gmail_quote"><br></div><div class="gmail_quote">Next you'll want to set up a timer that periodically checks to see whether your NPC's UUID is still valid. If llKey2Name(UUID) returns your NPC's name, everything is fine. If it returns an empty string, you can reasonably assume that the NPC's body isn't present, and recreate it with a new UUID.</div>
<div class="gmail_quote"><br></div><div class="gmail_quote">This method has allowed NPCs to automatically recreate themselves after a sim restart on my OSGrid simulator for about two weeks now.</div><div class="gmail_quote">
<br></div><div class="gmail_quote">Marcus</div>