Author Topic: NPC Activies 6.2 - my "barmaid" causes a TMI error :-(  (Read 358 times)

Legacy_ruadhri10

  • Jr. Member
  • **
  • Posts: 52
  • Karma: +0/-0
NPC Activies 6.2 - my "barmaid" causes a TMI error :-(
« on: January 09, 2014, 03:39:10 am »


               Hey guys, working on a module I've been tinkering with for a year or so. Read about the new v6.2 of NPC Activities, and decided to upgrade from 6.1 and use the newer more advanced features.

I had a shot at converting a waiter to use Profession - Barmaid. Keeping it very simple, default menu only, no custom speech strings.

The script TMIs as soon as a PC sits down ("Script npcact_p_barmaid OID:8000000136 Tag waiter TOO MANY INSTRUCTIONS"), and the waiter RandomWalks for a heartbeat or two then returns to his waiter waypoints.

The NPC waiter has nNpcWrap = 1 set (so only NPACT scripts running for simplicity's sake). He also has a virtual tag ("waiter"), which is working well - he leaves his own POST_<tag> and attends POST_waiter as intended, where his Profession "Barmaid" is triggered.

I copied the NPC Activities 6.2 scripts from the module here (http://nwvault.ign.c....Detail&id=6406), couldn't find a seperate ERF so copied the scripts (*.nss files) over to my mod, replacing the NPCACT 6.1 scripts I already had. All the previous NPCACT 6.1 work I did works just fine with 6.2. ':wizard:'

I didn't find anything in the logs regarding the TMI error. ':?'  Its the native Linux server, 1.69

Is there something obvious that might cause that / has caused that TMI before with barmaids, or should I start reading through the NPC Activities code to understand the whole thing? I'm not a real programmer, so it will take a while!

Has anyone else experienced a similiar error? What did you do to fix it?
               
               

               


                     Modifié par ruadhri10, 09 janvier 2014 - 05:06 .
                     
                  


            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
NPC Activies 6.2 - my "barmaid" causes a TMI error :-(
« Reply #1 on: January 09, 2014, 03:43:44 pm »


               There won't be anything in the logs (yet).  That script (npcact_p_barmaid.nss) only has one loop in it when not using custom menus. It's pretty ugly code actually. It only changes the loop conditions some of the time for example.

Looking at it now, I'm not seeing an obvious case where it would be an infinite loop but that's your most likely problem here.

In my copy of NPCACT6.2 it starts at line 109 of that file. You could add a log message inside the while loop that prints something out (like the validity of oCustomer and oObject). For extra credit you could put in a counter
that is incremented every time through the loop.  I assume  you haven't changed anything in there yet?

Cheers,
meaglyn
               
               

               
            

Legacy_ruadhri10

  • Jr. Member
  • **
  • Posts: 52
  • Karma: +0/-0
NPC Activies 6.2 - my "barmaid" causes a TMI error :-(
« Reply #2 on: January 10, 2014, 09:12:35 am »


               Thanks, meaglyn, investigating now...
               
               

               
            

Legacy_ruadhri10

  • Jr. Member
  • **
  • Posts: 52
  • Karma: +0/-0
NPC Activies 6.2 - my "barmaid" causes a TMI error :-(
« Reply #3 on: January 10, 2014, 03:26:50 pm »


               I've made some progress; commenting out "fDelay=fnNPCACTSitForSpecified("SITS-05"); // added action peak 5/10" removes the TMI errors.

Looking at fnNPCACTSitForSpecified, it calls NPCACTFindChair(), which recurses to every placeable within 10m.

The NPCs weren't finding my CEP stools (ZEP_STOOL001) at all; I would suggest a small change to npcact_h_core to improve the pattern matching.

if (TestStringAgainstPattern("(Chair|Couch|Stool|BenchPew|ThroneEvil|ThroneGood|InvisChair)",sTag)&&GetSittingCreature(oTest)==OBJECT_INVALID) oChair=oTest;

becomes

  if (TestStringAgainstPattern("(**CHAIR**|**COUCH**|**STOOL**|**BENCH**|**PEW**|**THRONE**)",GetStringUpperCase(sTag))&&GetSittingCreature(oTest)==OBJECT_INVALID) oChair=oTest;

which is a lot more robust and flexible. I'd also add "&& nC < NPCACT_MAX_SCAN" to the loop to prevent it going over NPCACT_MAX_SCAN recursions when called in areas with many placeables but few recognised chairs.

With that change, NPCs can find my chairs. But the waiter still TMIs, now after HE sits down :-/   Its late, I think I'll just comment out the "fDelay=fnNPCACTSitForSpecified("SITS-05"); " and call it a night - my waiter doesn't need to sit down on the job.

Thanks everyone!
               
               

               
            

Legacy_QlippothVI

  • Full Member
  • ***
  • Posts: 197
  • Karma: +0/-0
NPC Activies 6.2 - my "barmaid" causes a TMI error :-(
« Reply #4 on: January 20, 2014, 06:57:23 am »


               If you find bugs and can fix them, I have a Mantis bug base with an NPC Activities project for tracking such issues. Only a few things, mainly revolving around issues I'm having with pathways, ATM.

No one really maintaining this script set anymore, and I'm very new to programming. Would like to keep it going and release a package (6.2) once I get my Pathways demo working. With any fixes I can gather from the community.

- Qlippoth
               
               

               


                     Modifié par QlippothVI, 20 janvier 2014 - 06:58 .
                     
                  


            

Legacy_ruadhri10

  • Jr. Member
  • **
  • Posts: 52
  • Karma: +0/-0
NPC Activies 6.2 - my "barmaid" causes a TMI error :-(
« Reply #5 on: January 20, 2014, 12:01:11 pm »


               Happy to help if I can, Qlippoth! NPC Activities is a great package.

Where can I access your project page?
               
               

               
            

Legacy_QlippothVI

  • Full Member
  • ***
  • Posts: 197
  • Karma: +0/-0
NPC Activies 6.2 - my "barmaid" causes a TMI error :-(
« Reply #6 on: January 21, 2014, 06:14:40 am »


               Your signup email might go to junk mail, as I only have a dyndns domain name for that server: http://removed
Let me know when you sign up or I'll check then add you to the Project.

EDIT: I'm wondering if we can add a (spoken by NPC) statement if no placeables are found to alert the builder/tester to the code? "BUG: I can't find any place to sit! Check the Tags on your seating placeables!"

 - Qlippoth ':wizard:'
               
               

               


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