Author Topic: A Beginner's Guide to NPC creation with WeiDU  (Read 314212 times)

Offline dunk

  • Planewalker
  • *****
  • Posts: 15
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #50 on: August 06, 2005, 04:18:03 PM »
The following step is important.  Read it! - Ghreyfain, 07/30/05
Finally, a small change that many people forget, but which is responsible for numerous headaches.  Scroll to the top of your .cre file, and find the Flags field.  In a newly converted .cre file, the flag "Export allowed" is still checked.  Uncheck that.  Odd side-effects that could crop up include scripts and dialogues behaving like those of a multi-player NPC.  Not what we want at all.

I think although I'm not sure you may want to add this to this step:

The enemy-ally field should be changed to "Neutral - 128" as opposed to the default for a CHR file "PC - 2".

I had a problem with Vondo already having a green circle under him before he was in the party.  Then I changed this field and it was light blue like all the other people wandering around Athkatla.

I have added Vondo to my game and he is working nicely now.  Woo hoo!  I may just flesh him out and make a nifty little NPC out of him.  I have several others I'd like to make as well.
« Last Edit: August 06, 2005, 04:20:14 PM by dunk »

Offline discharger12

  • Truth?
  • Planewalker
  • *****
  • Posts: 625
  • Gender: Male
  • k
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #51 on: August 29, 2005, 09:11:25 PM »
I get the following message for my NPC:

WeiDU v 185 Log

 C:\Program Files\Black Isle\BGII - SoA\Setup-Tork.exe


** ERROR ** [SETUP-TORK.TP2] not found.
Make sure that you have unpacked the archive correctly and
that you are not trying to run this file from inside an archive.[./CHITIN.KEY] loaded, 590551 bytes
[./CHITIN.KEY] 182 BIFFs, 41793 resources
[dialog.tlk] loaded, 8692747 bytes
[dialog.tlk] 74107 string entries
[./Autorun.ini] loaded, 1452 bytes
[./baldur.ini] loaded, 3298 bytes
Possible HD/CD Path: [C:\Program Files\Black Isle\BGII - SoA\]
Possible HD/CD Path: [C:\Program Files\Black Isle\BGII - SoA\CD1\]
Possible HD/CD Path: [C:\Program Files\Black Isle\BGII - SoA\CD2\]
Possible HD/CD Path: [C:\Program Files\Black Isle\BGII - SoA\CD2\]
Possible HD/CD Path: [C:\Program Files\Black Isle\BGII - SoA\CD3\]
Possible HD/CD Path: [C:\Program Files\Black Isle\BGII - SoA\CD4\]
Possible HD/CD Path: [C:\Program Files\Black Isle\BGII - SoA\CD5\]
[./CharView.ini] loaded, 261 bytes
[./Keymap.ini] loaded, 5615 bytes
[./Mplaynow.ini] loaded, 230 bytes
[dialog.tlk] claims to be writeable.
[dialog.tlk] claims to be a regular file.

      WeiDU Timings
load TLK                         0.000
unmarshal KEY                    0.094
loading files                    0.109
unmarshal TLK                    0.328
TOTAL                            0.531


In my Folder, I have the following:

1) The Backup folder.

2) the .d file with

3) the initdlg.bcs

4) the .chre file.

Any other things I should supply for the answer to this solution will be put up without delay.

Thanks in advance.
« Last Edit: August 29, 2005, 09:14:47 PM by discharger12 »

Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #52 on: August 29, 2005, 09:15:57 PM »
Where is the .tp2 file?
Earn Money Sleeping.

Offline discharger12

  • Truth?
  • Planewalker
  • *****
  • Posts: 625
  • Gender: Male
  • k
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #53 on: August 29, 2005, 09:22:30 PM »
Oh, in the BG2 directory.

Okay, I realized that my folder options was hiding .txt on my tp2 file, but I now get this when I corrected it:

WeiDU v 185 Log

 C:\Program Files\Black Isle\BGII - SoA\Setup-Tork.exe
