Author Topic: Problems with my first NPC  (Read 2501 times)

Offline crucis

  • Planewalker
  • *****
  • Posts: 20
Problems with my first NPC
« on: December 09, 2004, 06:28:20 PM »
Hello all,

This is my first post on this board.  I'm trying to create a simple little NPC and I'm having a problem.

I've created this NPC thus far using Ghreyfain's Beginner's guide over in the Tutorials section.  I've written some simple dialogs, created the CRE, and written/compiled the necessary ARxxxx.BCS script extension needed to spawn the NPC.  My TP2 file compiled the entire thing (apparantly) OK.

Before I continue, let me provide a little bit of info.  I have a fairly clean install of SoA, TOB, the official TOP patch.  The only mod I have installed is DungeonBeGone, so that I could (duh) get out of the dungeon quickly and test the my NPC mod.

Furthermore, I started a new game after installing the new NPC, just to be on the safe side.

OK, now to the problem.  I have my NPC (a CG female elven swashbuckler) designed to spawn inside the Copper Coronet, fairly close to the front door, near where Yoshimo appears.  HOWEVER, when I try to enter the C.C., the game hangs when after it apparantly completes loading the new area.

What's going on here?  Is this a symptom of a looping condition in the game?

This is the contents of the BAF file that I appended to the AR0406.BCS file using the EXTEND_BOTTOM.

IF Global("NyaExists","AR0406",0)
THEN
    RESPONSE #100
    SetGlobal("NyaExists","AR0406",1)   
    CreateCreature("Nya",[1168.1722],7)
END

I actually used NearInfinity to compile the BAF file into a BCS file.  However, either way, after the hangs, I've used NI to check the state of the "extended" AR0406.BCS file and my Nya spawning IF statement isn't there.  The WeiDU debug file indicates that it performed the extension and the AR0406.BCS has been moved to the override folder after installing the mod.  But the file somehow isn't getting the additional stuff added.  Odd.

Any thoughts, suggestions, etc.?

Thanks in advance.



Offline jcompton

  • Niche Exploiter
  • Administrator
  • Planewalker
  • *****
  • Posts: 7246
Re: Problems with my first NPC
« Reply #1 on: December 09, 2004, 06:54:37 PM »
Two notes:

Generally, you want to EXTEND_TOP area scripts because some area scripts have bits at the bottom that tend to run always, or frequently, which makes it hard to "reach" your code.

Crashing on entering an area like that typically means that you're referencing an illegal filename, or a broken file. Your CRE might have some unexpectedly goofy characteristics, particularly if you used an editor to equip it with items. Try remaking the CRE and keeping its item allocation VERY basic, and double-check the filename.

As for the mystery of the code not being there... are you sure you're checking the AR0406.bcs that's actually IN override and not looking at the version in the BIFF? Infinity Explorer, Near Infinity and probably some other tools can be told to ignore what's in override. You might be doing that. Drag-and-drop into NI's Open File interface to be sure.
Cespenar says, "Kelsey and friends be at the Pocket Plane? Ohhh yesssss!" http://www.pocketplane.net

Offline crucis

  • Planewalker
  • *****
  • Posts: 20
Re: Problems with my first NPC
« Reply #2 on: December 09, 2004, 07:06:17 PM »
1. I've tried using both EXTEND_TOP and BOTTOM with the same results.

2. The game isn't really "crashing" so much as it's hanging.

3. I created the character using BG2 itself, via a multiplayer game.  I added a very small amount of equipment (2 +1 short swords, and a set of +1 studded leather armor) just using the normal internal cheat codes.  I also increased her XP up enough to make her a level 10 swashy, via the cheat codes.

I only used NI to convert the CHA file to a CRE file, then made the changes suggested in Ghreyfain's NPC tutorial.

4. I'll check out the suggestion in the final pragraph.


Offline jcompton

  • Niche Exploiter
  • Administrator
  • Planewalker
  • *****
  • Posts: 7246
Re: Problems with my first NPC
« Reply #3 on: December 09, 2004, 07:36:18 PM »
This is the portion of the proceedings where you post your TP2 and DEBUG file. :)
Cespenar says, "Kelsey and friends be at the Pocket Plane? Ohhh yesssss!" http://www.pocketplane.net

Offline crucis

  • Planewalker
  • *****
  • Posts: 20
Re: Problems with my first NPC
« Reply #4 on: December 09, 2004, 07:50:45 PM »
Actually, JC, I think that the problem is in the CRE file.  Here's my reasoning.

I commented out the EXTEND_TOP code in the TP2 file so that the auto-spawning IF statement was left out of the AR0406 file.  Then I re-installed the mod and started BG2 and loaded up my save game imediately before entering the Copper Corrnet.  This time, I was able to properly enter the CC.  But when I tried to use the cheat console to create Nya, the game hung up again. 

Getting closer.


Anyways, as requested, here's the TP2 file.  The commented out EXTEND lines were obviously not commented out when I was actually trying to include the auto-spawning stuff.

