Thursday, 24 March 2011

So this is Haplo's last word on where the 0.7.2 code is at

Ok sure... so the hair deal is this:

The code as you sent it to me, allows a 'blank' NPC to be created and
respond to Say and Remove commands. It retains the correct first and
lastname information from the osNpcCreate call and carries a unique
UUID. Using the for loop to create 10 NPCs and a list of their UUIDs
(or keys) each one retains name and unique ID and can be commanded to
Say and Remove respectively.

Notes: Depending on viewer - these NPCs will either be nothing but a
puffy cloud, or the 'witch king' (which is basically Hippo, Second
Life first gen viewer, and some viewers versions of a failed AV load.
It is what all settings to '0' would look like on hair - with no body
present. It looks like a grey Helm of the Witch King floating in space
lol)

Now then - if you change this:
ACD.AgentID = p_cloneAppearanceFrom; //npcAvatar.getAgentId();

Then for some reason any viewer will load a default hair floating in
space for every NPC. It is textured, colored, and loads in completion.
No body, skin, etc. Just friggin hair by itself. It does not make any
sense that assigning an entirely different ID would only make this
small of a difference (rather than just make or entirely break it?
Escpecially since the NPC still obeys all working commands)


p_scene: Ok so this will look really shitty in an email - but paste it
into a code editor and it will make better sense. I commented out
things, leaving them in place so I knew where to just 'crop' them back
in later.

As you can see below I hacked out the fact checking on the scene
presence in an attempt to force the current code to kick in. If I
leave it back in it's original 'IF' check, the function never fires
according to the debug message. Obviously the way I have it here - it
always fires without fail since I am forcing it to do so.



p_scene.AddNewClient(npcAvatar);

ScenePresence sp;
//if (
p_scene.TryGetScenePresence(p_cloneAppearanceFrom, out sp); //)
//{
AvatarAppearance x =
GetAppearance(p_cloneAppearanceFrom, p_scene);
m_log.Debug("[TryGetScenePrescence]: Function
Has Fired"); // Debug

sp.SetAppearance(x.Texture,
(byte[])x.VisualParams.Clone());
//}

m_avatars.Add(npcAvatar.AgentId, npcAvatar);

p_returnUuid = npcAvatar.AgentId;


Also if you want to have console logging enabled - you need the
following at the top of your file: using log4net; This will output
debug messages into your console window. Nice to have when you run the
osNPC* commands you can flip to your console and see what the hell is
going on ;)

ANYway ... so that is where I am at. Flat busted. Really none of the
changes I have made ended up taking me anywhere but back to your
original code you sent me. I also tried creating a user, then taking
that user, folder and asset ID information and hard coding it into
what I thought would be the appropriate slots for the information we
weren't sure we needed. Results were the same - still worked fine, but
no 'physical' appearance. Just a floaty name in space. So I am
probably not coding it in properly or something is missing entirely.

Also, I don't know if it matters or not but just in case - there is
definitely an actual 'ghost-presence' being created. You can bump into
and knock around the NPC even though it is just a point in space - so
the capsule is there.

No comments:

Post a Comment