[./CHITIN.KEY] loaded, 590551 bytes
[./CHITIN.KEY] 182 BIFFs, 41793 resources
[dialog.tlk] loaded, 8692747 bytes
[dialog.tlk] 74107 string entries
[./Autorun.ini] loaded, 1452 bytes
[./baldur.ini] loaded, 3298 bytes
Possible HD/CD Path: [C:\Program Files\Black Isle\BGII - SoA\]
Possible HD/CD Path: [C:\Program Files\Black Isle\BGII - SoA\CD1\]
Possible HD/CD Path: [C:\Program Files\Black Isle\BGII - SoA\CD2\]
Possible HD/CD Path: [C:\Program Files\Black Isle\BGII - SoA\CD2\]
Possible HD/CD Path: [C:\Program Files\Black Isle\BGII - SoA\CD3\]
Possible HD/CD Path: [C:\Program Files\Black Isle\BGII - SoA\CD4\]
Possible HD/CD Path: [C:\Program Files\Black Isle\BGII - SoA\CD5\]
[./CharView.ini] loaded, 261 bytes
[./Keymap.ini] loaded, 5615 bytes
[./Mplaynow.ini] loaded, 230 bytes
[dialog.tlk] claims to be writeable.
[dialog.tlk] claims to be a regular file.
WARNING: parsing log [WeiDU.log]: Sys_error("WeiDU.log: No such file or directory")

[SETUP-TORK.TP2] PARSE ERROR at line 12 column 10-13
Near Text: this
   syntax error

[SETUP-TORK.TP2]  ERROR at line 12 column 10-13
Near Text: this
   Parsing.Parse_error
ERROR: parsing [SETUP-TORK.TP2]: Parsing.Parse_error
ERROR: problem parsing TP file [SETUP-TORK.TP2]: Parsing.Parse_error

FATAL ERROR: Parsing.Parse_error

      WeiDU Timings
parsing .tp2 files               0.000
load TLK                         0.000
loading files                    0.063
unmarshal KEY                    0.125
unmarshal TLK                    0.281
TOTAL                            0.469
« Last Edit: August 29, 2005, 09:47:17 PM by discharger12 »

Offline discharger12

  • Truth?
  • Planewalker
  • *****
  • Posts: 625
  • Gender: Male
  • k
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #54 on: August 29, 2005, 10:23:20 PM »
wrong post.
« Last Edit: August 30, 2005, 12:47:12 PM by discharger12 »

Offline Kismet

  • Devil's Minion #5
  • Global Moderator
  • Planewalker
  • *****
  • Posts: 653
  • Gender: Female
  • Veni; Vidi; Velcro.
    • Pocket Plane Group
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #55 on: August 30, 2005, 05:49:37 AM »
You have a transition to InquireIrenicus but you have no state called InquireIrenicus, so you either mislabeled one of your states or you forgot to put it in.
Cailean - An archer NPC for the insatiably nosy!  Guaranteed more fun than shampooing cats!

Offline discharger12

  • Truth?
  • Planewalker
  • *****
  • Posts: 625
  • Gender: Male
  • k
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #56 on: August 30, 2005, 09:58:39 AM »
Alright, everything works as far as this tutorial bit supplies. Thanks everyone.

« Last Edit: August 30, 2005, 12:49:46 PM by discharger12 »

LimboWoman

  • Guest
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #57 on: September 25, 2005, 11:11:29 PM »
gah! where do i get the latest NI beta?? I can't find it!

Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #58 on: September 25, 2005, 11:27:25 PM »
Here, in general:
Infinity Engine Modlist - Tools

And here, specifically:
Near Infinity
Earn Money Sleeping.

LimboWoman

  • Guest
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #59 on: September 25, 2005, 11:31:33 PM »
thanx

LimboWoman

  • Guest
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #60 on: September 28, 2005, 08:24:05 AM »
I know I'm a pain, but as soon as you start talking about the Death Variable I get stuck.  Maybe I need a tutorial on NI... could you direct me to one??

Offline Grim Squeaker

  • Fallen
  • Planewalker
  • *****
  • Posts: 1019
  • Gender: Male
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #61 on: September 28, 2005, 01:27:55 PM »
I know I'm a pain, but as soon as you start talking about the Death Variable I get stuck.  Maybe I need a tutorial on NI... could you direct me to one??

Basically, you open the NPC's .cre file with NI and scroll down the list of information til you find one bit labelled 'Death Variable'.
"You alone can make my song take flight..."

Offline cliffette

  • Timmins Tragic
  • Planewalker
  • *****
  • Posts: 547
  • Gender: Female
  • I still like Neighbours
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #62 on: September 29, 2005, 03:41:15 AM »
A Death Variable is basically a name that distinguishes your little creature from all the other creatures in a game. It tells the game who is who. This means that if you script in Kill("Edwin"), the game looks for the .cre file that has the Death Variable set to "Edwin" and kills it. Or you could have the script FaceObject("Edwin") and the character will turn to face the .cre file that has the Death Variable "Edwin".


Extremely dorky analogy
Another way to think about the Death Variable is as a name badge at a conference. The game is like a very short sighted terminator who can only recognise name badges. If you have a name badge with the name "Edwin" on it and stick it to a random person, then tell the terminator to Attack("Edwin"), the terminator will scan the room, find the name badge and attack whoever is wearing it. That's why you should give your creature a special, unique Death Variable so that you can tailor your scripts and actions to that creature.

Summary
Ignore the word 'Death' and it makes the phrase easier to understand. It's a variable. :)

Quote
Now, for the Death Variable (More properly known as the Script Name, but I'm old Fashioned), one should scroll down to offset 0x2e4.  In real english, this means about 2/3s of the way down the file, as shown by NI. 
Now that I'm actually looked at the tutorial again, the "offest 0x2e4 blah blah blah" bit is actually the numbering system (in hexadecimal... joy) that runs down the right-hand column. If you can count in hexadecimal, then just scroll down and look for that number in the right-hand column. If you're more used to words, then it's much easier to look for the words "Death Variable" in the left-hand column about 2/3 of the way down, as suggested.
« Last Edit: September 29, 2005, 03:46:57 AM by cliffette »

Offline Usually Lurking

  • Planewalker
  • *****
  • Posts: 15
  • Gender: Male
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #63 on: October 12, 2005, 10:33:02 PM »
I have a question regarding spawning an NPC.  I've tried numerous variations of the the code provided all to no avail.  Below is the text in my .baf file for AR0305 (Thieves Guild 1st floor) and the line from the .tp2 that appends the AR0305.bcs .  Is there something hardcoded into the game that will not allow you to create and NPC in that area?  I've used NI to validate there is an AR0305.bcs file in the override file and it contains the text in my .baf file.  I can CLUA the NPC in without problems I just can't get him to spawn automatically.  Any help would be greatly appreciated. 

AR0305.baf:
IF
Global("F1GARTKExists","AR0305",0)
THEN
RESPONSE #100
SetGlobal("F1GARTKExists","AR0305",1)
CreateCreature("F1GARTK",[758.799],13) // 758.799 are the x.y coordinates that will cause him to show up.  13 is the direction he's facing.  It ranges from 0 (South), to 15, going clockwise.
END

.tp2:
EXTEND_TOP ~AR0305.bcs~ ~Gartk\Appends\ar0305.baf~


Oh yes, one other small issue.  I have a bio for him in the .cre file in the value field for the "Sound: Existance5" Attribute that does not show up in game when I CLUA him in.  However the strref is in the dialog.tlk file.  Any ideas on how to get this to load into the game would be appreciated as well.

Thanks!
Beware the fury of a patient man. - John Dryden

The tree of liberty must be refreshed from time to time with the blood of patriots and tyrants. -Thomas Jefferson

People sleep peaceably in their beds at night only because rough men stand ready to do violence on their behalf.  - George Orwell

Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #64 on: October 12, 2005, 10:56:43 PM »
Did you follow all the instructions for making a .cre?
He isn't flagged as "export allowed"?
You aren't testing with a saved game?
You've used NI to look at the .cre and ar0305.bcs when your mod's installed, to verify that everything looks right?
Earn Money Sleeping.

Offline Usually Lurking

  • Planewalker
  • *****
  • Posts: 15
  • Gender: Male
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #65 on: October 13, 2005, 05:41:42 AM »
Did you follow all the instructions for making a .cre?
He isn't flagged as "export allowed"?
You aren't testing with a saved game?
You've used NI to look at the .cre and ar0305.bcs when your mod's installed, to verify that everything looks right?


Followed all the instructions as far as I can tell.  Checked and rechecked about 30 times.
No, he's not flagged as "export allowed"; enemy-ally is also set to neutral-128
Well, I am using a saved game from just after CI, before leaving or doing anything in the Promenade.  Since I haven't been to the area I'm using yet it should not be an issue, right?
I've looked at the files countless times, everything looks okay to me.  I'm sure it's something simple that I'm just not seeing.

Guess I'll recheck everything again or maybe just start from scratch and see if that helps.
Thanks.
Beware the fury of a patient man. - John Dryden

The tree of liberty must be refreshed from time to time with the blood of patriots and tyrants. -Thomas Jefferson

People sleep peaceably in their beds at night only because rough men stand ready to do violence on their behalf.  - George Orwell

Offline Kismet

  • Devil's Minion #5
  • Global Moderator
  • Planewalker
  • *****
  • Posts: 653
  • Gender: Female
  • Veni; Vidi; Velcro.
    • Pocket Plane Group
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #66 on: October 13, 2005, 06:13:17 AM »
Is f1gartk the .cre file name?  Can you CLUA him into the area?
Cailean - An archer NPC for the insatiably nosy!  Guaranteed more fun than shampooing cats!

Offline Usually Lurking

  • Planewalker
  • *****
  • Posts: 15
  • Gender: Male
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #67 on: October 13, 2005, 08:27:35 AM »
Is f1gartk the .cre file name?  Can you CLUA him into the area?

Yes and yes  :).  This is also different from the DV (tried using that to spawn him as well and as I'm sure you already knew, it didn't work) This morning before coming to work I even tried changing the check to see if he exists to a NOT_statement.
changed this:
IF
Global("F1GARTKExists","AR0305",0)

to this:
IF
!Global("F1GARTKExists","AR0305",1)

I really didn't think it'd work but I felt it was worth a shot - it didn't work.  Anyway, I have revisited every section of the tutorial and compared it to what I have and I'm missing something but I'm not sure what.  Since I can CLUA him in with no problems I feel the issue has to be in the area script file.  I will check the area file on the clean install I have and see if that's different from the one I'm installing him on.
Beware the fury of a patient man. - John Dryden

The tree of liberty must be refreshed from time to time with the blood of patriots and tyrants. -Thomas Jefferson

People sleep peaceably in their beds at night only because rough men stand ready to do violence on their behalf.  - George Orwell

Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #68 on: October 13, 2005, 11:24:19 AM »
Check to see if AR0305.are is in mastarea.2da.  In my install, it isn't, and this means variables for it won't work.  You can use either GLOBAL, or add AR0305 to mastarea.2da much in the same way as adding lines to interact.2da or pdialog.2da.
Earn Money Sleeping.

Offline Usually Lurking

  • Planewalker
  • *****
  • Posts: 15
  • Gender: Male
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #69 on: October 13, 2005, 11:51:23 AM »
Check to see if AR0305.are is in mastarea.2da.  In my install, it isn't, and this means variables for it won't work.  You can use either GLOBAL, or add AR0305 to mastarea.2da much in the same way as adding lines to interact.2da or pdialog.2da.

Ah, I'll check that out when I get home tonight.  Thanks Ghrey!  I have a follow-up question for you.  Would it be correct to think of the mastarea.2da file as a kind of control point for Area files, similar to the way the KITTABLE.2DA file is to a Class/Kit?
Beware the fury of a patient man. - John Dryden

The tree of liberty must be refreshed from time to time with the blood of patriots and tyrants. -Thomas Jefferson

