Author Topic: Having trouble with Pathways in NPC Activities 6.2  (Read 346 times)

Legacy_QlippothVI

  • Full Member
  • ***
  • Posts: 197
  • Karma: +0/-0
Having trouble with Pathways in NPC Activities 6.2
« on: January 01, 2014, 06:06:06 am »


               Hey all! (Happy New Year!) ':wizard:'

I'm wondering if anyone can help me. I'm creating a demo and example module using PK Busby's additions to Deva Winblood's NPC Activities (Effectivley NPC Activities 6.2). There are only a couple of us using this system so far, but I'd like to complete a simple demonstration module to clear up how to use the system and see if more people might be interested.


Intro: The Pathways feature allows a builder to define complex navigation around obstacles and difficult terrain so that AI creatures can efficiently and easily move around the module. To say, navigate a maze or walk around a dense set of placeable objects in an area.
You can also designate certain paths to be blocked and set a gate or pathway that allows passage so you can define a stream or river for Pathway using creatures. Townspeople don't slog across the muddy stream, they use the bridge. Deer do cross the river, they don't care about bridges.
This system is not required to be used for movement, there are still the old NPC Activities methods of waypoints, etc, nor does this system affect pathing for creatures in combat.


My demo module: http://neverwinterva...and-some-battle
Topic about other details at: http://neverwinterva...ies-62-pathways

The issue is that unless a creature has the vTag initialized in each area they will not correctly follow the Pathway I have created. I have only two areas in the module:
  • Dwarf creature is spawned in the NPC Activities test area.
  • Dwarf creature follows Pathways as expected to end of Pathway in NPC Activities test area.
  • Dwarf creature moves through transition to Stonegate area.Dwarf creature ignores Pathway in new area.
  • Dwarf creature receives new vTag, causing the Dwarf creature to correctly use the Pathway in the Stonegate area to walk back to transition back to the NPC Activities test area.
The opposite is true for Duergar, they walk the Pathway in their home area then fail to use the pathway in the NPC Activities test area. This means that Pathways aren't used properly unless the vTag is changed in the new area? Bug, user error? Some code isn't being used once the new area is entered and Pathways is set up in that area.


I am presuming two things, A: that a newly spawned creature is having their vTag initialized and use the code to start using the Pathway, and B: changing the vTag in the new area causes this initialization to happen again for the area in which the creature resides.

I've checked the waypoints, and I've checked the usePathways area variables and everything is set up correctly.
Currently the only workaround is to create some waypoints that change tghe vTag of the creature, but that kind of negates the ease with which a builder can set up a Pathway for better pathing in a tough area. Can someone look at the script and see where I might change the script to correct this issue? Or tell me it's user error?
If you look at the actingFenora module in nwvauilt, or download my demo module from the link above I believe the script is "npcact_h_moving" around line 393 where the Pathways code starts. It is possible the error is outside furtherdown in Deva's code, since he didn't develope Pathways and did not plan for such a thing, though it could be a bug in his code as well.


 - Qlippoth
               
               

               


                     Modifié par QlippothVI, 01 janvier 2014 - 06:21 .
                     
                  


            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
Having trouble with Pathways in NPC Activities 6.2
« Reply #1 on: January 01, 2014, 03:24:39 pm »


               I'm not that familiar with that system although I did play around with it at one point. I found it a little slow at each decision point, but it was nice to have people walking on the roadways...

From your description it sounds like maybe you don't have  X2_SWITCH_CROSSAREA_WALKWAYPOINTS set and that the code using pathways is respecting that flag.

Edit: Nevermind... I just check my old version of this which I had lying around, no mention of X2_SWITCH_CROSSAREA_WALKWAYPOINTS in the scripts.  If memory serves there was something in the documentation specific to area transitions. 

Have you tried it with the debug turned on? 

You might be able to find where the set vtag code is and have your area on enter do the same re-init.



Cheers,
meaglyn
               
               

               


                     Modifié par meaglyn, 01 janvier 2014 - 06:55 .
                     
                  


            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
Having trouble with Pathways in NPC Activities 6.2
« Reply #2 on: January 01, 2014, 07:04:07 pm »


               There's also this setting which appears to be a variable on the NPC which could effect you if set:

// nGNBCloseMode - 0 = Waypoints anywhere in the module, 1 = near waypoints only
               
               

               
            

Legacy_QlippothVI

  • Full Member
  • ***
  • Posts: 197
  • Karma: +0/-0
Having trouble with Pathways in NPC Activities 6.2
« Reply #3 on: January 02, 2014, 01:42:40 am »


               Thanks so much for the quick reply, I'll explore those items and report back! I'm really close to getting this demo module out.


Re: Re-init - That was my thought, but I've only taken intro to Java, so my programming experience and knowledge is quite limited. Time to experiment! 

- Qlippoth ':wizard:'
               
               

               


                     Modifié par QlippothVI, 02 janvier 2014 - 02:05 .
                     
                  


            

Legacy_QlippothVI

  • Full Member
  • ***
  • Posts: 197
  • Karma: +0/-0
Having trouble with Pathways in NPC Activities 6.2
« Reply #4 on: January 02, 2014, 04:11:07 am »


               Ok, the first option, setting nGNBCloseMode = 0 or 1 didn't change any behavior. I guess I'll take a stab or two at the script and see if I can initialize the Pathways code on entering an area.

- Qlippoth
               
               

               
            

Legacy_ruadhri10

  • Jr. Member
  • **
  • Posts: 52
  • Karma: +0/-0
Having trouble with Pathways in NPC Activities 6.2
« Reply #5 on: January 03, 2014, 06:15:34 am »


               Hey Qlippoth, I'm working on a module using NPC Activities at the moment, will investigate your Pathways between areas but I have a few other bugs with integrating into my module to sort out first.

P.S. kudos for maintaining npcact, it is full of win but I'm yet to make use of its full power yet
               
               

               


                     Modifié par ruadhri10, 03 janvier 2014 - 06:15 .
                     
                  


            

Legacy_QlippothVI

  • Full Member
  • ***
  • Posts: 197
  • Karma: +0/-0
Having trouble with Pathways in NPC Activities 6.2
« Reply #6 on: January 03, 2014, 08:02:05 pm »


               Are you using the scripts from PK Busby's actingFenora? That code has the Pathways addons and a some NPC Activities fixes.

I'm not so much "Maintaining" as I am "proselytizing" the system. I still need to refine and better document my example once I can get past this inter-area issue. I might be able to fix a few things as I find bugs, but so far it looks pretty good. I haven't used any scripting or libraries aside from Pathways. so many others have done that already. I'll be doing more in another module once I complete a working Demo.

The point of Pathways is to do all of the heavy lifting ahead of time, then just tell the creature to go to a particular waypoint, the system gets them there without needing to plot breadcrumbs throughout the module for each creature. It's also a lot less strain on the CPU than plotting the path for the whole journey at once for each creature. With Pathways I guess you're placing the breadcrumbs ahead of time, but they can be used by every creature.
My second script confusion is figuring out how to interrupt their current orders to give them a new destination. right now I think I'm not clearing the creatures settings, so they continue on to their last ordered destination regardless of my script in convo telling them otherwise. Once they get to the destination I can change their orders.

I'd be happy to hear about any NPC Act issues you are having. No promises that I can figure them out, but I'm open to helping if I can. Sometimes you just need a second pair of eyes.

- Qlippoth
               
               

               


                     Modifié par QlippothVI, 03 janvier 2014 - 08:05 .
                     
                  


            

Legacy_ruadhri10

  • Jr. Member
  • **
  • Posts: 52
  • Karma: +0/-0
Having trouble with Pathways in NPC Activities 6.2
« Reply #7 on: January 09, 2014, 03:30:41 am »


               Thanks QlippothVI , and its a great system!

Pathways sounds like it will save a lot of work adding "breadcrumbs" for new NPCs added :-)  I want to get into it after I have Professions up and running first, so much lifelike behavior already scripted by you guys, but had a TMI issue - see my new thread posted.