Wednesday 4 May 2011

Server side AO on the bot

Additionally on the to-do list is a server side AO for the bot using a standard ZHAO notecard.
The plan is to create a fixed directory called aurora/bin/ao whereby each bot's AO animation list will be inside a notecard formatted in standard ZHAO format and called the name of the seeding avie used to seed the bot. i.e. a bot called "test bot" seeded from avie John Doe would have a notecard called JohnDoe.txt (for example) inside aurora/bin/ao.

This code is lower down the priority list in the to-do's but it's in there. Before I do this I'm going to finish the detect-spawn-follow-attack code which will also involve digging into the LSL collision or sensor stuff. The scripting engine seems to be a little flaky in that scripts sometimes don't work (I tried the collision code last night and it didn't work very well so as a backup I could write something into the botmanager code but I digress).

So returning to the Server side AO, we will need code to pick up directories and code to read files etc. Clues to that code should be in the following code snippet:

private void FindDefaultLSLScript()
{
if (!Directory.Exists(ScriptEnginesPath))
{
try
{
Directory.CreateDirectory(ScriptEnginesPath);
}
catch (Exception)
{
}
}
string Dir = Path.Combine(Path.Combine(Environment.CurrentDirectory, ScriptEnginesPath), "default.lsl");
if (File.Exists(Dir))
{
string defaultScript = File.ReadAllText(Dir);
foreach (Scene scene in m_Scenes)
{
ILLClientInventory inventoryModule = scene.RequestModuleInterface();
if (inventoryModule != null)
inventoryModule.DefaultLSLScript = defaultScript;
}
}
}

1 comment:

  1. So I got that code to work but ultimately I don't like it. Here's why: Although it works pretty successfully, it requires you to have access to folders on the machine where the aurora app is running. I ran smack into that as a restriction on Enrico's grid Nova. Since I didn't have access to the directory, I was unable to upload a ZHAOII card to there without involving Enrico. In the future on any large hosted install of Aurora with many paid for regions, the administrator could be over-run with requests to change ZHAO cards all the time. That's just a pain in the butt. So I decided to re-write so that you could use a notecard in the inventory of the template avatar from whom the appearance of the NPCs is copied. Since the template avatar should be one of your own avatars, you will obviously have access to it and could just log in with the template avatar and make the changes to the ZHAOII card there or add/create a new one whatever. That's a much easier way to do it.

    ReplyDelete