Change font size
It is currently Sat May 25, 2013 7:04 am

Forum rules


Image



Post a new topicPost a reply Page 2 of 2   [ 19 posts ]
Go to page Previous  1, 2
Author Message
 Post subject: Re: NPCs-help please
PostPosted: Fri Jun 01, 2012 12:06 pm 
Furious Typer

Joined: Mon Apr 25, 2011 6:48 pm
Posts: 70
Haven't seen that script in a while.

The script Cam just so excellently explained is the same script that launched my NPC project, posted here.

Cam and Odd, please take a peek and provide feedback as well.


Top
 Profile  
 
 Post subject: Re: NPCs-help please
PostPosted: Fri Jun 01, 2012 2:48 pm 
OSG Elite

Joined: Wed Aug 05, 2009 1:59 am
Posts: 417
Shad MOrdre wrote:
Haven't seen that script in a while.

The script Cam just so excellently explained is the same script that launched my NPC project, posted here.

Cam and Odd, please take a peek and provide feedback as well.


I took a very brief peek earlier, need to find out how all the scripts work and stuff. I'll give more feedback (and questions) later on that post :)


Top
 Profile  
 
 Post subject: Re: NPCs-help please
PostPosted: Fri Jun 01, 2012 3:47 pm 
Furious Typer
User avatar

Joined: Mon Aug 10, 2009 11:53 pm
Posts: 171
I'm going to have to write a new script. I still see it used in all kinds of things to this day, and even my way of 'timing' the pathing of NPCs seems to be hanging around a lot I notice and I'm sure there is probably a better way to do that as well.

For now - please note that there are new functions available that did not exist at the time. Such as Animations, Sit/Unsit, Sensor flags, and so much more - dedicated NPC functions that exclude the need to 'hack' control them using regular avatar overrides, etc.

I just now am getting back to my projects after many months of being gone and am amazed at all the progress with the NPC functions.

I will do my best to write up a nice new 'all in one' utility box with up to date functions and explanations over the weekend. Until then I'm glad everyone has carried on enough interest to not just make new scripts and projects, but generate the enthusiasm for the devs to keep touching up and making additions to the NPC portion of OSSL!!!

Take care all,
- Hap

_________________
Sorry, I was just thinking upon the immortal words of Socrates who said ... "I drank what?? ... "
- Real Genius


Top
 Profile  
 
 Post subject: Re: NPCs-help please
PostPosted: Fri Jun 01, 2012 7:09 pm 
Furious Typer
User avatar

Joined: Fri Aug 19, 2011 7:10 pm
Posts: 144
Location: Oldham, UK
I was going to get started on a complex action movement script for NPCs based on my own "intelligent" NPC, but there seem to be a few people at work on similar concepts. I'm beginning to wonder whether or not a collaborative effort based on agreed functionality may not be the better way.

I'm thinking of an "out of the tin" script, notecard driven to simplify configuration, that will allow for:

osNpcMove (Fly or NoFly)
osNpcSit
osNpcCreate

Just for starters. Intermediate osNpc functions can be handled within the script without the end user having to worry about them. Notecard functions would be defined by, for example:

Move:
Fly/NoFly
x=
y=
z-

Sit:
UUID=

Etc etc. This simplifies control for none scripters whilst giving them options to fully utilise NPCs. I'd be happy to collaborate on this, if others think it would be useful.

_________________
50's sim based at Rumbled on OSGrid
happily running on Arch Linux for 1 year +


Top
 Profile  
 
 Post subject: Re: NPCs-help please
PostPosted: Fri Jun 01, 2012 11:31 pm 
Furious Typer

Joined: Mon Apr 25, 2011 6:48 pm
Posts: 70
Roken,

I must admit, a previous post of yours and a few others about creating RPG capable NPCs, and my own interests with AI and robotics provide motivation for my scripts. Please take a look and provide feedback.

I've already integrated what you've mentioned via notecard defined Actions, which are alot like Gestures, but much more capable. I broke out each of the major osNpc functions into separate scripts to give the NPC a more asynchronous behavior. In the previously posted scripts, with everything handled in the same script, I noticed that programming anything either needed to be written for each possible scenario. In my scripts, animations can be driven separately from movement, the bot can move, animate, talk, play sounds, all "simultaneously", instead of waiting for a function to complete, or reinventing the wheel for each case.

(NOTE: Need to credit Haplo and Cam for their scripts)

When using Haplos move script, the bot was essentially stuck in that code until it completed, and the bot could not play an animation until the move function was complete. Now, a command is issued to the move module, and while that script controls movement, the NPC can simultaneously play animations, chat, use sensors, and even play sounds, while walking.

Sitting is handled as one of the aforementioned 'Actions'. Just supply the UUID in the Action card, and the NPC can play that action. Actions are dependent on Locations, also predefined, as it made more sense that an NPC would commit some action at a particular location than to have a bot try to sit while in transit, or where there are no sit_targets.

An NPCs fly/no fly is preconfigured also, by setting a value in the config notecard. Values 1 - 5 define walk, fly/land, fly/ no land, and two additional random values, walk/fly/land and walk/fly/no land.