The debug file's already been overwritten.  But I don't think that there was anything in there of value. 


=========

*** TP2 file ***


BACKUP ~Nya\backup~
AUTHOR ~fburton@starfire.mv.com~
BEGIN ~Nya the NPC for BG2:ToB~

// The following is the copying of Nya's .cre file. 
COPY ~Nya\Nya.cre~ ~override\Nya.cre~
SAY NAME1 ~Nya~
SAY NAME2 ~Nya Arenthel~
//ADD_GAME_NPC "Nya" "ar0406" #1168 #1722

// The following is telling WeiDU to compile the following .d files
COMPILE ~Nya\nya.d~
USING ~Nya\american\nya.tra~

COMPILE ~Nya\nyap.d~
USING ~Nya\american\nyap.tra~


// Copy portrait files
COPY ~Nya/Nya5S.bmp~  ~override/Nya5S.bmp~
     ~Nya/Nya5M.bmp~  ~override/Nya5M.bmp~
     ~Nya/Nya5L.bmp~  ~override/Nya5L.bmp~


// The following is compiling the script and placing it in the override.  We haven't actually made a script yet, though, so this isn't necessary.
// COMPILE ~Nya\Nya.baf~
// USING ~Nya\%s\
//COMPILE ~Nya/nAR0406.baf~
//USING ~~

// The following is appending what we wrote in AR0406.bcs to the bottom of
// AR0406.bcs
// EXTEND_BOTTOM ~ar0406.bcs~ ~Nya\ar0406nya.bcs~
// EXTEND_TOP ~ar0406.bcs~ ~Nya\ar0406nya.bcs~



APPEND ~pdialog.2da~
~NYA NYAP NYAJ NYAD NYA25P NYA25J NYA25D NYAD25~
UNLESS ~NYA~

APPEND ~interdia.2da~
~NYA NYAB NYAB25~
UNLESS ~NYA~

Offline crucis

  • Planewalker
  • *****
  • Posts: 20
Re: Problems with my first NPC
« Reply #5 on: December 11, 2004, 08:45:34 AM »
Update:

I've done a few things since my last post.

1. I've downloaded DLTCEP.  (Interesting tool.)  I checked out my CRE file with this tool and it indicated that there were some bizarre problems in my inventory.  The 4 items that I'd added (3 via cheat codes) were not recognized properly and were not showing up in the slots properly.  This seems incredibly bizarre to me.  Why wouldn't the "official" CLUAConsole tool within the game properly create items within its characters?  Bizarre.

2. And I've created another character within a new multiplayer game.  However this time, I added nothing to the character.  I exported the character as soon as I gained control of the screen, instead of adding items and XP (via cheat codes).  I then checked out the new character in DTLCEP and she was much cleaner.  All of the inventory slots were showing up as properly empty.

3. So, next, I adjusted some of the necessary script fields so that I could try to load her into the game.  Then I went into BG2 and loaded up my test game and entered the Copper Coronet.  Then I tried to use CLUAConsole to load this new character and BINGO!  The new character appeared properly without hanging the game!

There's still work to do, but this is definitely progress.

 8)

Offline jcompton

  • Niche Exploiter
  • Administrator
  • Planewalker
  • *****
  • Posts: 7246
Re: Problems with my first NPC
« Reply #6 on: December 11, 2004, 10:58:51 AM »
Glad to hear it.

I also wish I knew what you were doing that kept locking your own thread. :)
Cespenar says, "Kelsey and friends be at the Pocket Plane? Ohhh yesssss!" http://www.pocketplane.net

Offline Rastor

  • Planewalker
  • *****
  • Posts: 271
  • Author of the book, "Being a Jerk for Dummies"
    • RPG Dungeon
Re: Problems with my first NPC
« Reply #7 on: December 11, 2004, 01:43:36 PM »
Quote
Why wouldn't the "official" CLUAConsole tool within the game properly create items within its characters?  Bizarre.

It does.  If you would have used DLTCEP to convert the .chr file to a .cre, then the file would work just fine.  I've never heard of NI screwing up the conversion though.

Quote
//ADD_GAME_NPC "Nya" "ar0406" #1168 #1722

For the record, don't use ADD_GAME_NPC to put an NPC into BG2.  That's for BG1.

Offline crucis

  • Planewalker
  • *****
  • Posts: 20
Re: Problems with my first NPC
« Reply #8 on: December 11, 2004, 02:16:31 PM »
Quote
Why wouldn't the "official" CLUAConsole tool within the game properly create items within its characters?  Bizarre.

It does.  If you would have used DLTCEP to convert the .chr file to a .cre, then the file would work just fine.  I've never heard of NI screwing up the conversion though.

Quote
//ADD_GAME_NPC "Nya" "ar0406" #1168 #1722

For the record, don't use ADD_GAME_NPC to put an NPC into BG2.  That's for BG1.

Yes, I learned that yesterday when I reread thru the weiDU manual.  ;)


 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: