osgrid.org
https://forums.osgrid.org/

Pointing your nose..
https://forums.osgrid.org/viewtopic.php?f=5&t=3493
Page 2 of 4

Author:  Haplo Voss [ Tue Aug 30, 2011 9:16 pm ]
Post subject:  Re: Pointing your nose..

just a note on the multiple avatars... once you have made an npc - you can just copy the notecard and then create another, and another.. each time creating a new notecard, making a copy of it in your inventory.

Then you can just rename them accordingly i.e. NPC1,2,3 or Female1,2, Male1,2 etc.

You can then place all of the notecards inside of the same prim, and call up whichever NPC you like using the same command. It will auto-assign a new UUID each time you spawn a new npc and you can just capture it for future use in your script.

An example would be a list sort of like the one I used for my sim stress test here:
{L_CODE}:
for (x = 0;x < 199; x++){
    destX = (integer) llFrand (60)-30; // Creates an area from +30 to -30 X coord around center
    destY = (integer) llFrand (60)-30; // Creates an area from +30 to -30 Y coord around center
    npc = osNpcCreate ("Luke", "Endemirror", llGetPos()+<destX, destY, 0>, "appearance");
    npcList += npc;
}


Of course not that you probably want to create an army of same named clones, but you get the idea :mrgreen:

Author:  Roken Price [ Tue Aug 30, 2011 9:52 pm ]
Post subject:  Re: Pointing your nose..

If you want all your NPCs to look the same, you can re-use the same notecard - you don't need multiple copies of it.

Author:  Void Pipe [ Wed Aug 31, 2011 2:06 am ]
Post subject:  Re: Pointing your nose..

Haplo, what is the name of the region where these experiments are taking place?

Author:  Haplo Voss [ Wed Aug 31, 2011 7:26 am ]
Post subject:  Re: Pointing your nose..

Roken Price {L_WROTE}:
If you want all your NPCs to look the same, you can re-use the same notecard - you don't need multiple copies of it.


I wan't implying you need multiple copies of a notecard for the same NPC - I was simply saying that for every NPC you make (individual notecard or not) you can just capture their key into a list or however you like so you can control multiple NPCs from the same script.

I just put that snippet in their to show how I had captured around 200 npcs into one list. They all used the same notecard obviously.

I was suggesting that since it generates a notecard for each NPC. You are able to put many different notecards inside of a prim that represent a different NPC for each. Then load any one of them anytime you need, or multiple at a time - without the need for a prim-per-npc.

Many people I've talked to are under the assumption it's one prim, one NPC. Just pointing it out was all. :)

Author:  Haplo Voss [ Wed Aug 31, 2011 7:28 am ]
Post subject:  Re: Pointing your nose..

Void Pipe {L_WROTE}:
Haplo, what is the name of the region where these experiments are taking place?


I have one setup called:

Haplhazard

Feel free to stop by anytime you like. Nothing special. Right now all I have out is the watchdog NPC like I posted above.

Author:  Roken Price [ Fri Sep 02, 2011 4:53 pm ]
Post subject:  Re: Pointing your nose..

I had cause to look at the script more closely, and in particular the test for how close (or how far) the target AV was from the NPC. This is more accurate, and as far as I can tell, doesn't give a performance hit:

Replace:

{L_CODE}:
if (llFabs(vecTo_targ.x - nPos.x) > 5 || llFabs(vecTo_targ.y - nPos.y) > 5) {


With:

{L_CODE}:
if (llFabs(llVecDist(vecTo_targ, nPos)) > 5) {

Author:  Roken Price [ Sat Sep 03, 2011 2:06 pm ]
Post subject:  Re: Pointing your nose..

OK, I've got this working now. If anyone wants to see the NPCs in action, pop along to Rumbled.

The two dancing NPCs and the bartender are just dumb NPCs, but Angela Bot is a little more interesting, having combined the modified watchdog script and a chatbot script, she will not only annoy you by following you, but if you talk to her (just talk in open chat) she will psychoanalyse you (because she gets her responses from Eliza).

I've restricted the watchdog script to within 30 meters, so if you are further away than that she will leave you alone, and chat works only within chat range (10m) of course.

NB. The sim will be down for 11 days from around Midday GMT on 6 September until 17 September, so avoid going during this period.

Author:  Adelle Fitzgerald [ Sun Sep 04, 2011 7:01 am ]
Post subject:  Re: Pointing your nose..

Hi Roken,

Have you gotten the avatar to face the correct direction when standing? If so can you please post the extract of the script that needs changing, or post your whole script.

Thanks!

Author:  Roken Price [ Sun Sep 04, 2011 7:04 am ]
Post subject:  Re: Pointing your nose..

Unfortunately not, yet. I did completely remove the rotation correction which does, in my case, produce a slightly more natural direction.

TBH it's not something I've looked at in any great detail yet, but I'll probably make it the next bit to look at. Once I nail it, I'll post.

Author:  Adelle Fitzgerald [ Sun Sep 04, 2011 12:02 pm ]
Post subject:  Re: Pointing your nose..

Hi Roken,

I took a look at your region with your NPC's running. It is cool seeing the bar tender etc as actual avatars, though the chat bot script seems to make no sense at all lol. Maybe I was asking the wrong questions? ;)

What kind of load on the sim are you getting with just those 4 NPC's? I'll probably be looking to run upto 20 at some point in the future on a project I'm working on, though I was considering using a sensor to rez/derez the NPC's only when needed i.e. when an actual avatar is within say 40 meters of where an NPC would be. A few of these would be 'tour guides' scripted to show visitors about the region. I have created a couple of (really rough) scripts to 'record' my main avatar's movements, then the NPC plays them back. I will be posting them when I have cleaned them up a bit.

Nice wotk with the NPC's though, Roken :)

Page 2 of 4 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/