I've certainly tried to make the system extendable and hope the code is readable, even without comments. I am MORE than willing to work as a team to make this more powerful, as the many ideas that I have will take time. Some of the features I want to integrate include: NPCs issuing commands to other NPCs; ProgramO AIML (LindenAIML is sooo limited); mechanisms for hunger, sleep, and other time based functions; the ability to change running variables; adding script update features; adding a Modules feature to allow custom scripts to be uploaded to a running NPC; an ability to allow the NPC to change appearance, without resetting the NPC; and so much more. These things were accounted for as I've coded, and there are already in place, some functionality for some of this.

As I've mentioned in another post, I'd like to maybe work on osNpcTouch. Justincc already gave me pointers where to look in the code, I just need to pull away from this code long enough to code/test/deug the other.

Again, please take a look at what I've written and let's get this going. I'm sure that many on OSGRID would appreciate what's available. I don't have a hosted region and my laptop doesn't have the oomph for the grid, but once a more complete system is in place, it would be nice to have a ready made package available in world on OSGRID.

Shad MOrdre


Top
 Profile  
 
 Post subject: Re: NPCs-help please
PostPosted: Sun Jun 03, 2012 7:35 am 

Joined: Thu May 31, 2012 10:56 am
Posts: 15
All I have to say is WOW! Cam thank you so much for your detailed post. Now I can play around on my standalone while learning to script. I am moving along faster than I thought I would with my standalone. I am very thankful for this venue to ask questions and seek answers. Thank You Adele, Shad and Cam for your guidance, and everyone else for all thier imaginative work.


Top
 Profile  
 
 Post subject: Re: NPCs-help please
PostPosted: Sun Jun 03, 2012 9:06 am 
OSG Elite
User avatar

Joined: Sat Jun 14, 2008 12:28 am
Posts: 360
Location: Australia
You're very welcome,

I have just edited a couple of mistakes after re-reading, the first one was I had used the wrong curly brace in the explanation, I showed the opening brace "{" instead of the closing brace "}" fixed now.
and I had left the llGetPos()+ in the last piece of code I showed, it would still work but the av would fly 25 meters up, and the example was to show absolute positions not more relative positions.
Mapping means you want your bot to follow precise paths, absolute positions provide this precision.

Relative paths would be used in a dynamic sense, where the bot's movement might be governed by several different scripts and the relative distances can be varied on the fly according to varying conditions, suddenly the scripting gets intricate.


Top
 Profile  
 
 Post subject: Re: NPCs-help please
PostPosted: Sun Jun 03, 2012 3:17 pm 

Joined: Thu May 31, 2012 10:56 am
Posts: 15
All,

I seem to be having a communication issue. I get no results on channel 10 or any other channel I have designated in the script. Is there a setting in .ini file I may missed.

Thanks

Ok, the MYRIAD RPG scripts work -- I can type "/5 drawboth" or "/5 safetyon" and I am looking at Shad's Neurotronic brain, and I was able to make it through step 7 on the instructions. However, I am not able to perform step 8, channel 12 & 13 appear not to function for me either on my standalone. See Steps:

7. Create another prim and place the lslCloneAppearance script into the prim. Attach the Brain to yourself and then chat the command 'clone firstname lastname'
on channel 66. An appearance notecard will be created in the prim. You will use this notecard later.

8. Create seperate prims for the LocationCreator and Location Marker scripts, and add those scripts to the respective prims. Once you've created the
LocationMarker object, make copies of the Marker and place them where you will want your NPC to walk. Give each Marker a seperate name, and in the
description for each Marker, add the names of other Markers that connect to it in a comma separated list. DO NOT link the prims. When this is
complete, you can chat to the LocationCreator object on channel 13. It will display its available commands to SET, WRITE, and RESET the Markers.
The LocationCreator script create two notecards, locations and routes. Hang on to these.


So I tried attaching the prim with the script Cam provided and still no joy.

Thanks

Update: Not sure what I did wrong, I started over from scratch with Cam's instructions and it works now. Still working the locator/marker issue.


Top
 Profile  
 
 Post subject: Re: NPCs-help please
PostPosted: Sun Jun 03, 2012 4:48 pm 
Furious Typer

Joined: Mon Apr 25, 2011 6:48 pm
Posts: 70
Zadock,

I use Imprudence Viewer, which gives me a little box next to chat to specify a custom channel. What viewer are you using?

For the LocationCreator/Marker scripts, you only need worry about channel 13. The Creator script communicates with the Marker script(s) via channel 12. Make sure that EACH Marker prim has a unique name, and then, select the prim(s) and go to the Tools menu and Reset Scripts in Selection. If you created and named the prim and dropped in the script before you copied the Marker, each marker most likely has the same name/description. I've noticed in my sim, when copying an existing Marker, that I've had to change the name and reset the script before anything registered.

You can also open either script, and change the channel(s) as well, just choose a channel that is not in use. You can change the Marker script to use a negative channel number, just update the Creator script to reflect this. The Creator script should probably continue using a positive channel number.

NOTE: You will need to place the UUID of the Action, AIML, Location, Racter, and Routes notecards in the Data card, and the Controller script will need to be updated with the Config and Data notecard UUIDs. Not sure if I put those instructions in, I'll check and update if necessary.

Thanks for the feedback. Keep plugging away, and it'll come together for you.

Shad MOrdre


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 2 of 2   [ 19 posts ]
Go to page Previous  1, 2


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
610nm Style by Daniel St. Jules of Gamexe.net