People sleep peaceably in their beds at night only because rough men stand ready to do violence on their behalf.  - George Orwell

Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #70 on: October 13, 2005, 12:43:02 PM »
It is, yeah.  I know you need to have the start location for the game be listed there, and scripts cease being active in an area that isn't listed in it, as soon as you leave them.  Or something like that.  I only heard about that last one.
Earn Money Sleeping.

Offline Usually Lurking

  • Planewalker
  • *****
  • Posts: 15
  • Gender: Male
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #71 on: October 13, 2005, 07:22:33 PM »
Check to see if AR0305.are is in mastarea.2da. In my install, it isn't, and this means variables for it won't work. You can use either GLOBAL, or add AR0305 to mastarea.2da much in the same way as adding lines to interact.2da or pdialog.2da.

I updated my .tp2 with the following code to match what was currently in the mastarea.2da file:
APPEND ~mastarea.2da~
~AR0305   value~
UNLESS ~AR0305~

Still no joy on NPC spawn.  I noticed in the ARE files in NI for AR0305 have a listing of the actors, treasure chests, etc.  Is there something I should be doing with this file as well?

Thanks,
UL
Beware the fury of a patient man. - John Dryden

The tree of liberty must be refreshed from time to time with the blood of patriots and tyrants. -Thomas Jefferson

People sleep peaceably in their beds at night only because rough men stand ready to do violence on their behalf.  - George Orwell

Offline Bons

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 1237
  • Gender: Female
  • Glad Corvis Isn't Dead Club
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #72 on: October 13, 2005, 09:59:49 PM »
AR0305 doesn't have a default area script assigned, so you have the AR0305.bcs you created, but I suspect the area file idoes not reference it. You can add the script reference to the area file by adding this to your tp2:

COPY_EXISTING ~AR0305.are~ ~override/AR0305.are~
  WRITE_ASCII 0x94 ~AR0305~
BUT_ONLY_IF_IT_CHANGES

Be warned, if you patch the area file in this manner then, use a save game where the area has already been visited, the change will not appear, nor will the NPC.

As an alternative, append AR0300 and move the NPC where you want them, instead:

IF

        Global("F1GARTKExists","AR0300",0)

THEN
   RESPONSE #100
   SetGlobal("F1GARTKExists","AR0300",1)
   CreateCreature("F1GARTK",[2100.3000],13)
   ActionOverride("F1GARTK", MoveBetweenAreas("AR0305",[758.799],13))
END

Edit: Needed correction.
 
« Last Edit: October 14, 2005, 11:38:41 PM by Bons »
Newt had always suspected that people who regularly used the word "community" were using it in a very specific sense that excluded him and everyone he knew.

             --Neil Gaiman, Terry Pratchett, "Good Omens"

Offline Usually Lurking

  • Planewalker
  • *****
  • Posts: 15
  • Gender: Male
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #73 on: October 14, 2005, 07:52:36 AM »
@ Bons - Ahh, okay.  I will give your second option a try this evening.  Thanks for the advice (and the code)!

UL
Beware the fury of a patient man. - John Dryden

The tree of liberty must be refreshed from time to time with the blood of patriots and tyrants. -Thomas Jefferson

People sleep peaceably in their beds at night only because rough men stand ready to do violence on their behalf.  - George Orwell

Offline Usually Lurking

  • Planewalker
  • *****
  • Posts: 15
  • Gender: Male
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #74 on: October 14, 2005, 09:26:28 PM »
@ Bons - Success!  Well sort of.  For whatever reason my NPC was spawning correctly in AR0300, he just would not move to AR0305, or any of the other 3 areas I tried for that matter.  So I tried the 1st example you gave.  That worked perfectly!  So for now all is well.  Thanks to you, Kismet and Ghrey for the excellent tutorial and advice.
Beware the fury of a patient man. - John Dryden

The tree of liberty must be refreshed from time to time with the blood of patriots and tyrants. -Thomas Jefferson

People sleep peaceably in their beds at night only because rough men stand ready to do violence on their behalf.  - George Orwell

 

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)?: