Pocket Plane Group

Miscellany, Inc. => Tutorials => Topic started by: Ghreyfain on April 01, 2004, 02:58:05 AM

Title: A Beginner's Guide to NPC creation with WeiDU
Post by: Ghreyfain on April 01, 2004, 02:58:05 AM
This is my attempt at showing how to get a (very) simple NPC into your game
using WeiDU. Hopefully it's not too difficult to understand for a totally new
user.  This tutorial has been updated as of 19/11/2004, in an attempt to clarify some previously confusing spots, and to update the WeiDU syntax as necessary.  I'll add the new additions in blue text, at least until I decide it looks bad.

Table of Contents

First off, a checklist of everything that needs to be done to get your NPC into the
game.

I. Making the dialogue (.dlg) files for your NPC.
II. Making a creature (.cre) file of your actual NPC, with stats and equipment.
III. (optional) Making a script (.bcs) for your creature.
IV. Making a WeiDU installation script (.tp2) to install your NPC on other's PCs

Section I: .D and .DLG files

The first thing to do is make a .dlg file for your NPC. This will be what allows
your NPC to talk to the PC, and thus join the party. First off, make a blank .d
file, which you can do by making a blank .txt and re-naming it. I'll name mine
J#Vondo.d. The first line of code we should right is "BEGIN J#Vondo", which means
that at the time of compilation, it will create a file called *J#Vondo.dlg.

* Note that you don't need to use the prefix "J#", this is just a naming convention
I use for all my files to keep them from overwriting other people's custom files. Your
prefix could be TJ or 01 or y6 or something along that vein.

The code should look like this so far:

Code: [Select]
BEGIN J#Vondo
The basic parts of our dialogue should have two States. One is for the first
time the PC and NPC meet, and the second for when the PC has refused their initial
offer to join and has returned. Here's how to write the first state...

IF ~NumTimesTalkedTo(0)~ FirstMeeting

(This is the trigger for the first state. If ~Vondo hasn't talked yet~ then start
the block named "FirstMeeting". Get it?)

SAY ~Greetings good <SIRMAAM>! My name is Vondo the Just.~

(This is what Vondo says. The next block is all the possible responses to his
words.)

IF ~GlobalLT("Chapter","GLOBAL",3)~ THEN REPLY ~Hey Vondo, you seen Irenicus around here?~ GOTO InquireIrenicus
IF ~~ THEN REPLY ~Heya.~ GOTO Greet
+ ~Class(Player1,PALADIN)~ + ~I know a paladin when I see one!~ + BothPaladins
++ ~Go away.~ + GoAway

(These are all the possible options players can choose. Option 1 is only available
if the player is in chapter 1 or 2. Option 2 and 4 are always available (IF ~~),
and option 3 is available if the PC is a Paladin.)

Notice how the syntax of each reply is a bit different.  The first two are using the long form, while the second two use a newer, shortened format.  The first "+" means "IF".  The second "+" is "THEN REPLY".  The third "+" is for "GOTO".  This saves quite a lot of time.

END
(This terminates this block of dialogue.)


So now our .d file should look like this:

Code: [Select]
BEGIN J#Vondo

IF ~NumTimesTalkedTo(0)~ THEN BEGIN FirstMeeting
SAY ~Greetings good <SIRMAAM>! My name is Vondo the Just.~
+ ~GlobalLT("Chapter","GLOBAL",3)~ + ~Hey Vondo, you seen Irenicus around here?~ + InquireIrenicus
++ ~Heya.~ + Greet
IF ~Class(Player1,PALADIN)~ THEN REPLY ~I know a paladin when I see one!~ GOTO BothPaladins
IF ~~ THEN REPLY ~Go away.~ GOTO GoAway
END

Now we need to make the entirely new states that our previous replies link to.

IF ~~ THEN BEGIN InquireIrenicus
(This is after the PC chose to ask about Irenicus.)

SAY ~Nope, but I can help you look for him. I'm a paladin!~
(Vondo's response)

++ ~Sure. Join the party~ DO ~SetGlobal("VondoJoined","LOCALS",1)
JoinParty()~ EXIT

(This will set a variable for Vondo that means he's joined the party. The action
"JoinParty()" obviously makes him join the party. EXIT ends the dialogue.)

IF ~~ THEN REPLY ~Nah, go away.~ EXIT

(This will terminate the dialogue, and Vondo will still be standing around.)

END

Now for the rest of the blocks.

Code: [Select]
IF ~~ THEN BEGIN Greet
SAY ~So, you need a paladin in your group?~
IF ~~ THEN REPLY ~Yes, as a matter of fact we do.~ DO ~SetGlobal("VondoJoined","LOCALS",1)
JoinParty()~ EXIT
IF ~~ THEN REPLY ~Nah, go away.~ GOTO GoAway
END

IF ~~ THEN BEGIN BothPaladins
SAY ~Another paladin! Hail and well met brother. Let us journey together and smite evil.~
IF ~~ THEN REPLY ~Sounds like a plan.~ DO ~SetGlobal("VondoJoined","LOCALS",1)
JoinParty()~ EXIT
IF ~~ THEN REPLY ~Nah, go away.~ GOTO GoAway
END

IF ~~ THEN BEGIN GoAway
SAY ~Very well my <LADYLORD>, I will await the day when you return, so that we might smite evil!~
IF ~~ THEN EXIT
END


(The "GoAway" block demonstrates a situation where the player simply presses Enter
to continue the dialogue.  In this case it ends the dialogue entirely.)

So that's all we need for the "First meeting" state. Now to make a follow up
dialogue for when the PC returns to talk to Vondo.

Code: [Select]
IF ~NumTimesTalkedToGT(0)~ THEN BEGIN ReturnDialogue
SAY ~I see you have returned, my friend.~
IF ~~ THEN REPLY ~Yep, come and join the party.~ DO ~SetGlobal("VondoJoined","LOCALS",1)
JoinParty()~ EXIT
IF ~~ THEN REPLY ~Yeah, but I still don't want you in the party.~ GOTO RefusedAgain
END

IF ~~ THEN BEGIN RefusedAgain
SAY ~Ah, once again you refuse my offer. No matter, I will amuse myself with this magical device I have purchased. It was given to be by a gnome named John Johnson, or something similar.~
IF ~~ THEN EXIT
END


And that's the initial dialogue the NPC will start with. The next file that is
absolutely essential is the *P.dlg file, or the dialogue file that runs when you
kick your NPC out of the party.

Here's what I mean; Vondo joins the party (using J#Vondo.dlg), and is automatically
assigned three dialogues by various .2da files (Pdialog.2da and Interdia.2da). When
you kick him out, his *P.dlg file runs, and looks for the first state that is true.

For a more in-depth tutorial on what the various NPC dialogue files are, and how they work, click here: http://forums.pocketplane.net/index.php?topic=53.0

So since we're starting a new .dlg file, we need to include the line...

BEGIN J#VondoP

Now, J#VondoP is what will be entered in the pdialog.2da file, since that's what our finished .dlg file's name will be. As to the actual contents of
this .dlg file, the code will look like this:

IF ~Global("VondoJoined","LOCALS",1)~ THEN BEGIN KickOut

(This is the variable that was set when Vondo joined the party. If it's at 1, it
means he is currently in the party, and so is being kicked out when the *P.dlg if
being run.)

SAY ~You are now kicking me out.~
IF ~~ THEN REPLY ~Oops, I meant to boot that twit Anomen, not you. Sorry.~ DO ~JoinParty()~ EXIT

(The P.dlg automatically "kicks" the NPC, so when you want him to not be kicked,
just have him use the JoinParty() command.)

IF ~~ THEN REPLY ~That's right, I don't want you in the party.~ DO ~SetGlobal("VondoJoined","LOCALS",0)~ EXIT

(This sets the "VondoJoined" variable to 0, meaning he has been kicked out.)

END

The block should look like this:

Code: [Select]
IF ~Global("VondoJoined","LOCALS",1)~ THEN BEGIN KickOut
SAY ~You are now kicking me out.~
IF ~~ THEN REPLY ~Oops, I meant to boot that twit Anomen, not you. Sorry.~ DO ~JoinParty()~ EXIT
IF ~~ THEN REPLY ~That's right, I don't want you in the party.~ DO ~SetGlobal("VondoJoined","LOCALS",0)~ EXIT
END

And that's all you need to kick him out. To have him rejoin once he's been kicked
out, you would write the following:

Code: [Select]
IF ~Global("VondoJoined","LOCALS",0)~ THEN BEGIN Rejoin
SAY ~You want me to rejoin?~
IF ~~ THEN REPLY ~That's right Vondo, get back in formation.~ DO ~SetGlobal("VondoJoined","LOCALS",1)
JoinParty()~ EXIT
IF ~~ THEN REPLY ~That's right, I don't want you in the party.~ EXIT
END


And now THAT is all the necessary dialogue you need for an NPC. The rest is smooth
sailing. The final product of your .d should look like this...

Code: [Select]
BEGIN J#Vondo

IF ~NumTimesTalkedTo(0)~ THEN BEGIN FirstMeeting
SAY ~Greetings good <SIRMAAM>! My name is Vondo the Just.~
IF ~GlobalLT("Chapter","GLOBAL",3)~ THEN REPLY ~Hey Vondo, you seen Irenicus around here?~ GOTO InquireIrenicus
IF ~~ THEN REPLY ~Heya.~ GOTO Greet
IF ~Class(Player1,PALADIN)~ THEN REPLY ~I know a paladin when I see one!~ GOTO BothPaladins
IF ~~ THEN REPLY ~Go away.~ GOTO GoAway
END

IF ~~ THEN BEGIN InquireIrenicus
SAY ~Nope, but I can help you look for him. I'm a paladin!~
IF ~~ THEN REPLY ~Sure. Join the party~ DO ~SetGlobal("VondoJoined","LOCALS",1)
JoinParty()~ EXIT
IF ~~ THEN REPLY ~Nah, go away.~ EXIT
END

IF ~~ THEN BEGIN Greet
SAY ~So, you need a paladin in your group?~
IF ~~ THEN REPLY ~Yes, as a matter of fact we do.~ DO ~SetGlobal("VondoJoined","LOCALS",1)
JoinParty()~ EXIT
IF ~~ THEN REPLY ~Nah, go away.~ EXIT
END

IF ~~ THEN BEGIN BothPaladins
SAY ~Another paladin! Hail and well met brother. Let us journey together and smite evil.~
IF ~~ THEN REPLY ~Sounds like a plan.~ DO ~SetGlobal("VondoJoined","LOCALS",1)
JoinParty()~ EXIT
IF ~~ THEN REPLY ~Nah, go away.~ EXIT
END

IF ~~ THEN BEGIN GoAway
SAY ~Very well my <LADYLORD>, I will await the day when you return, so that we might smite evil!~
IF ~~ THEN EXIT
END

BEGIN J#VondoP

IF ~Global("VondoJoined","LOCALS",1)~ THEN BEGIN KickOut
SAY ~You are now kicking me out.~
IF ~~ THEN REPLY ~Oops, I meant to boot that twit Anomen, not you. Sorry~ DO ~JoinParty()~ EXIT
IF ~~ THEN REPLY ~That's right, I don't want you in the party.~ DO ~SetGlobal("VondoJoined","LOCALS",0)~ EXIT
END

IF ~Global("VondoJoined","LOCALS",0)~ THEN BEGIN Rejoin
SAY ~You want me to rejoin?~
IF ~~ THEN REPLY ~That's right Vondo, get back in formation.~ DO ~SetGlobal("VondoJoined","LOCALS",1)
JoinParty()~ EXIT
IF ~~ THEN REPLY ~That's right, I don't want you in the party.~ EXIT
END

It seems tough at first, but it's really quite easy once you get the hang of it.

Congratulations, you've just finished reading the entirety of Section I! The rest
are a whole lot shorter, so don't worry. :)


Section II: Making the .CRE

This is an easy step. Simply start a multi-player game of BG2 (no need to get onto
the internet, just a LAN game with one player in it is fine), and create a
character.

Cheat to give him whatever XP, hit points, equipment, and stats you want, then export him.

Make any last minute changes to his .chr with Shadow Keeper, DLTCEP, or NearInfinity if you like, and then
open up NearInfinity.  From there, scroll down to the "characters" tab, find your new character, and open it.  In the File menu, select "Convert CHR to CRE".

Once it's in .cre format, you can assign it it's Death Variable, Dialogue file,
Scripts, and unset certain Flags. This is all fairly simple, so I don't think I need to
explain any futher. Save it and that's that.


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.  This will be what identifies your NPC in the game.  Other Death Variables include "Minsc", "Jaheira", and "Imoen2".  I recommend using a unique prefix for this field.  We shall set Vondo's DV to j#vondothejust.

This field can be the same as the filename of your CRE, but does not have to be. To keep this clear for our example, we will make the DV j#vondothejust, so you see the difference between filename and script name/death variable.

Scripts at the moment are unimportant, but for now you should set the override script slot to "J#Vondo".  This means that when we create a J#Vondo.bcs file, it will be assigned to our .cre file.  You should also blank out the leftovers from your .chr file (which should be dplayer3.bcs), and set that to none.  If you want your PC to initiate dialogue as soon as they see the PC, use shoutdl2.bcs.  If you want them to walk up to the PC to start a conversation, use initdlg.bcs.  A basic combat script for them to use would be WTASIGHT.bcs, or WTARSGT.bcs for ranged weapons.  So now we should have J#Vondo assigned to override, initidlg.bcs assigned to a slot further down, and wtasight or wtarsgt.bcs below that.

The dialogue assignment is at 0x330, or in the same area as the Script Name/Death Variable, just a bit further down.  Right-click the field, choose "Edit as String", and type in J#Vondo.  This means when our finished product is installed, and our dialogue compiled, J#Vondo.cre will use J#Vondo.dlg initially.

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.

Whew, and that's that for the .cre. :)

Section III: Scripts

The next bit is already covered by our addition of initdlg.bcs to our .cre file.  Ignore all the red bits.

Possibly the shortest step. If you want your NPC to walk up to your PC when they
first meet, you'd write this script as a .baf file, i.e. J#Vondo.baf:
[/s]

Code: [Select]
IF
See([PC])
NumTimesTalkedTo(0)
THEN
RESPONSE #100
Dialogue(Nearest([PC]))
END

You don't need to compile it yet.  You can leave it in .baf format (that's the
source code for BioWare's script files).  Assign it to your NPC's .cre file.  To do
this in NI, right-click the script field and chose "Edit as String", then type in
your scripts name without the .bcs extension.


Then the method to get your NPC into the area is to append a small portion of
script to an existing area script. Let's say we want to add him to the Government
District. We'd need to append a bit to AR1000.bcs. For now let's create a script
called AR1000.baf with the bits we want to add.

Code: [Select]
IF
Global("J#VondoExists","AR1000",0)
THEN
RESPONSE #100
SetGlobal("J#VondoExists","AR1000",1)
CreateCreature("J#Vondo",[1137.2046],3) // 1137.2046 are the x.y coordinates that will cause him to show up.  3 is the direction he's facing.  It ranges from 0 (South), to 15, going clockwise.
END

This portion of script will be going into our installation package, and will be
appended to AR1000.bcs by WeiDU when the time is right. See section IV for details
on how this is done.

Section IV: The WeiDU .TP2

The .tp2 is the installation script that installs your NPC on another's computer, by compiling dialogues, scripts, and by assigning text to their dialog.tlk file and matching the new text to the .cre files.  The following has been shamelessly taken from a follow-up on this very tutorial, written by Domi, since I was too lazy to update it.

DO the following:
1) Open you BG2 Main Directory
2) Create a folder called VondoTheNPC
3) Open the folder called VondoTheNPC and within it create a subfolder called backup
4) In the folder called VondoTheNPC copy you cre, your baf's and your d's
5) Go back to your main BG2 directory
6) Copy/paste WeiDU.exe there and re-name it VondoTheNPC-setup.exe
7) in the main BG2 directory create a file called VondoTheNPC-setup.tp2

OPEN the TP2 file in your text editor and keep reading to see what needs to be included for your NPC mod to work.


Thanks, Domi, whether or not you see this. ;)

Code: [Select]
BACKUP ~VondoTheNPC\backup~
AUTHOR ~ghreyfain@pocketplane.net~
BEGIN ~Vondo the NPC for BG2:ToB~


// The following is the copying of Vondo's .cre file, as well as assigning his sound-set.  See the file sndslot.ids for a listing of sounds you can add.

COPY ~VondoTheNPC\J#Vondo.cre~ ~override\J#Vondo.cre~
SAY NAME1 ~Vondo~
SAY NAME2 ~Vondo~
SAY SELECT_COMMON4 ~Blah blah blah.~ [Vondo1] // [Vondo1] is the name of the .wav
file for this sound
SAY SELECT_COMMON5 ~Give the word.~ [Vondo2]
SAY SELECT_COMMON6 ~Point the way.~ [Vondo3]
SAY SELECT_ACTION1 ~I'm on the job.~ [Vondo4]
SAY SELECT_ACTION2 ~As you wish.~ [Vondo5]


// The following is telling WeiDU to compile the following .d files

COMPILE ~VondoTheNPC\J#Vondo.d~

// The following is compilling the script and placing it in the override.  We haven't actually made a script yet, though, so this isn't necessary.

COMPILE ~VondoTheNPC\J#Vondo.baf~

// The following is appending what we wrote in AR1000.baf to the bottom of
// AR1000.bcs

EXTEND_TOP ~Ar1000.bcs~ ~VondoTheNPC\ar1000.baf~

The following is some .2DA appending for Vondo, which goes into the .tp2 as well.

I should detail exactly what this means.  Pdialog, basically, is a 2-d array (.2da) that assigns various scripts and dialogue to an NPC.

The first field is our NPCs Script Name/Death Variable, j#vondothejust.

The second is the "post" dialogue file, for when the NPC has been removed from the party.

The "J" is for interjections and dialogue while in-party, such as flirts or PC-initiated discussions.

J#VondoD is actually the dream script file.  This acts as any normal script, only it basically adds the condition "the player has just clicked the Sleep button" to all trigger blocks.

The next four fields are as above, only for the ToB expansion.  It's recommended to add them even if your NPC only has SoA content, because it won't do any harm to have it there, but to change it later is a little bit of a hassle.

The UNLESS line is a WeiDU command telling the program to only append this text if J#VondoTheJust doesn't already exist in the file.

Code: [Select]
APPEND ~pdialog.2da~
~J#VondoTheJust J#VondoP J#VondoJ J#VondoD J#Von25P J#Von25J J#Von25D J#Vond25~
UNLESS ~J#VondoTheJust~

// interdia.2da is a bit simpler, but acts the same as pdialog.2da.  It adds the NPCs banter file, which is used for inter-party banter, and romance dialogues.
Code: [Select]
APPEND ~interdia.2da~
~J#VondoTheJust J#VondoB J#VonB25~
UNLESS ~J#VondoTheJust~

And that's the end of it, I hope it was clear and not too confusing.

Send any comments on this tutorial to ghreyfain@yahoo.ca, and visit the WeiDU site at http://www.weidu.org.  Or better yet, reply here.

Other sites of interest for IE editing are:

http://www.idi.ntnu.no/~joh/ni/ - Home of NearInfinity
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Ghreyfain on November 20, 2004, 03:41:12 PM
Significantly updated.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Exodus on November 21, 2004, 10:10:33 PM
Cheers d00d.   ;D
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: adam on November 22, 2004, 12:30:45 PM
extremely helpful, but what is a t2p file? It says "Create a file named (blahblah).t2p"  what kind of file? a text file renamed?
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: jcompton on November 22, 2004, 12:38:44 PM
TP2, and yes, text file renamed. Both .d and .tp2 files are just text files.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Ashara on November 23, 2004, 11:04:50 AM
Great job, Ghrey, and I am flattered that you've used one of my step-guides. What I would suggest adding are 2 things:

1. A small discussion of the difference between DV and CRE name; Specify that Area BAF that summons NPC will use CRE name, while every other script and check will use DV.

2. I know it's contravercial, but I think adding script/dlg/portrait assinment via TP2 would be neat
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Ghreyfain on November 23, 2004, 03:27:36 PM
Yeah, one of the main changes to the tutorial was to indicate the difference between the DV and .cre name.  I just changed the DV from J#Vondo (same as the .cre file name), to J#VondoTheJust.  That should be clear enough, I hope.

As for the .tp2 stuff, I saw a bit of the back and forth about the "proper" way to assign dialogues and stuff (not that I'm admitting to any sort of ban evasion.  Me?  No way would I do that.  No sir.  Not in a million years.)  The only reason I didn't add anything about it was because I was getting a bit lazy, and didn't want to re-write the sum of the discussion to make it more clear.

There's also something to be said about keeping things uncluttered.  As it is, it's already pretty long. :)
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: neriana on November 23, 2004, 04:19:16 PM
Keeping things simple is nice, I guess, but instructions should be thorough and clear before they're anything else. Many (most?) people who are looking at this have never coded anything before in their lives, and have no clue what any of the terms mean in the first place.

Why is showing how to add script/dialogue/portrait assignment via .tp2 contraversial? It's a necessary part of creating an NPC.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Kismet on November 23, 2004, 04:50:26 PM
They're talking about assigning script/dialog/portrait to a .cre via the .tp2, which involves a bit of hex code as opposed to editing the .cre file using NI or DLTCEP.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: jcompton on November 23, 2004, 05:09:58 PM
In the long run I'm not sure one method is inherently better than another (for experienced modders, the TP2 approach is probably quite a bit faster), but since it's a lot easier to conceptualize "Edit this field in NI" than it is to explain the WRITE_BYTE concept in what we know from experience is for many people is their first modding tutorial, I think it's best to stick with the "edit this field in NI" approach.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: SimDing0™ on November 24, 2004, 04:58:03 AM
They're talking about assigning script/dialog/portrait to a .cre via the .tp2, which involves a bit of hex code as opposed to editing the .cre file using NI or DLTCEP.
You don't (shouldn't) need hex code for dialog/script assignments with the newer WeiDU.

SAY DIALOG "J#Vondo"

should be valid.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: jcompton on November 24, 2004, 03:32:07 PM
I've redirected our discussion to keep this post focused on the actual content of the tutorial.

http://forums.pocketplane.net/index.php?topic=17387.0
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: neriana on November 24, 2004, 03:54:21 PM
In the long run I'm not sure one method is inherently better than another (for experienced modders, the TP2 approach is probably quite a bit faster), but since it's a lot easier to conceptualize "Edit this field in NI" than it is to explain the WRITE_BYTE concept in what we know from experience is for many people is their first modding tutorial, I think it's best to stick with the "edit this field in NI" approach.
A small tutorial for not-so-experienced modders who are interested in this method would be welcome :).
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: jcompton on November 24, 2004, 03:57:45 PM
In the long run I'm not sure one method is inherently better than another (for experienced modders, the TP2 approach is probably quite a bit faster), but since it's a lot easier to conceptualize "Edit this field in NI" than it is to explain the WRITE_BYTE concept in what we know from experience is for many people is their first modding tutorial, I think it's best to stick with the "edit this field in NI" approach.
A small tutorial for not-so-experienced modders who are interested in this method would be welcome :).

Which, the NI side or the WeiDU byte-patching side?

As young Ding0 points out, the WeiDU side did recently get a little easier to conceptualize with the addition of some textual shortcuts. Japh and I think some of the gliberings have done WRITE_BYTE/WRITE_ASCII tutorials for the basics.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: malthaussen on December 03, 2004, 08:55:15 PM
A nice tutorial.  How about a downloadable version?

  -- mal
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Neffra on December 04, 2004, 03:56:18 AM
Its very easy to make your own downloadable version actually if they don't already have one. :)


Simply look either at the very top right or very bottom right of the thread to find the print button.

Click that and the topic will open up in a new window in a printer friendly version for you.

Once it does so, click on File --> Save As

When the save box opens up, name the file what ye wish and choose to save it as whichever format you prefer.  I have WinXP so, the drop down choices for it is:

Web Page, complete (best quality with all the formatting, but you'll end up with all the scripts/graphics in a folder along with the actual content containing html page; In other words, 2 files - an html page and a linked folder with all the bits and parts.)

Web Archive, single file (saves as an .mht file. I like this one. One very compact file, very neatly laid out. Formatting retained, no scripts, etc kept.)

Web Page, HTML only (Also good. Formatting maintained in one html file. Embedded things like scripts, etc., are not kept)

Text File (Simple, space saving, and comes in a single .txt file, but the formatting is lost making for a messy hard to read layout. Not recommended.)

Save, and away you go!

To open html or .mht files for viewing, just double click. Your browser does the rest. :)
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: khruloc on July 03, 2005, 07:31:45 PM
Sorry, but I cant seem to edit the .CRE file

Steps I did:
1) CHR->CRE
2) Save in Overides Folder
3) Double Click the file but NI did not allow me to edit the Death Variables etc
...So got stuck even in this stage!

Remember I was able to do it some time ago (2 years before =P) .
Wonder what has gone wrong... ::)

Sorry for this noob question.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Grim Squeaker on July 04, 2005, 02:51:56 AM
If you have the latest version of Java you'll probably have to use the latest NI beta, as the current non-beta release is incompatible.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Something_Wicked on July 04, 2005, 06:23:20 PM
Great tutorial, very helpful (I'm incredibly useless at computer stuff, and even I managed to figure it out with this  :) ) But I have one question.

What do you do if you want to have the NPC attack your party as a consequence of the dialogue, like in BG1 when Minsc attacks you if you refuse to help Danaheir? Do you work it into the dialogue code?
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Kismet on July 04, 2005, 06:34:22 PM
Yup, you'd do it something like this:

IF ~~ THEN BEGIN NoWay
SAY ~So you won't help me?  In that case I shall kill you.~
IF ~~ THEN DO ~Enemy() Attack(Player1)~ EXIT
END
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: khruloc on July 04, 2005, 06:44:46 PM
Thanks for the help in NI!
Another question:
but what does this mean~"...one should scroll down to offset 0x2e4"?
Cant understand the hex values?

(Sorry, keep getting stuck in every step :'()


Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Kismet on July 04, 2005, 07:24:47 PM
If you choose "Show Hex Offset" under "Options" you should see the hex offsets along the right hand side of the Edit tab.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: khruloc on July 04, 2005, 08:23:38 PM
<OK, checked the show Hex offsets>

Am I correct to say that "0x2e4" and " 0x330" are literally the positions of the attributes on NI?
That I do not need to alter their hex values but only to edit the fields as string?

Anyway my configuration is as follows:

Override Script: Char.bcs <-edit as string
Class Script: None
Race Script: None
General Script: wtasight.bcs
Default Script: Initdlg.bcs
...
...etc
#effects:2
Dialog: Char <-edit as string

Is this ok?

Next we are to create a script at *.baf, *.tp2, and *.2da are these files a simple text file modified to the respective extensions?
Thanks!
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Kismet on July 04, 2005, 08:42:08 PM
<OK, checked the show Hex offsets>

Am I correct to say that "0x2e4" and " 0x330" are literally the positions of the attributes on NI?
That I do not need to alter their hex values but only to edit the fields as string?
I believe that is correct.

Quote
Anyway my configuration is as follows:

Override Script: Char.bcs <-edit as string
Class Script: None
Race Script: None
General Script: wtasight.bcs
Default Script: Initdlg.bcs
...
...etc
#effects:2
Dialog: Char <-edit as string

Is this ok?

I tend to put all my NPC's scripted actions into his override script (e.g. approaching the player to start the dialog) but I'm pretty sure the way you have it will work.

Quote

Next we are to create a script at *.baf, *.tp2, and *.2da are these files a simple text file modified to the respective extensions?
Thanks!


.baf and .tp2 are text files.  You wouldn't actually create a .2da file (at least in this instance) but instead append to two via your .tp2 file.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: khruloc on July 04, 2005, 09:30:00 PM
...Guess I have found the problem... Solving parser, synthax now...
 ;)
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Something_Wicked on July 04, 2005, 10:26:36 PM
Thanks for the help!
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Snake on July 17, 2005, 01:19:56 PM
This thing has been great so far. but im stuck now for a couple of hours and i cant find out what to do.

I made my dialogue files ( btw all the dialogue, the first time meeting, return meeting, join party, kick from party ) can all be put together in 1 .dlg file right? Anywya, i did all that... but my problem lies with something else.

I booted up near infinity and i found my character in the characters section. And when i click on the character i go to File > Convert CHR to CRE.  I did that, and that it tells me where iwant to save the file. so i made one in the Characters folder. When i refreshed the tree you could see all the CHR in the Character subfolder. and also the .CRE file i just made. So i tried opening it or whatever but it doesnt work. only the tree is visible, the right hand side is completely white. Im a total n00b at any of this and i started my project out of the lack of a good mage in BG 2. From one thing came another and now im trying to create my own Raistlin Majere NPC. So far so good anyway... but im stuck at this point. I cant edit the character values... HELP!
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Bjoern on July 18, 2005, 10:19:31 AM
Hello, im very new to this forum and also to any kind of programming, but i hope i will catch up soon. I am interested in making my own NPC and to begin with, which programs do i need? the only one i currently have is SK, any links would be welcome. :)

Also high-lighting everything special would be nice :) ie. "BEGIN J#Vondo"  ;) but its not that important..
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Bjoern on July 18, 2005, 02:39:45 PM
Should all the text within the first part be in a file called for ex. J#Adelstein.d??

this is what ive done..

The file - J#Adelstein.d =

BEGIN J#Adelstein

IF ~NumTimesTalkedTo(0)~ THEN BEGIN FirstMeeting
SAY ~Hello young fellow! My name is Adelstein.~
+ ~GlobalLT("Chapter","GLOBAL",3)~ + ~Hey Adelstein, you havent seen a fellow named Irenicus around here, have you?~ + InquireIrenicus
++ ~Heya.~ + Greet
IF ~Class(Player1,WIZARDSLAYER)~ THEN REPLY ~Ohh! I can tell that you are a Wizard Slayer, just like me, we arent common in these lands.. I would be honored to fight by your side!~ GOTO BothWIZARDSLAYER
IF ~~ THEN REPLY ~Bug off! Or ill cut yer throat!~ GOTO GoAway
END


or should all that text be put in another file??
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Kismet on July 18, 2005, 03:08:31 PM
Yes, they should all be in the same file however J# is the prefix that Ghreyfain uses so you should probably use something different.  Also, your BEGIN file name is too long, those can only be 8 characters max.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Bjoern on July 18, 2005, 03:17:33 PM
aha, ok thanks, ill come up with something different then :P

and should Wizard Slayer be one word?
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Kismet on July 18, 2005, 03:23:02 PM
http://iesdp.gibberlings3.net/main.htm -- A really necessary resource to have.  Checking kit.ids will show that it is one word.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Bjoern on July 24, 2005, 04:28:03 AM
Code:
IF ~NumTimesTalkedToGT(0)~ THEN BEGIN ReturnDialogue
SAY ~I see you have returned, my friend.~
IF ~~ THEN REPLY ~Yep, come and join the party.~ DO ~SetGlobal("VondoJoined","LOCALS",1)
JoinParty()~ EXIT
IF ~~ THEN REPLY ~Yeah, but I still don't want you in the party.~ GOTO RefusedAgain
END

IF ~~ THEN BEGIN RefusedAgain
SAY ~Ah, once again you refuse my offer. No matter, I will amuse myself with this magical device I have purchased. It was given to be by a gnome named John Johnson, or something similar.~
IF ~~ THEN EXIT
END


where should i put this? i the J#Vondo.d file? (or in my case i changed the name to Adel.) because when i look a the summary of all that should be in the J#Vondo.d file, you havent put it there, and i cant seem to find any other place where its supposed to be put..? im putting it there anyway but please tell me if you did just miss it or if its supposed to be somewhere else.

TIA
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Kismet on July 24, 2005, 05:18:38 AM
Yes, J#Vondo.d is for all dialog from before the NPC is ever in the party.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Bjoern on July 24, 2005, 10:59:32 AM
6) Copy/paste WeiDU.exe there and re-name it VondoTheNPC-setup.exe

can you explain this step better? how do i get the "VondoTheNPC-setup.exe" to work with the "VondoTheNPC-setup.tp2"?
where do i get the file weidu.exe? im gonna check the webpage now..
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Bjoern on July 24, 2005, 12:06:24 PM
I fixed that, but currently im getting this problem :(



Install Component [Adelstein the NPC for BG2:ToB]

[Y]es or [N]o or [Q]uit?
Installing [Adelstein the NPC for BG2:ToB]
Copying and patching 1 file ...
ERROR: error loading [Adel\Adel.cre]
Stopping installation because of error.

ERROR Installing [Adelstein the NPC for BG2:ToB], rolling back to previous state
[Adel\backup/0/UNSETSTR.0] SET_STRING uninstall info not found
WARNING: [Adel\backup/0/UNINSTALL.0] is a 0 byte file
[Adel\backup/0/UNINSTALL.0] loaded, 0 bytes
Will uninstall   0 files for [SETUP-ADEL.TP2] component 0.
Uninstalled      0 files for [SETUP-ADEL.TP2] component 0.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Felix on July 30, 2005, 05:14:07 AM
Ugh. I think I finally got all of this done as I should, but I have one major problem. No matter what I do, my text files on notepad always end up ".txt". So what's supposed to be the .baf file is "filename.baf.txt" and my tp2 file is "file-setup.tp2.txt". and I can't do anything about it. I did change the dropdown box to "All files" when I saved them, an deverything, but I just can't figure it out.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Bjoern on July 30, 2005, 07:58:03 AM
i dont get at all whats supposed to be in the .dlg file, everything seems to be put into the .d file.. whats the use of this .dlg file?
why do i need to create a .dlg file when its all empty?

there should be a summry like, J#Vondo.d is supposed to contain all of this info, J#VondoP.dlg is supposed to contain all of this.. becasue ive read it thru lots of times and i only get more and more confused everytime i read it.. a summary is much needed..
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Kismet on July 30, 2005, 10:14:05 AM
i dont get at all whats supposed to be in the .dlg file, everything seems to be put into the .d file.. whats the use of this .dlg file?
why do i need to create a .dlg file when its all empty?

there should be a summry like, J#Vondo.d is supposed to contain all of this info, J#VondoP.dlg is supposed to contain all of this.. becasue ive read it thru lots of times and i only get more and more confused everytime i read it.. a summary is much needed..

A .dlg file is a .d file that's been compiled so that the game engine can read it.  That's why you have the COMPILE ~j#vondo.d~ command in your .tp2 file.  Read here for the explanations of what the various .d files do: http://forums.pocketplane.net/index.php/topic,53.0.html
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Ghreyfain on July 30, 2005, 12:05:18 PM
Ugh. I think I finally got all of this done as I should, but I have one major problem. No matter what I do, my text files on notepad always end up ".txt". So what's supposed to be the .baf file is "filename.baf.txt" and my tp2 file is "file-setup.tp2.txt". and I can't do anything about it. I did change the dropdown box to "All files" when I saved them, an deverything, but I just can't figure it out.

Have you turned off visible file extensions in Windows?  If so, just go to your BG2 folder, click the Tools menu, then Folder Options, then click the View tab, and find the checkbox for "Hide extensions for known file types".  Make sure it's unchecked.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: dunk on August 01, 2005, 12:01:41 AM
Scripts at the moment are unimportant, but for now you should set the override script slot to "J#Vondo".  This means that when we create a J#Vondo.bcs file, it will be assigned to our .cre file.  You should also blank out the leftovers from your .chr file (which should be dplayer3.bcs), and set that to none.  If you want your PC to initiate dialogue as soon as they see the PC, use shoutdl2.bcs.  If you want them to walk up to the PC to start a conversation, use initdlg.bcs.  A basic combat script for them to use would be WTASIGHT.bcs, or WTARSGT.bcs for ranged weapons.  So now we should have J#Vondo assigned to override, initidlg.bcs assigned to a slot further down, and wtasight or wtarsgt.bcs below that.

The dialogue assignment is at 0x330, or in the same area as the Script Name/Death Variable, just a bit further down.  Right-click the field, choose "Edit as String", and type in J#Vondo.  This means when our finished product is installed, and our dialogue compiled, J#Vondo.cre will use J#Vondo.dlg initially.

Where is this dplayer3.bcs?  I don't see anything with that value.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Ghreyfain on August 01, 2005, 02:25:56 AM
It should be in the section where five scripts are labelled override, default, class, race, and default.  Not necessarily in that order.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: They Sang the Solo on August 01, 2005, 10:59:22 AM
I finally have the basics of my NPC complete, with one minor problem. In your tutorial, it suggests making the following to be what activates when you talk to the NPC subsequent times after rejecting them entrance into the party:

IF ~NumTimesTalkedToGT(0)~ THEN BEGIN ReturnDialogue
SAY ~I see you have returned, my friend.~
IF ~~ THEN REPLY ~Yep, come and join the party.~ DO ~SetGlobal("VondoJoined","LOCALS",1)
JoinParty()~ EXIT
IF ~~ THEN REPLY ~Yeah, but I still don't want you in the party.~ GOTO RefusedAgain
END

IF ~~ THEN BEGIN RefusedAgain
SAY ~Ah, once again you refuse my offer. No matter, I will amuse myself with this magical device I have purchased. It was given to be by a gnome named John Johnson, or something similar.~
IF ~~ THEN EXIT
END

---
However, it doesn't show in your "finished product" box at the end of step one, and I'm unsure as to where it belongs in the D file. I have one written myself for my characters diologue after being declined during the first talking, but when I talk to him a second time it acts as though we had never spoken for, which I'm guessing is because of missplacing that block. Where does it belong? and what does the "GT" mean in the ~NumTimesTalkedToGT(0)~? My guess is "greater than", but I could very well be wrong. Here's mine, specifically, so if there are any noticeable errors, let me know, but I basically just need to know where to put it.:

IF ~NumTimesTalkedToGT(0)~ THEN BEGIN ReturnDialogue
SAY ~You've returned! Have you reconsidered?~
IF ~~ THEN REPLY ~I have, and your skills are missed in your absence. Please join me!~ DO ~SetGlobal("ArdanisJoined","LOCALS",1)
JoinParty()~ EXIT
IF ~~ THEN REPLY ~I have, actually. But I still have no use for you.~ GOTO RefusedAgain
END

IF ~~ THEN BEGIN RefusedAgain
SAY ~Ah, how high you've brought my hopes. Oh well.~
IF ~~ THEN EXIT
END
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: dunk on August 01, 2005, 12:12:37 PM
It should be in the section where five scripts are labelled override, default, class, race, and default.  Not necessarily in that order.

Thanks.  Those were set to "None" before I even started editting the CRE file.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Ghreyfain on August 02, 2005, 12:45:00 PM
I finally have the basics of my NPC complete, with one minor problem. In your tutorial, it suggests making the following to be what activates when you talk to the NPC subsequent times after rejecting them entrance into the party:

What's the code for you initial meeting?  It should have NumTimesTalkedTo(0) as its condition.  And yes, GT is Greater Than.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: They Sang the Solo on August 02, 2005, 12:47:28 PM
My first block on my .D is this:

IF ~NumTimesTalkedTo(0)~ THEN BEGIN FirstMeeting
SAY ~Greetings, friend. You'll have to excuse me for smiling like a buffoon. Ha! To meet the Bhaalspawn! If I ever thought I'd meet you, I never thought it would be here at the Crooked Crane.~
IF ~~ THEN REPLY ~I find it strange that everyone seems to know who I am better than I do. How do you know of me? Who are you, exactly? From the color of your skin, I can know vaguely of your origins...~ GOTO ArdanisFriendly
IF ~~ THEN REPLY ~Yeah, yeah. Bhaalspawn. What's it to you?~ GOTO ArdanisFriendly
END
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: dunk on August 04, 2005, 07:33:51 PM
Ok.

I've added Vondo to my game and allowed him to join the party.  The problem is he seems to be constantly trying to initiate dialogue.  A conversation never begins, but he'll stop moving a second or so after I give him the order to move.  And if I try to save the game, it says it's in dialogue mode.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Exxon on August 04, 2005, 09:10:06 PM
I havent even been able to open anything, I can't even get it on the right path . when I open up command It says that the system file is not sutable for runing MS-DOS and Microsoft Word applications.can somebody help me!! I a complet noobe and only just downloaded WeiDU.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Miss Sakaki on August 05, 2005, 10:32:14 AM
This may be a bit of a tall order, but I was wondering if a simple tutorial could be made to instruct how to make a ToB NPC appear and function. This is of course partly self-interested - I've been having major problems with ToB dialogue. My NPC can be summoned by the fate spirit, but then the parting dialogue doesn't function properly! Grrr. Anyway, a set of instructions would be really useful.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Grim Squeaker on August 05, 2005, 10:36:39 AM
Most of it can be done by reading the Bioware dialogue/scripting for ToB and adapting this tutorial.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: dunk 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.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: discharger12 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.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Ghreyfain on August 29, 2005, 09:15:57 PM
Where is the .tp2 file?
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: discharger12 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
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: discharger12 on August 29, 2005, 10:23:20 PM
wrong post.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Kismet 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.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: discharger12 on August 30, 2005, 09:58:39 AM
Alright, everything works as far as this tutorial bit supplies. Thanks everyone.

Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: LimboWoman on September 25, 2005, 11:11:29 PM
gah! where do i get the latest NI beta?? I can't find it!
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Ghreyfain on September 25, 2005, 11:27:25 PM
Here, in general:
Infinity Engine Modlist - Tools (http://modlist.pocketplane.net/index.php?ax=list&sub=37&cat_id=37)

And here, specifically:
Near Infinity (http://www.idi.ntnu.no/~joh/ni/download.html)
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: LimboWoman on September 25, 2005, 11:31:33 PM
thanx
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: LimboWoman 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??
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Grim Squeaker 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'.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: cliffette 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.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Usually Lurking 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!
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Ghreyfain 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?
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Usually Lurking 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.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Kismet on October 13, 2005, 06:13:17 AM
Is f1gartk the .cre file name?  Can you CLUA him into the area?
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Usually Lurking 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.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Ghreyfain 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.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Usually Lurking 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?
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Ghreyfain 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.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Usually Lurking 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
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Bons 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.
 
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Usually Lurking 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
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Usually Lurking 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.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Bons on October 14, 2005, 11:13:55 PM
~Edited out gibberish.~

Try EscapeAreaMove instead of MoveBetweenAreas, though I'm clueless why that wouldn't work. I know EscapeAreaMove will work since I used it in Hessa. It's just the escape part is kind of silly when the NPC isn't even visible.

Thought about it some more and realized why it doesn't work. It has to be used in conjunction with ActionOverride, so we can specify the object to move. I.e., your NPC doesn't move because this is in an area script, not a script assigned to the NPC. Without ActionOverride, it's like saying "Move X Here." ActionOverride lets you define X.

So instead of MoveBetweenAreas("AR0305",[758.799],13), use ActionOverride("F1GARTK", MoveBetweenAreas("AR0305",[758.799],13))

I will edit my original code.

Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Usually Lurking on October 15, 2005, 12:10:22 AM
@ Bons -Genius, sheer genius!  ;D
I did have to change it to his DV but fired right up and there he was.  Just to be safe I even loaded a save game from Ch6 and he still showed up. YEA!  Again thanks for all your help it is GREATLY appreciated.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Qwallath on December 30, 2005, 07:27:27 AM
I've worked through the whole tutorial now, and it feels as though I've got most of it down pretty well.

One problem though, when trying to install my humble package, I get a Parsing error in WeiDU:

[RuntyNPC\QWRunty.d] PARSE ERROR at line 32 column 59-60
Near Text: DO
        syntax error

I understand the problem is in the DO command in line 32 in my .d dialog file. Here it is for comparison (Line 31-34 that is):

IF ~~ THEN BEGIN Join
SAY ~Alright. You look like an OK bunch to me. Let's go.~ DO ~SetGlobal("RuntyJoined","LOCALS",1)
JoinParty()~ EXIT
END

So, what's wrong in my dialog syntax?

thanks for any and all help, Q.



     


Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: jastey on December 30, 2005, 10:26:51 AM
It should be

IF ~~ THEN BEGIN Join
SAY ~Alright. You look like an OK bunch to me. Let's go.~
IF ~~ THEN DO ~SetGlobal("RuntyJoined","LOCALS",1)
JoinParty()~ EXIT
END
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Qwallath on December 30, 2005, 01:16:29 PM
Yep, that did the trick. Thanks!
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Flameswing on January 24, 2006, 12:24:55 AM
I apologise in advance for my noob of a question, but how does one get an NPC to interact with other NPCs.....for example, if i wanted my new NPC Fiero to talk to Aerie, what would the necessary command be?
If anyone still answers these posts and knows the answer, please reply or feel free to email me with tips at flameswing@hotmail.com

NB: If you email me, please title the subject of the email, or else i may just delete it.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Bons on January 24, 2006, 10:14:43 PM
I apologise in advance for my noob of a question, but how does one get an NPC to interact with other NPCs.....for example, if i wanted my new NPC Fiero to talk to Aerie, what would the necessary command be?

From the tutorial at the start of this thread:

Quote
// interdia.2da is a bit simpler, but acts the same as pdialog.2da.  It adds the NPCs banter file, which is used for inter-party banter, and romance dialogues.

APPEND ~interdia.2da~
~J#VondoTheJust J#VondoB J#VonB25~
UNLESS ~J#VondoTheJust~

This is the block needed in the tp2 when you install your mod that will add a new entry for your NPC to the table that tells the game engine where to look for the NPC's banter. The basics of how to code NPC banter are available in Blue's tutorial (http://forums.pocketplane.net/index.php/topic,61.0.html) which is stickied at the top of this tutorial forum.

Beyond that, if you want your NPC to start talking to Aerie without waiting for the game's banter timer to kick in, one of the simplest ways would be to include in the NPC's script (Once you've set up an entry for your NPC in interdia.2da and coded the dialog between the two NPCs):

IF
          InParty("Aerie")
          See("Aerie") //These check to see if Aerie is around to talk to your NPC
          Global("FieroTalkToAerie","GLOBAL", 0)
THEN
     RESPONSE #100
          SetGlobal("FieroTalkToAerie","GLOBAL", 1)//Setting this variable will make sure the talk doesn't repeat in a loop
          Interact("Aerie") //'Interact' is the command will make the game look at your NPC's banter file for the next valid thing to say to Aerie.
END

Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Patty on March 08, 2006, 03:42:47 PM
Yay yay yay!!!  I got it to work!

Thanks for the tutorial.  I couldn't have done it without you.  I mean that.  I could barely do it with you.  :-\

Patty
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Ghreyfain on March 09, 2006, 03:16:09 AM
Cool. :)
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Biubid_boy on March 09, 2006, 05:38:32 AM
Sorry if this is resurecting this post, but I can't seem to get it working right. I think I must have a bad .cre file, although I've done it and redone it at least 5 times. Everything works great, but when I go into a new game and try to talk to my NPC, he seems to already be under my control (he has a green circle) but I can't give him commands, it just comes up with a talk symbol. When I try to talk to him, it says 'Hur'ak does not want to talk to you' and Hur'ak is my main characters name, not the NPC's. Also, when I leave my cursor over him, instead of his name, I get a blank scroll. Thanks in advance,
Biubid_boy.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Kismet on March 09, 2006, 02:10:44 PM
Your NPC .cre file is probably flagged as PC.  This should be changed to neutral.  Also, it shouldn't be flagged as "export allowed". 

Did you assign him a name via a .tp2 file?
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Patty on March 09, 2006, 05:21:47 PM
Is there some way to make my NPC approach Player1?  Like a IF (range,6) then do (?) kind of thing?

Thanks,

Patty
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Ghreyfain on March 10, 2006, 01:08:50 AM
Yeppers. This should probably help: http://forums.pocketplane.net/index.php/topic,16217.0.html
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Biubid_Boy on March 10, 2006, 03:08:02 AM
I tried your advise, but everything remained the same. If it helps, one of the times I remade him, when I talk to him, he said some random leaving stuff that someone said could have been caused by 'expot allowed' being checked (it isn't). 
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Grim Squeaker on March 10, 2006, 04:25:53 AM
Did you use the same game in every case?  A saved game once the character had already been spawned?  If so, you should know that creatures are saved into the saved games.  So any changes you are making aren't affecting that saved game.  You need to use a game before the creature spawned if you want to see the effects.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Biubid_boy on March 10, 2006, 11:26:50 PM
Got it to work! Can someone please tell me how to change the portrait, name and bio in WeiDU?
Thanks for your help so far,
Biubid_boy.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Grim Squeaker on March 11, 2006, 06:42:41 AM
Got it to work! Can someone please tell me how to change the portrait, name and bio in WeiDU?
Thanks for your help so far,
Biubid_boy.

Nice and easy.  When you copy your CREs into the game you just use some SAYS and a WRITE_ASCII for the portraits
e.g.
Code: [Select]
COPY ~Jelina/Creatures/G#JLNA7.cre~ ~override/G#JLNA7.cre~
     ~Jelina/Creatures/G#JLNA8.cre~ ~override/G#JLNA8.cre~
     ~Jelina/Creatures/G#JLNA9.cre~ ~override/G#JLNA9.cre~
     ~Jelina/Creatures/G#JLNA10.cre~ ~override/G#JLNA10.cre~
SAY NAME1 ~Jelina~
        SAY NAME2 ~Jelina~
        SAY BIO ~When asked about her past, JELINA...~
        WRITE_ASCII PORTRAIT_SMALL ~G#JLINAS~
        WRITE_ASCII PORTRAIT_LARGE ~G#JLINAM~

Hope that helps.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Biubid_boy on March 11, 2006, 07:21:15 AM
Thanks! Just one question. The SAY command worked fine here but when I try to make a kit using WeiDU it gives a parse error on SAY? SAY1 seems to work fine...
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Biubid_boy on March 11, 2006, 07:28:27 AM
What the? When I removed the SAY's from my kit code, I got a parse error for COPY. Whats with that?
Sorry for the double post,
Biubid_boy.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: the bigg on March 11, 2006, 07:30:51 AM
Try posting your code.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Biubid_boy on March 11, 2006, 04:41:10 PM
Ok, here goes.

Quote
BACKUP ~Smith/backup~
AUTHOR ~Biubidboy@gmail.com~
BEGIN ~Smith Fighter Kit for BGII~

ADD_KIT ~C#Smith~
//weapons
~C#Smith 1 1 1 1 1 1 1 1~
~C#Smith 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 3 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5~
// STR DEX CON INT WIS CHR
~C#Smith 15 0 9 13 0 14~
~C#Smith 0 1 -1 0 0 0~
~C#Smith 0 0 0 0 0 0~
~C#Smith 0 0 0 0 0 0~
//alingments
~C#Smith 0 0 1 0 0 1 0 0 1~
// dualcass
~C#Smith 0 0 0 0 0 0~
// 2da
~C#Smith.2da~
~K_F_D~
// unusable and class
~0x00040009 2~
// high level abilities
~LuFi0.2da~
// description
SAY ~ dwarven smith~
SAY ~Dwarven Smith~
SAY ~Dwarven Smith: The Dwarven Smith is as good with the tongs and anvils as he is with a sword. They are volitile characters, but firm in their beliefs, be it evil or good. They have fine hand-skills, but over-use of their armour has weakened their hide in comparison to their bretheren.   

Advantages:
-Gain Smith Weapon. This will create a magical +3 weapon in the inventory of the Dwarven Smith. The weapon can be either a Long Sword, Short Sword, Mace or Axe. This spell can only be used once a day.
-Gain Smith Armour (Works like ghost armor)
-Plus 1 to Dexterity

Disadvantages:
-Cannot use ranged weapons.
-Must be a dwarf.
-Must be a chaotic allignment.
-Does not gain an extra constitution point like other dwarves.
~

//special abilities
COPY ~RYMAAN1.SPL~ ~override/RYMAAN1.SPL~
SAY NAME1 ~Smith Weapon~
COPY ~RYMAAN2.SPL~ ~override/RYMAAN2.SPL~
SAY NAME1 ~Smith Armor~
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Grim Squeaker on March 11, 2006, 05:51:42 PM
And where is WeiDU saying the error is?

Edit: Comparing your code with Cam's code (http://forums.gibberlings3.net/index.php?showtopic=898) this bit looks wrong:

Quote
// high level abilities
~LuFi0.2da~
.

I don't think you want the .2da bit.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Biubid_boy on March 11, 2006, 06:19:21 PM
I get a parse error for SAY ~ dwarven smith~.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Grim Squeaker on March 12, 2006, 04:31:46 AM
I get a parse error for SAY ~ dwarven smith~.

Again, comparing your code with Cam's, you seem to have missed out the ToB equipment line.  In his example:

Quote
~CHAN09 * HELM07 BAG20 RING06 RING31 * BOOT01 AMUL19 BRAC16 BELT06 AROW11,40 BULL03,40 BOLT06,40 POTN52,5 POTN4,2 POTN14,5 HAM07 SW1H27 STAF08~

This should appear the line before the SAYs and thats probably why WeiDU is throwing an error as it isn't expecting the SAYs yet.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Biubid_boy on March 12, 2006, 05:15:00 AM
Thanks for that! I retried compiling it and I got an error for my custom .2da file. It currently reads:
Quote
2DA V1.0
*
           Column1    Column2   
ABILITY1   GA_RYMAAN1 ****       
ABILITY2   ****       GA_RYMAAN2

It was made in DLTCEP. The error I get is:
Quote
ERROR: Unix.Unix_error(20, "stat", "C#Smith.2da")
Sorry for talking so much about kits in an NPC tutorial, I just don't want to start on the Kit Creation thread when it has been dead for so long.

Biubid_boy
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Biubid_boy on March 12, 2006, 06:23:15 AM
Sorry, I found out the error was becuase of an incorrect path. ::)

Now a new problem has arrisen for me. I successfully made my mod! But when I tried to make a theif kit, my game crashes everytime I get to skills on the character creation page. Here's my code:

Quote
BACKUP ~EnforcerKit/backup~
AUTHOR ~Biubidboy@gmail.com~
BEGIN ~Smith Fighter Kit for BGII~

ADD_KIT ~C#Enforcer~
//weapons
~C#Enforcer 1 1 1 1 1 1 1 1~
~C#Enforcer 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1~
// STR DEX CON INT WIS CHR
~C#Enforcer 3 13 3 3 3 3~
~C#Enforcer +1 -1 +1 -2 0 -3~
~C#Enforcer 0 0 0 0 0 0~
~C#Enforcer 0 0 0 0 0 0~
//alingments
~C#Enforcer 0 1 1 1 1 1 1 1 1~
// dualcass
~C#Enforcer 0 0 0 0 0 0~
// 2da
~EnforcerKit/Enforcer.2da~
~K_T_H~
// unusable and class
~0x00008000 4~
// high level abilities
~LuFi0~
//equipment
~~
// description
SAY ~enforcer~
SAY ~Enforcer~
SAY ~Enforcer: An Enforcer is a character less proficient at the finery of theiving. More burly than the the average shady character, they can intimidate most commoners and creatures alike. They may even be referred to as thugs. But the fact remains, the Enforcer is good at what they do. 

Advantages:
-Gain Underhanded Blow. Gives the Enforcer 1 turn to give the enemy an underhanded blow. The shot deals 1 D10 damage to the next creature the Enforcer hits. A miss will waste the ability.
-Gain Intimidate. All enemy creatures around the Enforcer must make a save-versus-spell or flee. Lasts 1 turn. Undead and other magical creatures are immune.
-Plus 1 to Strength and Constitution. 

Disadvantages:
-Minus 1 to Dexterity.
-Minus 2 to Intelligence.
-Minus 3 to Charisma.
-Must be human.
 


//special abilities
COPY ~EnforcerKit/ENFORCER1.SPL~ ~override/ENFORCER1.SPL~
SAY NAME1 ~Underhanded Blow~
COPY ~EnforcerKit/ENFORCER2.SPL~ ~override/ENFORCER2.SPL~
SAY NAME1 ~Intimidate~
Any help you could give would be great,
Biubid_boy.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Crevan the Liar on March 12, 2006, 04:09:29 PM
Question: the only copies of Weidu I can find are for a Mac.  Where can I find this Weidu.exe that you refer to? (a PC version)
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Grim Squeaker on March 12, 2006, 04:23:59 PM
Question: the only copies of Weidu I can find are for a Mac.  Where can I find this Weidu.exe that you refer to? (a PC version)

www.weidu.org
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: KingMick on March 13, 2006, 08:37:07 AM
Hmmm, I have followed this tutorial very carefully in creating a new NPC, though of course I have changed the necessary things to create the NPC I wanted, not Vondo.  After fixing a few of my own stupid mistakes I've been able to get WeiDU to install it correctly.  Eager to see how well it worked, I loaded up a saved game in BG2 and ran off to Waukeen's Promenade, where my NPC is supposed to appear near the Adventurer's Mart...and the game crashed as soon as I got to the Promenade.  This happens every time I try.

I am confused about why this is happening.  I followed everything to the letter.  The only significant things I did differently was add more sounds to the NPC and change the location to Waukeen's Promenade (besides making the character a mage instead of a paladin, anyway).  Does it matter that I never created a "J#Vondo.bcs" file?  (Obviously I would use the name of my own NPC, instead of J#Vondo)  I didn't see anything in the tutorial about actually creating this file, so I didn't create it.  But I did assign the Override script to the name I'd have used if I did create it.  For the General Script I used shoutdl2.bcs, and for the Default Script I used wtasight.bcs.  The dialog option is set correctly to the dialog file I created, and the "Export allowed" flag is unchecked.

I cannot figure out what the problem is, unless it is the missing <NPCNAME>.bcs file--and if it is that, then I'm not sure how to go about making such a file.

Why does my game keep crashing?  ???
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Kismet on March 13, 2006, 09:16:52 AM
Does the game crash if you summon your NPC manually?  If so, there's probably something wrong with the .cre file or with items on the NPC.

To make a .bcs file, you'd create a .baf (plain text file) and compile it via your .tp2 file.  There's a scripting guide around here somewhere.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: KingMick on March 13, 2006, 03:52:43 PM
Summon the NPC "manually"?  I have no idea what that means...

Yeah, I tried experimenting with a .baf file to make the script but it generated an error.  I'm still pretty new at this :)
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Grim Squeaker on March 13, 2006, 03:59:16 PM
Summon the NPC "manually"?  I have no idea what that means...

Yeah, I tried experimenting with a .baf file to make the script but it generated an error.  I'm still pretty new at this :)

Manually means using the CLUA Console (just search for it here or on google to find out how to use it) to CreatureCreature("Foo")

Using .bafs is basically the way to make scripts so its one of these things you have to get used to.  When WeiDU throws an error compiling it, its worth looking at what the error says.  It should say where in the code there is a problem and see if you see anything wrong.  If you still can't fix it, post it here with the error and we'll have a look.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: KingMick on March 13, 2006, 09:20:16 PM
Hmmm, I will try the CLUA thing.  I hesitate to post the cre file here since the NPC is rather...well-known, shall we say...and I want it to be a surprise if I ever get the mod good enough to release ;)
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: KingMick on March 13, 2006, 09:31:36 PM
Ok, I just tried the CLUA method, and it just says "lua: call expression not a function."  I tried to use it to create other Creatures--namely Jan and Viconia, who were not currently in the group--and still got the same error message.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Ghreyfain on March 13, 2006, 09:54:33 PM
It's case sensitive.

CLUAConsole:CreateCreature("filename")    This is the only way it'll work.

CluaConsole:CreateCreature("blah")
CLUACONSOLE:createcreature("yadda")
etc.               These won't work.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: KingMick on March 14, 2006, 02:30:27 AM
Ok, I tried the CLUAConsole thing, and this time instead of just the game crashing, the whole computer froze up and I had to reboot.

I noticed something else strange, too.  I found the correct files in the override folder, but the dialog file ended with .d.dlg, not just .dlg.  In other words, if this were Vondo, the file would read J#Vondo.d.dlg.  Is that what it's supposed to look like?

Even if that's incorrect, I doubt it would be the dlg file giving me the problems since the game crashes when it tries to load the cre, not when I initiate dialog.  Do you guys think it is because the script assigned as overrride script (J#Vondo.bcs in the tutorial) doesn't actually exist?  If that's the case, could someone tell me how to create a basic empty "filler" script so that the game won't crash.  As I said before, I am brand new at this.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Grim Squeaker on March 14, 2006, 02:32:52 AM
If its crashing when you create your NPC I would guess that there is a bug in your CRE.  When that happens BG2 seems to react rather badly to it...
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: KingMick on March 14, 2006, 09:22:51 AM
Ugg.  Problem is, I can't figure out what the bug is.  I've deflagged the export option, I've entered the proper script names under General and Default, I gave it a Death Variable and assigned the appropriate dialog file.  The cre is a converted CHR file created by starting the game, saving it, and editing it using Shadowkeeper.  The only out-of-the-normal thing that I did was grant the character 65% pickpocket (he is a single-class mage so this is abnormal).  Beyond that, the only thing I used Shadowkeeper for was raising his level to 9, giving him a whole lot of new spells (all straight from SoA), and adjusting things like HP and Saving Throws to the appropriate numbers for his new level.

I can't figure out what the problem is, and as I said before I'd rather not upload the CRE here (not even sure if I can), because I want this mod to be a bit of a surprise.

Ummm...Hey Grim, is there any chance I can email you the CRE file and have you look at it and try to figure out what's wrong (and not tell anyone who the NPC is until it actually is finished and put up for download)?  Pretty please? ;D ;D ;D ;D
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Grim Squeaker on March 14, 2006, 11:08:46 AM
Ummm...Hey Grim, is there any chance I can email you the CRE file and have you look at it and try to figure out what's wrong (and not tell anyone who the NPC is until it actually is finished and put up for download)?  Pretty please? ;D ;D ;D ;D

Were it that simple yes I would.  However, unless its something blatently obvious you can't just glance at a CRE and tell whats wrong as they are very, very complex files.  Also, I am extremely busy at the moment with university so don't really have the time.  Sorry.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: taplonaplo on March 14, 2006, 04:26:23 PM
my 2 guesses: 1. u use invaild colors for major, minor etc. if u set them extra onesn (via dltcep,ni,shadowkeeper) try to set them back to normals
                    2. u edited spell memorization (it caused crash when i tried to remove them in NI)
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: flameswing on March 14, 2006, 05:09:32 PM
Greetings, oh modding legends! i have 2 questions.
1. This is my recently added line which the installer doesn't like. =
BEGIN Kaila
IF ~NumTimesTalkedTo(0)~ FirstMeeting
SAY ~Y-you've come to help me? No? Please! Don't go! I-I need...help. I need-(Her needs are not made apparent, as she falls at your feet in a dead faint.)~
++~Come on, everyone. We haven't the time for her. (You step over the girl's body and gesture for your followers to do the same.)~ + AerieProtest
++~(You remove your cloak and drape it around the girl and watch her for a while.)~ + ThankYou
+ ~InParty("Jaheira") + ~We'll carry her, Jaheira. To the Temple.~ + Temple <<<< It doesn't like this line... the WeiDU Installer wants me to edit 'We' but I know that's not the problem.
END

2. Before adding those touches, i made sure i could get Kaila into the game...she popped up fine and joined my party etc, but when scrolling over her portrait, where it usually says the NPC's name and hitpoints, it was blank.....any ideas?
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Grim Squeaker on March 14, 2006, 05:15:15 PM
You missed the tilde off the end InParty("Jaheira").  When it tells you that a word is a problem like that its worth checking just ahead for missing tildes.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: KingMick on March 14, 2006, 05:49:15 PM
thanks taplonopa, I will try those things
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: KingMick on March 14, 2006, 06:24:14 PM
Okay, taplanopla was right on the money--turned out I had an invalid skin color for the NPC.  Thanks taplanopla!  But now I have another problem.

Now the NPC loads just fine in the correct area, but when I go talk to him it says "Bob - has nothing to say to you."  BTW I am replacing my PC's name with Bob, not my NPC.  I don't know why it won't initiate the correct dialog file, I have checked the CRE and it has the correct filename under "Dialog".  I'm not sure what I did wrong.

Also, when I put the mouse cursor over the NPC and wait for the auto-caption, it comes up empty, without the NPC's name.  How do I change this?

Any ideas?
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Kismet on March 14, 2006, 06:44:09 PM
Has the correct dialog file been compiled and is it in the override directory?

Did you assign his name in the .tp2 file? 

i.e. COPY ~mymod/mycre.cre~  ~override/mycre.cre~
  SAY NAME1 ~Bob~
  SAY NAME2 ~Bob~
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: KingMick on March 14, 2006, 06:47:15 PM
Yes and yes.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: KingMick on March 14, 2006, 06:59:09 PM
Two other little things I just noticed.  First, sometimes when I approach the NPC on the map (before I talk to him but after I see him), he says "My casting has been interrupted" as if...well, as if his casting had been interrupted.  But he shouldn't have been casting a spell at all.  (Is my NPC trying to have a mind of his own?! :o )

The second thing is that I looked at the interdia.2da and pdialog.2da files in NI, and the entries for my NPC look different from the entries for the game's NPCs--the game's NPCs are all in caps and separated by tabs.  Mine are like the tutorial's--both upper and lowercase, and separated only by single spaces.  Does that make a difference?

EDIT: There was a third problem here, but I just fixed it on my own.  Still trying to get the NPC to talk to me, though...
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: flameswing on March 15, 2006, 03:12:55 AM
Sorry guys, Flames again. Firstly, thanks for all the help + great tutorial so far.
Ok. My first query is also about the name not appearing on portrait, or in dialogue boxes (and yes, her name is in the TP2. file.) Any ideas?
Next thing is my NPC asks for help and then passes out. You can tell Jaheira to help carry her to the temple which is all of 10 steps away, and the command i have successfully installed itself and worked. My problem is, only the NPC player moves. How can I get the whole party to move as well?
Here is the command that worked.

BEGIN Kaila
IF ~NumTimesTalkedTo(0)~ FirstMeeting
SAY ~Y-you've come to help me? No? Please! Don't go! I-I need...help. I need-(Her needs are not made apparent, as she falls at your feet in a dead faint.)~
++~Come on, everyone. We haven't the time for her. (You step over the girl's body and gesture for your followers to do the same.)~ EXIT
++~(You remove your cloak and drape it around the girl and watch her for a while.)~ + ThankYou
+ ~InParty("Jaheira")~ + ~We'll carry her, Jaheira. To the Temple.~ DO ~MoveBetweenAreas("AR0408", [442.399], 0)~ + Temple
END

Ok, last question (quit rejoicing). With my first option there ++~Come on, everyone. We haven't the time for her. (You step over the girl's body and gesture for your followers to do the same.)~ EXIT
How can i get...say....Aerie...(should she be in the party) to interrupt and say something like how heartless the player character is? i tried the CHAIN thingo that Blue wrote and some commands in the Scripting Quick Ref, but I'm lost.
Thanks for your time guys.
Hail ModGods....from Flames/Australia!
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: taplonaplo on March 15, 2006, 04:03:35 AM
KingMick:about the name, i think the problem is that the npc doesn't have death variable, but it's not for sure EDIT: that's false
flameswing: u do this with " THEN EXTERN " but i don't know how to use it =(
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Grim Squeaker on March 15, 2006, 04:11:44 AM
The name issue should be completely unrelated to what you did or didn't do with the deathvariable.  You said that you use the tp2 to assign the name, right?  However, are you using a saved game where your CRE had already spawned but was BEFORE you added the name with the tp2?  Because CREs are stored locally in a saved game i.e. once they've spawned into a game no matter what you do to the CRE in the override, the one in that particular saved game won't change at all.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: taplonaplo on March 15, 2006, 04:14:51 AM
srry,  so then the name that is shown is the "Short Name" (in dltcep)?
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Grim Squeaker on March 15, 2006, 04:25:28 AM
srry,  so then the name that is shown is the "Short Name" (in dltcep)?

I really don't know which name out of NAME1 and NAME2 is displayed in game as all modders tend to have them as the same thing.  But its definitely one of them and nothing to do with the death variable.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: taplonaplo on March 15, 2006, 07:00:12 AM
sorry again,the thing that confused me was that i thought short name does not appear in game so i set it to the same as dv :(
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: KingMick on March 15, 2006, 07:56:02 AM
I got the name issue worked out.  The problem (for me, at least) is that when you write the tp2 you have to have all of the SAY lines directly after the COPY line for the CRE file in question.  You can't have an extra line in between, even if it is a blank one.  I've got the name now.

Unfortunately I still have the other problem I mentioned--when I click on my NPC, it still says he has nothing to say to me (only now it uses his name instead of mine).  I don't get it.  Here is the relevant part of the tp2 file copied.  I have changed the name of the NPC so as to preserve the surprise (if I ever get it to work)

COMPILE ~Frank\KM#Fran.d~

EXTEND_TOP ~Ar0700.bcs~ ~Frank\AR0700.baf~

APPEND ~interdia.2da~ ~KM#FRAN     BKM#FRAN~
UNLESS ~KM#FRAN~

APPEND ~pdialog.2da~ ~KM#FRAN      KM#FRANP           KM#FRANJ          KM#FRAND~
UNLESS ~KM#FRAN~

This differs only slightly from the tutorial example--I found that other custom NPCs, including one which I believe is by the tutorial author himself, had more than one space between fields for the 2da files.  I used the proper amount of spaces to make it appear even with the columns.  This, however, did not fix the problem.

KM#Frank.cre has KM#Fran in the Dialog field (using NI), and KM#FRAN.dlg is in the override directory.  I checked the dlg itself in NI and it looks fine--all the appropriate topics and responses are there.  KM#FRAN is also listed as the Death Variable. This is driving me nuts--as far as I can tell it should work, does anyone have any idea at all what I may be doing wrong?
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Kismet on March 15, 2006, 08:01:48 AM
Are all the conditions met for the first dialog? 

IF ~SomeConditionsHere~ THEN BEGIN firstdialog
SAY ~blah~
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: taplonaplo on March 15, 2006, 10:21:52 AM
does pc refer to the main character or any party member? (in scripts) btw, if u click on the npc and it uses initdlg.bcs, will it say  ...- has nothingto say to you (but the dialogue will start when it comes near enought)?
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Kismet on March 15, 2006, 10:34:47 AM
PC refers to any party member.  If you want the main character then use player1.  I don't know about initdlg.bcs, what does the script say?
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: KingMick on March 15, 2006, 04:32:24 PM
I'm not using initdlg at all, I'm using shoutdl2, the tutorial said that was the one to use if you want the player to have to initiate the dialog.

Yes the conditions are met--in fact there are none at all.  Does that make a difference?  In the interest of keeping things simple, I decided to have the exact same dialog play through every time you talk to the NPC (before joining, anyway), so I didn't bother with NumTimesTalkedTo or NumTimesTalkedToGT.  The beginning of the .d file simply says:

BEGIN KM#FRAN

IF ~~ THEN BEGIN MeetingFrank
SAY ~blah~
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Kismet on March 15, 2006, 04:51:28 PM
That's your problem then, you need to have a condition in the first state everytime you want to start a dialog.  If the dialog stays the same before joining then just try using IF ~True()~ THEN BEGIN etc.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: KingMick on March 15, 2006, 07:45:29 PM
<Does a dance> Success!  Woo-hoo!  It worked it worked it worked it worked!  Thanks Kismet!

Ok, so now he is in the party and everything is working great.  There are a couple small things I would like to change if possible, and I'm not sure quite how.  If anyone knows how, awesome.  If not, well hey, at least the NPC is functioning correctly now :)

(1) He calls out to me as soon as he sees me.  I'd rather make it so that the player must initiate the dialog himself.  Neither shoutdl2 nor initdlg accomplishes this--which script should I use?

(2) Ummm, the Monster Summoning I spell has no graphic in his spellbook.  It's there, it can be memorized, works great, but the graphic itself is not there, just an empty area.  Anyone know how to fix that?

(3) I want him to be a mage, not a thief/mage, but it would be nice to give him the Pick Pockets ability.  I tried assigning this in Shadow Keeper and it appears to have carried over into the CRE, but in the game itself he does not have the thieving icon, nor does Pick Pockets appear in his record screen.  If this is impossible (or really hard) then I will abandon the idea.  If there is a very easy way to do it, though, then I'd like to.

(4) Is there any way to give him an abnormal skin color?  By this I mean, a skin color not normally available at all, like silver or gold or green.  I tried this from Shadowkeeper but it caused a game crash.

(5) MOST IMPORTANTLY: How do I make a new paperdoll (inventory screen avatar) for the character?  I want him to look like the human mage paperdoll, but with no beard, and if possible longer hair.  Even if this takes some work, I'm willing to put in the effort.  This NPC is human but should definitely not have a beard.

Thanks again for everyone's help!  The most important change I want to make is #5, the paperdoll.  The others would be nice but are not essential.  Most importantly, thanks guys for helping me get this NPC to function properly.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Kismet on March 15, 2006, 08:41:39 PM
1. Don't use any script.
5. I believe Moinesse did this for Kelsey so you might want to check his page for links/downloads.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Grim Squeaker on March 16, 2006, 07:45:24 AM
1. Like Kismet said
2. Is this the original spell or some tinkered version of yours?
3. Impossible.  The only way to have a pick pockets icon on their bar is to have them be part Thief or part Bard
4. Some of these are possible, but as you already discovered once you go poast a certain number then it causes the game to crash
5. Like Kismet said, however I believe its impossible to do for just one NPC.  You'd end up replacing an entire paperdoll.  Someone correct me if I'm wrong.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: KingMick on March 16, 2006, 08:03:42 AM
Hmmm, ok.  No, the spell is the original spell.  Specifically I want the NPC's skin to be gold-colored, or as close to gold as possible.  Is there a good color index for that?  As for picking pockets, no problem, that was just a fun little bonus I wanted to throw in, not necessary for this NPC.

Re: the paperdoll--there is one paperdoll already in the game that would be PERFECT.  If I could change the NPC's paperdoll and avatar to one of the elven mage ones, it would be ideal--specifically, the one with the hood covering the top half of the head.  This one is absolutely perfect--it looks exactly like I have always envisioned this NPC.  Problem is, he has to be a human mage, not an elven one.  Is there anyway at all I can have his avatar and paperdoll changed (but not change the avatar/paperdoll for human mages in general?)  I suppose if I had to change the generic human-mage avatar/paperdoll that wouldn't be so bad; the only other NPC it would affect would be Edwin.  I want this avatar/paperdoll to be used all the time, though, not just when he has a specific type of robe on.

Any thoughts?  Perhaps if I create a special kit for him?  Would that change anything?  If absolutely necessary, just knowing how to make a patch that changes the human-male-mage avatar/paperdoll to that of an  elven-male-mage would be sufficient, provided I can make it universal regardless of the NPC's robe.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: taplonaplo on March 16, 2006, 08:27:09 AM
correct me if i'm wrong but if you change the animation in shadowkeeper your paperdoll will be affected too . I remember reading something about "avatar morphing script" that was meant to do something familiar but i couldn't get it work (in tutu)
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: KingMick on March 16, 2006, 08:58:14 AM
I'll definitely have to take a look at that.  There are some things I need to fix about the original CRE before I can release this anyway.

And speaking of releasing this...um, how can I do that? Is there a way to release it here on Pocket Plane, or if not, does anyone have any other recommendations.  Of course here would be my first choice since this is where people have been helping me out, but I get the impression that all the mods here on this site are by a specific group of people.  Is there, perhaps, someone I can email here at PP about perhaps putting this mod up for download?  Granted it is fairly small (I'm adding banters now, and there are still no interjects) but it will grow and in the meantime, the sheer fame of this particular NPC should draw at least a FEW downloads :D.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: KingMick on March 17, 2006, 12:04:34 AM
Whew, thanks for everyone's help!  The "alpha" version of this mod is now available--the joinable NPC, custom portrait and soundset, dialogs and several banters.  More will be coming soon.  You guys really helped me a lot so please have a look at the mod and tell me what you think!

The character is none other than Raistlin Majere of the Dragonlance novels :). The file is at: http://creek-stone.tripod.com
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Biubid_boy on March 17, 2006, 06:39:47 AM
I'm back! And still making an NPC. Everythings ready, but theres a problem with my tp2 file. If I put the sound setup code first in my file, only the sound, not the portrait works. If I put the potrtait code first only the portrait works. How do you get both to work?
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Grim Squeaker on March 17, 2006, 07:13:15 AM
I'm back! And still making an NPC. Everythings ready, but theres a problem with my tp2 file. If I put the sound setup code first in my file, only the sound, not the portrait works. If I put the potrtait code first only the portrait works. How do you get both to work?

This kind of code will work:

Code: [Select]
COPY ~Jelina/Creatures/G#JLNA7.cre~ ~override/G#JLNA7.cre~
     ~Jelina/Creatures/G#JLNA8.cre~ ~override/G#JLNA8.cre~
     ~Jelina/Creatures/G#JLNA9.cre~ ~override/G#JLNA9.cre~
     ~Jelina/Creatures/G#JLNA10.cre~ ~override/G#JLNA10.cre~
SAY NAME1 ~Jelina~
        SAY NAME2 ~Jelina~
        SAY SELECT_ACTION1 ~Stuff~ [FILENAME]
        // SAY the various other lines
        WRITE_ASCII PORTRAIT_SMALL ~G#JLINAS~
        WRITE_ASCII PORTRAIT_LARGE ~G#JLINAM~

Just don't have any blank lines inbetween stuff.  Or is that not what you meant by sound and portrait code?
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: KingMick on March 17, 2006, 09:17:10 AM
Oooh, ooh, ooh, I can answer this one too!

The way I did it was to change the portrait in the CRE file itself. My method was to create a character, then use Shadowkeeper to edit it and (among other things) change the portraits, both large and small.  That way in the tp2 file I didn't have to mention the portrait at all, just the sounds.

That might work for you too :D
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: taplonaplo on March 17, 2006, 01:21:58 PM
oks, i test it in a minute.
You should create a backup folder in the RaistlinMajere folder, for safety reasons. that's the most important imo
btw, my name is taplonaplo :)
ok a few things: the portrait is stored in the override or portraits folder so you HAVE to copy it too
it uses the "well then" sound too instead of the "You can rest assured that *I* am still loyal."
it would be nice if he had some spells memorized
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: KingMick on March 17, 2006, 03:34:41 PM
Thanks tap! Did I spell your name wrong?  I didn't realize I forgot to copy the portrait, I will do that right away, and fix the soundset as well.  He has no spells memorized because he just got here from the spirit world :).  I suppose I need to explain that in the dialog though, so I will edit that as well.

EDIT: The portraits are now included and the sound bug is fixed :). Thanks taponapla!

As soon as I can figure out how to do interjects I'll be adding some of those.  I just found out there are already some people from Dragonlance in the game (Knights of Solamnia in the Sphere) so I am dying to add a Raistlin conversation there, plus I can't wait to add the banters with the PC.

Speaking of banters, I have more questions.  I recently downloaded Xan for BG2 (and I love it, it's a great mod), but I notice that in testing the two NPCs, Xan has already done 3 banters, while Raist has not done a single one. I am a little worried that his banters may not be working.  Any advice?

The other question has to do with the PC banters I am trying to add. I want Raist to talk to the PC, just like the other NPCs do, but I can't get it to work. I've been using <IF ~Global("WeAlreadyTalkedAboutThis","LOCALS",1)~ THEN BEGIN RaistTalks1> type statements like the ones in this tutorial, only placed in the banter file instead of the initial dialogue file.  The PC banters are located after all the CHAINs for the NPC banters.  But WeiDU encounters a problem right at the first IF. Any ideas?
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: flameswing on March 18, 2006, 08:25:29 AM
hokay. sorry to bother yet again. i need something explained please. Now, to whoever answers this, thanks heaps. Please explain it in really simple terms, as though to a REALLY slow child. (Witness Flames -16 y/o australian.... believe me, it NEEDS to be simple)
1. interdia.2da and pdialogue.2da.....do i actually need files named those things in order for the banter to work? If so, exactly what should i put in it? if not.....what is their purpose??
2. Name still not working, so i'm probably going to start the NPC from scratch *sigh*
3. anyone know how to use THEN EXTERN.....couldn't quite figure it out.....because should the PC decide to be an ass i was thinking of having Aerie have a whinge....in the initial dialogie before my NPC joins the party.(refer to stupid child thing again)
4. Last one. Moving my entire party. I know i asked this before, but i didn't realy get an answer. i can get my NPC to move, but not the party.....any ideas?

Alright. Cheers everyone.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Kismet on March 18, 2006, 09:56:40 AM
The other question has to do with the PC banters I am trying to add. I want Raist to talk to the PC, just like the other NPCs do, but I can't get it to work. I've been using <IF ~Global("WeAlreadyTalkedAboutThis","LOCALS",1)~ THEN BEGIN RaistTalks1> type statements like the ones in this tutorial, only placed in the banter file instead of the initial dialogue file.  The PC banters are located after all the CHAINs for the NPC banters.  But WeiDU encounters a problem right at the first IF. Any ideas?

You want the check to be for 0 and then set it to 1 after it starts.  So...

IF ~Global("WeAlreadyTalkedAboutThis","LOCALS",0)~ THEN BEGIN RaistTalks1
 ~Blah~ DO SetGlobal("WeAlreadyTalkedAboutThis","LOCALS",1)~

CHAINs effectively END your banter file so you'll either have to put your CHAINs all at the end of the file or you'll have to APPEND.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Kismet on March 18, 2006, 10:03:12 AM
hokay. sorry to bother yet again. i need something explained please. Now, to whoever answers this, thanks heaps. Please explain it in really simple terms, as though to a REALLY slow child. (Witness Flames -16 y/o australian.... believe me, it NEEDS to be simple)
1. interdia.2da and pdialogue.2da.....do i actually need files named those things in order for the banter to work? If so, exactly what should i put in it? if not.....what is their purpose??
2. Name still not working, so i'm probably going to start the NPC from scratch *sigh*
3. anyone know how to use THEN EXTERN.....couldn't quite figure it out.....because should the PC decide to be an ass i was thinking of having Aerie have a whinge....in the initial dialogie before my NPC joins the party.(refer to stupid child thing again)
4. Last one. Moving my entire party. I know i asked this before, but i didn't realy get an answer. i can get my NPC to move, but not the party.....any ideas?

Alright. Cheers everyone.

1. Those files are already in the game.  You just need to append them in your .tp2 file to add in your NPCs dialog files.
2. Make sure you're not using a saved game in which your NPC has already appeared because the .cre file would have been stored locally and won't reflect any changes you've made to it.
3. You wouldn't need to EXTERN in that case, just use INTERJECT.
4. ActionOverride(Player2,LeaveAreaLUA("NewArea","",[626.277],6))
         ActionOverride(Player3,LeaveAreaLUA("NewArea","",[583.375],6))
         ActionOverride(Player4,LeaveAreaLUA("NewArea","",[676.312],6))
         ActionOverride(Player5,LeaveAreaLUA("NewArea","",[632.415],6))
         ActionOverride(Player6,LeaveAreaLUA("NewArea","",[717.357],9))
Where "NewArea" is the name of the area file where you want them to go, [###.###] are the coordinates in that area and # is the direction you want them to face.       
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: KingMick on March 18, 2006, 05:07:36 PM
Ahhhhhh!  Thanks Kismet.  I knew about the 0 1 thing, I just posted it wrong here.  But the thing about putting the chains at the end--I didn't know that part.  Thanks!

Now, does anyone know why my banters never seem to play?
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: flameswing on March 18, 2006, 08:10:35 PM
Whew. Thanks very much Kismet.
Oh hey I also have that banter issue....never seems to come up...
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Biubid_boy on March 19, 2006, 02:29:15 AM
I believe you have to copy the compiled banter file into the override folder.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: KingMick on March 19, 2006, 02:34:42 AM
already did that, still doesn't seem to be happening...
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Kismet on March 19, 2006, 06:29:54 AM
You do not need to copy the compiled banter to the override folder, or at least not manually.  If you're installing your mod via a .tp2 file then all pertinent dialog files will be appended automagically. 

Are all the conditions for the banter met?  Check your globals to make sure that they have been met.  Have you tried forcing the banter? (getting the two banterers in your party and pressing ctrl-I until your fingers bleed or your banter appears)?
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: KingMick on March 19, 2006, 11:18:49 AM
I didn't know you could force a banter. Do I have to do anything special before the CTRL-I will work?
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: taplonaplo on March 19, 2006, 01:17:25 PM
afaik, enable cheats then  "CLUAConsole:EnableCheatKeys()" without quotes,and it is case sensitive
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: KingMick on March 19, 2006, 07:33:30 PM
Woo-hoo!  The banters work fine, I found out by using Ctrl-I.  Now I'm really glad I know about that--this means I can have more storyline whenever I want it and not be dependent on the game's scheduling! :D

Hit another snag, though :(. You guys are awesome for helping me so much...maybe someone can tell me why WeiDU gives me an error message right at the first "IF" when I try to add banters with the PC?  Here's the first state copied and pasted directly...

BEGIN ~BKM#RAIS~

IF ~Global("RaistPC","LOCALS",0)~ THEN BEGIN RaistPC1
SAY ~The others tell me you are searching for a lost sibling. Is that true?~
IF ~~ THEN REPLY ~She's my foster sister. I have to save her~ GOTO RaistPC1Sister
IF ~~ THEN REPLY ~Actually, I mostly just want to kill the man who took her--I owe him one.~ GOTO RaistPC1Revenge
IF ~~ THEN REPLY ~They are mistaken. I seek a man who offered me power beyond my wildest dreams, and I intend to have it.~ GOTO RaistPC1Power
IF ~~ THEN REPLY ~Raistlin, I'd rather not talk about this right now.~ GOTO RaistPC1Goodbye
END

Also, is there a way to use an OR operator type of thing?  For example, I'd like the conditions for the next banter to be either that the first one has already run OR that Imoen has been rescued.  They don't both have to be true, just one of them.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Biubid_boy on March 20, 2006, 03:37:19 AM
Umm... I have a couple of questions. Firstly, code do you have to change to make your custom banters come up and secondly, how do I link the leaving script to my NPC because when I kick him out he says nothing.
Thanks,
Biubid_boy
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Grim Squeaker on March 20, 2006, 04:11:00 AM
Also, is there a way to use an OR operator type of thing?  For example, I'd like the conditions for the next banter to be either that the first one has already run OR that Imoen has been rescued.  They don't both have to be true, just one of them.

OR(X) where X is the number of conditions you want inside the 'or'.
e.g.
OR(2)
Foo()
Bar()

This would mean Foo() or Bar().
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Grim Squeaker on March 20, 2006, 04:12:31 AM
Umm... I have a couple of questions. Firstly, code do you have to change to make your custom banters come up and secondly, how do I link the leaving script to my NPC because when I kick him out he says nothing.
Thanks,
Biubid_boy

That's all in the 2da APPENDing stage of the tutorial.  Adding entries to interdia.2da makes them banter.  Adding the correct entries to the other 2da (which right now is escaping me) gives you your leaving dialogue and a few other things.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Kismet on March 20, 2006, 07:30:44 AM
Hit another snag, though :(. You guys are awesome for helping me so much...maybe someone can tell me why WeiDU gives me an error message right at the first "IF" when I try to add banters with the PC?  Here's the first state copied and pasted directly...

BEGIN ~BKM#RAIS~

IF ~Global("RaistPC","LOCALS",0)~ THEN BEGIN RaistPC1
SAY ~The others tell me you are searching for a lost sibling. Is that true?~
IF ~~ THEN REPLY ~She's my foster sister. I have to save her~ GOTO RaistPC1Sister
IF ~~ THEN REPLY ~Actually, I mostly just want to kill the man who took her--I owe him one.~ GOTO RaistPC1Revenge
IF ~~ THEN REPLY ~They are mistaken. I seek a man who offered me power beyond my wildest dreams, and I intend to have it.~ GOTO RaistPC1Power
IF ~~ THEN REPLY ~Raistlin, I'd rather not talk about this right now.~ GOTO RaistPC1Goodbye
END

It's always helpful to post the exact error message that you're getting.  My guesses are: 1. You've already used BEGIN ~BKM#RAIS~ in another dialog file.  If that's the case you'll have to APPEND rather than BEGIN. or 2. You were writing in word (or other non-plain text program) and you have some sort of funky format in there.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: KingMick on March 22, 2006, 03:48:02 AM
No and no :(.  Using Notepad, and I've never given the BEGIN BKM#RAIS command before this line.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Biubid_boy on March 22, 2006, 04:08:54 AM
Don't you need to use CHAIN for banters?
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Grim Squeaker on March 22, 2006, 07:06:01 AM
Don't you need to use CHAIN for banters?

Only if you have multiple speakers (i.e. two NPCs).  You could also use APPEND for such things if you wished in any case.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Kismet on March 22, 2006, 07:19:14 AM
No and no :(.  Using Notepad, and I've never given the BEGIN BKM#RAIS command before this line.

Well, what was the error?
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: taplonaplo on March 22, 2006, 09:25:52 AM
This worked for me:
BEGIN ~BKM#RAIS2~

IF ~Global("RaistPC","LOCALS",0)~ THEN BEGIN RaistPC1
SAY ~The others tell me you are searching for a lost sibling. Is that true?~
IF ~~ THEN REPLY ~She's my foster sister. I have to save her~ EXIT
IF ~~ THEN REPLY ~Actually, I mostly just want to kill the man who took her--I owe him one.~ EXIT
IF ~~ THEN REPLY ~They are mistaken. I seek a man who offered me power beyond my wildest dreams, and I intend to have it.~ EXIT
IF ~~ THEN REPLY ~Raistlin, I'd rather not talk about this right now.~ EXIT
END

btw BKM#RAIS used by the banters with npcs (in my version)
NOTE: i put exits coz i don't have the rest of the banter
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Grim Squeaker on March 22, 2006, 09:40:42 AM
So perhaps the block 'RaistPC1Sister' is non-existant.  Seriously, you've gotta post what the errors say or we are forced to just guess.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Mr.Big on April 16, 2006, 06:28:47 PM
I CANNOT FIND THE DEATH VARIABLE!!!!!!!!!! AHHHHHHHH *CRIES*

I've tried everything.  I looked for the name, I checked the hex, I checked what file i'm looking at, but with NI, I cannot find anything that resembles a "Death Variable".  Please help!

Maybe, could someone post a screenshot on where it is, because I cannot find anything anywhere.

Mr.Big
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Grim Squeaker on April 16, 2006, 06:32:54 PM
Ah, NI apparently calls it Script Name and is at offset 280
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Mr.Big on April 17, 2006, 02:42:54 PM
Praise Helm!  Thank you very much.  I'm trying my hand at making King Arthur atm, and I may eventually create a Monty Python and the Holy Grail minimod!  Complete with White Rabbit! 

Anyway, Is there anything else that I need to know that is different from the tutorial (using NI)?
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: biubid_boy on April 25, 2006, 07:01:47 PM
Umm.. unless its yours, thyere already is a Holy Grail Minimod...
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Mr.Big on April 26, 2006, 04:39:16 PM
Bah, I should have known.  It isn't mine, and I've never heard of it.  There goes that idea...

Back to the drawing board, I guess.

Is there a link to the mod?
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Perilofwolf on April 27, 2006, 10:42:37 AM
IS there anyone i can send my mod to? It doesnt seem to work but i cant find a problem! If u can help PLZ email me :'(
Conor_shutup@hotmail.co.uk and i'll send u my mod
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Perilofwolf on April 27, 2006, 10:47:29 AM
IS there anyone i can send my mod to? It doesnt seem to work but i cant find a problem! If u can help PLZ email me :'(
Conor_shutup@hotmail.co.uk and i'll send u my mod
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Grim Squeaker on April 27, 2006, 11:35:31 AM
Why don't you tell us what's not working and post the appropriate code.  Is it that its not doing what you think or that it isn't installing?
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: biubid_boy on April 28, 2006, 06:58:28 PM
Anywho, after extensive searching of the Holy Grail mod I can't find the website, but on the tp2, it says the author is hlidskialf.
Hmm... when looking through the contents it doesn't really add the characters as NPC's just has them as .cres acting out the evil rabbit scene.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: notasophist on May 08, 2006, 03:20:57 AM
The dialogue assignment is at 0x330, or in the same area as the Script Name/Death Variable, just a bit further down.  Right-click the field, choose "Edit as String", and type in J#Vondo.  This means when our finished product is installed, and our dialogue compiled, J#Vondo.cre will use J#Vondo.dlg initially.


It may be NI's problem, but when I type in my dialogue name in the dialogue field, NI gave me an error. I've done changed the chr to cre, changed the death variable.

Can anyone help?
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Grim Squeaker on May 08, 2006, 05:37:44 AM
Would you mind telling us exactly what the error is?
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: notasophist on May 08, 2006, 01:46:31 PM
I'm not sure if this would help, but after I type in the name of my d.file (using edit as string), NI gave me the error:

"Error Updating Value"
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Igor on May 15, 2006, 11:04:51 AM
I'm not sure if this would help, but after I type in the name of my d.file (using edit as string), NI gave me the error:

"Error Updating Value"
Same here.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Hide and Seek on May 21, 2006, 05:35:38 AM
Is there a special guide for creating improved battles? I'm still trying to figure how to create a battle somewhat similar to the four paladins in Valen's mod.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Grim Squeaker on May 21, 2006, 06:54:32 AM
Is there a special guide for creating improved battles? I'm still trying to figure how to create a battle somewhat similar to the four paladins in Valen's mod.

All you do is check some conditions (e.g. variables), CreatureCreature() the creatures you want, maybe have them Dialogue() the party and then Enemy() so they turn hostile.  It's one of these common misconceptions that creating battles or quests requires some magic scripting, when actually its fairly simple if you have a clear idea in your head of what you want to do.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: A_Beaverhausen on May 25, 2006, 01:29:27 PM
Hello, I am having a problem with my kickout dialogue.  Whenever we kick our NPC out of the party, it doesn't use our dialogue.  In one of the two NPCs we're creating, it uses the standard multi-player dialogue, and in the other, he just kind of stands around and doesn't say anything.  We used the basic guide, and included this in the J#Vondo.d file.  Is this the correct place, or should it have a file of its own?

Thanks,

Patty
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Grim Squeaker on May 25, 2006, 01:49:40 PM
At a guess the Export Allowed flag in the creature file is still ticked.  Untick it with NI, save the creature.  Then load a saved game before the creature was spawned and try again.  If you use one where it has already been spawned, it still won't work.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: A_Beaverhausen on May 25, 2006, 02:15:12 PM
I double checked and that doesn't seem to be the problem, neither NPC had the export allowed box checked.  There were no flags set at all......

Thanks again for your help,

Patty
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Grim Squeaker on May 25, 2006, 02:55:27 PM
Did you correctly set the information in pdialog.2da?  (Keeping in mind that the first entry is the NPC's death variable - a common mistake)
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: vociferate on June 20, 2006, 01:58:17 AM
nevermind, fixed that... now a new one...
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: vociferate on June 20, 2006, 09:22:35 AM
Alright, so the mod installed succesfully according to weiDU installer.

My npc isn't showing up in ar0704 like he is supposed to.  he is spawned at 350.660 which is directly in front of the characters when they inter mithrest inn.

when i cluaconsole him in, a smokey-like cloud appears, but not him
hmmm
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: jcompton on June 20, 2006, 09:42:09 AM
- Check the AR0704 script after you've installed the mod to make sure that your new script snippet is in there to create the creature.

- The appearance of a smokey-like cloud suggests that maybe the sprite apperance of your NPC CRE file is incorrect, possibly you changed it mistakenly while editing the CRE file. Check that out as well.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: vociferate on June 20, 2006, 12:36:40 PM
thanks :)

I'll check those things when I get off of work, and out of class (summer school... ugh.)
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Madieron on August 02, 2006, 07:18:12 AM
Hi,
I've got a problem during the setup of my new NPC.
Maybe it becomes from my understanding of English (I'm french) but the setup tells me that :

[C:\Program Files\Black Isle\BGII - SoA\Minuit The NPC\MinuitTheNPC-setup.exe] WeiDU version 195

ERROR : Unable to find DIALOG.TLK in :
dialog.tlk

Please run this program in your Infinity Engine game directory

FATAL ERROR : Failure("Unable to find DIALOG.TLK")

Does anyone know what I have to do ?
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Grim Squeaker on August 02, 2006, 07:31:21 AM
MinuitTheNPC-setup.exe (or Setup-MinuitTheNPC.exe as you'd normally name it) goes in the BGII - SoA folder as opposed to your mod's subfolder.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Madieron on August 02, 2006, 07:48:17 AM
Thank you :)

I've got a new problem :x

Quote
BACKUP ~Minuit The NPC\backup~
AUTHOR ~Madieron@hotmail.fr~
BEGIN ~Minuit the NPC for BG2:ToB~


// The following is the copying of Minuit's .cre file, as well as assigning her sound-set. See the file sdnslot.ids for a listing of sounds you can add.

COPY ~Minuit The NPC\Minui1.cre~ ~override\Minui1.cre~
SAY NAME1 ~Minuit~
SAY NAME2 ~Minuit~
SAY SELECT_COMMON4 ~Bla bla bla.~ [Minuit1] // [Minuit1] is the name of the .wav file for this sound
SAY SELECT_COMMON5 ~Salut à toi, Champion.~ [Minuit2]
SAY SELECT_COMMON6 ~Suivez moi !.~ [Minuit3]
SAY SELECT_ACTION1 ~A l'aventure compagnons....~ [Minuit4]
SAY SELECT_ACTION2 ~Comme vous voulez.~ [Minuit5]


// The following is telling WeiDU to compile the following .d files

COMPILE ~Minuit The NPC\Mad#Minuit.d

// The following is compilling the script and placing it in the override.

COMPILE ~Minuit The NPC\Mad#Minuit.baf

// The following is appending what we wrote in AR1000.baf to the bottom of
// AR1000.bcs

EXTEND_TOP ~Ar1000.bcs~ ~Minuit The NPC\ar1000.baf~


It tells me I've got an error Near text : \
Invalid character
at line 24 column 21-23

And I have another question
In the .tp2, there is written Mad#Minuit.baf but I've just created an AR1000.baf... so where does it come from ?
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: cmorgan on August 02, 2006, 08:21:38 AM
~Minuit The NPC\Mad#Minuit.d

needs the terminating tilde ~

as well as

~Minuit The NPC\Mad#Minuit.baf
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Madieron on August 02, 2006, 03:04:08 PM
Thank you ! :)
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Madieron on August 04, 2006, 06:24:38 AM
I've got a new problem... my .tp2 and .d seem correct now but the console tells me that :

ERROR: error compiling [Minuit The NPC\Mad#Minuit.baf] : Sys_error("Minuit ]
C\\Mad#Minuit.baf : No such file or directory

I think it tells me that because this file doesn't exists... so I've to create it but...
Is it a txt renamed file which I have to let empty?
Where do I have to create it ?
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Rabain on August 04, 2006, 07:25:04 AM
Yes it is a text file rename to .baf rather than .txt

It is usually used as your creatures personal script, instructing them to walk up to <charname> and initiate dialog...or at least that is the most common entry for custom npc's.

If you are missing this baf are you also missing the ar1000.baf listed at the bottom of your tp2 ?  This baf should instruct the script for area 1000 to create your creature at your chosen co-ordinates.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Madieron on August 04, 2006, 07:45:02 AM
Thx I created it (the <charname>.baf).
I've already had the ar1000.baf but my npc doesn't appear.. maybe because I changed the coordinates ?
I set 2494,2560 (so she must appear on the grass).

Rabain you told me I have to put instructions in my <charname>.baf.... I understood that I have to put the instruction that Minuit must go to speak to my charname but HOW I have to do that ?
I mean how I have to write the instructions ?

Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Rabain on August 04, 2006, 08:33:02 AM
Code: [Select]
IF
See([PC])
NumTimesTalkedTo(0)
THEN
RESPONSE #100
Dialogue(Nearest([PC]))
END

As per the first page of this thread under Scripts!
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Jolyth on August 09, 2006, 11:19:11 AM
Here is one I cannot seem to figure out and I am hoping that a second pair of eyes will help.  :)

My code is this:
Quote
IF ~~ THEN BEGIN TwoPallys
SAY ~Blah~
= ~Blah~
++ ~Blah~ + Request
++ ~Blah~ + DismissCharacter
END

Now WeiDU is telling me that I have a parse error at line 24 near text BEGIN, but I cannot see it. Suggestions? Thanks!
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Rabain on August 09, 2006, 12:17:11 PM
You haven't got a missing tilde ~ on the line before 24 have you?
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Grim Squeaker on August 10, 2006, 04:40:11 AM
Are you creating this block after you've already CHAINed?  As all BEGIN blocks have to be after CHAINs in your .d file.  Either that or you have to APPEND after your CHAINs.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Jolyth on August 10, 2006, 07:25:32 AM
Thanks for the suggestions guys. I found it in the block above the one that WeiDU stated. I forgot to put END at the end of the block, but I have no clue why WeiDU mentioned the next block having the error. Ah well, thanks again!  ;)
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Grim Squeaker on August 10, 2006, 08:13:23 AM
Thanks for the suggestions guys. I found it in the block above the one that WeiDU stated. I forgot to put END at the end of the block, but I have no clue why WeiDU mentioned the next block having the error. Ah well, thanks again!  ;)

Because it can't read your mind.  All it knows is that on line 24 it didn't encounter what it expected.  From its point of view your IF ~~ THEN on line 24 was the next player response from your previous block, so it expected either GOTO or REPLY and it recieved the keyword BEGIN.  Hence it throws the error there.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Jolyth on August 10, 2006, 06:13:54 PM
Gotcha.  :) I'm still new at this so it is going to take a while to get the hang of it. Thanks for the explanation
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Sorrowmaster on August 15, 2006, 01:30:49 PM
Question: What program is used to open the .cre file? I tried notepad, wordpad, word, adobe, java (which said it was a corrupted jar file)
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: jcompton on August 15, 2006, 04:28:29 PM
Near Infinity or DLTCEP.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Sorrowmaster on August 16, 2006, 10:22:13 AM
 DLTCEP?
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: cmorgan on August 16, 2006, 10:53:30 AM
http://www.dragonlancetc.com/forums/index.php?board=9

DragonLanceTotalConversionlEditorPro; maintained by Avenger at the above site. Pretty much the authoritative all-in-one package for editing lost of stuff.

NearInfinity  http://sourceforge.net/projects/nearinfinity/ has a board here under WeiDU.org forums; it is an equally useful tool.

Both are extremely powerful, both do different things well, and both have pretty darned good folks keeping them useful/updated for the rest of us poor schlubs who just wanna get stuff done. I can say that my usual bugfixing session has Crimson Editor, NI, and DLTCEP all paging back and forth, with an occasional quick ConTEXT review for different highlighters/a second look. Just have to make sure that none of them are open at the same time on the same thing; had to build a little "cleanup" macro that killed all of them before running setup-mymod, or I would mess stuff up bad :)
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Sorrowmaster on August 16, 2006, 10:56:18 AM
Nevermind, googled it, found out ;)
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: ANTYG on August 18, 2006, 11:27:26 AM
sorry that i ask but i can't create .dlg file  :-Zzz. I rename it to XXX.dlg but its stil a txt file, so basically i just change nake from XXX to XXX.dlg and not change files extention from txt to dlg. Anyone willing to help??
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Grim Squeaker on August 18, 2006, 11:33:26 AM
sorry that i ask but i can't create .dlg file  :-Zzz. I rename it to XXX.dlg but its stil a txt file, so basically i just change nake from XXX to XXX.dlg and not change files extention from txt to dlg. Anyone willing to help??

You don't create .dlg files like that.  You create .d files (which are just renamed txt files) and then compile them using WeiDU (using a tp2 file) as described in the tutorial.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Meridan on August 20, 2006, 02:58:13 PM
Ive searched various tutorials but cant find anything on "Reputation Issues" or by looking at decompiled DLGS, other modded npcs *.d's

My Post file looks like this.. (yes im modding in BG1 npcs)

Code: [Select]
BEGIN NSafaP

IF ~HappinessLT(Myself,-290)~ THEN BEGIN unhappy
SAY ~I've tried to guide this group in the right direction, but I'm tired of trying.  Goodbye.~
IF ~~ THEN DO ~LeaveParty() EscapeArea()~ EXIT
END

IF ~Global("SafanaJoined","LOCALS",1)~ THEN BEGIN KickOut
SAY ~You are kicking me out?~
IF ~~ THEN REPLY ~Oops, I meant to boot that twit Keldorn, not you. Sorry.~ DO ~JoinParty()~ EXIT
IF ~~ THEN REPLY ~That's right, I don't want you in the party.~ DO ~SetGlobal("SafanaJoined","LOCALS",0)~ EXIT
END

IF ~Global("SafanaJoined","LOCALS",0)~ THEN BEGIN Rejoin
SAY ~You want me to rejoin?~
IF ~~ THEN REPLY ~That's right Safana, get back in formation.~ DO ~SetGlobal("SafanaJoined","LOCALS",1)
JoinParty()~ EXIT
IF ~~ THEN REPLY ~That's right, I don't want you in the party.~ EXIT
END

Clearly its nowhere near finshed,

CRE Soundset was corrected as best as possible in NI, adding missing sounds via Importing from BG1 such as
SAFAN23.WAV which doesnt exist in BG2, All the StringRefs/WAV references do exist apart from "10201" the BIO is blank, this seemed to be fixed by a 
SAY_BIO in the Tp2.

I left out SAY_NAME in the Tp2 since SAFANA as a StringRef does exist already in the CRE/Dialogue, the DV is also SAFANA, seems to not have any side effects.

Problem... When ever Reputation drops to 1, SAFAN07.wav plays, before it is finshed playing the Dialogue
"I've tried to guide this group in the right direction, but I'm tired of trying.  Goodbye."   Interrupts the sound playing, also what about High Reputation kick outs?

So yes it works but its so messy ?

Looking ahead, ive decided to replace C6safa with some invented Girlfriend for Coran rather than deal with Coran this could be an character from BG1, so that encounter will still happen, less rewriting, I can imagine a sarcastic banter from Safana, if Coran is saved too. :D  Possible Safana pirate links at Brynnlaw/Quest, maybe some expanded Shadow Thief content, a NON -lethal Betrayal similar to what was planned for Viconia in the Underdark, The PC would then have the choice to either forgiving her or kicking her out forever, i can Imagine a CN character like Safana suddenly changing sides/sucking up to the PC if things look bad, just find the whole cameo as it stands quite silly, Safana with Lanfear, she wouldnt enter the Golem cave in bg1 by herself, sugguesting she likes to pull strings and sit back not be directly involved (even the 16 INT sugguests this), the Safana + Coran again she seems selfish much like a NE as does Coran himself, we are expected to believe she stuck by coran or coran stuck by her for how long? Wizard has a bounty on Charnames head? doesnt sound like Irenicus either. As to the Innate Charm ability im thinking an upgrade this is BG2 after all, Dominate once per day sounds better? :)
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Grim Squeaker on August 20, 2006, 03:12:42 PM
Quote
I left out SAY_NAME in the Tp2 since SAFANA as a StringRef does exist already in the CRE/Dialogue, the DV is also SAFANA, seems to not have any side effects.

A couple of notes:

1) It's SAY NAME not SAY_NAME (similarly SAY BIO not SAY_BIO)
2) I'd still strongly recommend changing her deathvariable to <my-modding-prefix>SAFANA, just to make sure it doesn't clash with anything.  Here (http://forums.blackwyrmlair.net/index.php?showtopic=113&st=0)'s a link on modding prefixes if you don't know about them.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Meridan on August 20, 2006, 03:54:47 PM
Thanks grim, it is correct in the Tp2, just not the above post

As to 2. since ive barely started on this project, ill be sure to correct such prefixes before any release to avoid conflicts, my script names NS are already invalid/taken.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Ghreyfain on August 20, 2006, 08:40:36 PM
since ive barely started on this project, ill be sure to correct such prefixes before any release to avoid conflicts, my script names NS are already invalid/taken.

I'd say that's rather extremely unwise. Best to get into the habit of using the prefix now, otherwise debugging will be a nightmare. Trust us.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Grim Squeaker on August 21, 2006, 05:37:28 AM
since ive barely started on this project, ill be sure to correct such prefixes before any release to avoid conflicts, my script names NS are already invalid/taken.

I'd say that's rather extremely unwise. Best to get into the habit of using the prefix now, otherwise debugging will be a nightmare. Trust us.

The Fain speaks the truth.  If you try to do a change right before the end you'll probably end up doing one of the following:
1) Manually changing every filename and variable name to include a prefix.  You might accidently miss a couple and get horrible bugs
2) Do some creative Find/Replacing to change every filename and variable name to include a prefix.  You might accidently change a BioWare variable to include a prefix and get horrible bugs.

So yeah, the moral of the story is to start using a prefix as soon as possible.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: cmorgan on August 21, 2006, 09:55:17 AM
My life this summer has revolved around this issue with thousands of lines of code... believe me, these folks are telling you the absolute and imperative truth. Hours and hours and hours of debugging because of inconsistencies with JaheiraMoves, X#JaheiraMoves, JaheiraMove, and JahieraMoves, is bad enough, but when you have to go back and try to figure out if original code has jaheiramove...  or worse, troubleshoot an install where someone else has used the same variable name...

 :P
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Meridan on August 21, 2006, 10:52:19 AM
I dont see "7S" as a registered prefix, so this is valid? :)
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Grim Squeaker on August 21, 2006, 12:14:22 PM
I dont see "7S" as a registered prefix, so this is valid? :)

If it's not on the registered list then it should be fine.  So post in the relevant thread to bagsy it.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Madieron on August 28, 2006, 03:57:46 PM
All my files are right but my character doesn't appear.... Do I need to start a new game for it ?

And I have another question... where I can find the words used in modding like SAY, IF etc ?
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Andyr on August 28, 2006, 04:01:25 PM
The WeiDU ReadMe, which came with the downloadable package.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: WizWom on August 28, 2006, 08:19:40 PM
Quote
All my files are right but my character doesn't appear.... Do I need to start a new game for it ?
If you used a script to place the NPC, then, no, you just have to trigger the script.
If you modified an ARE and used a CRE script to handle leveling, then yes, you would have to, if you have visited that area already.  SAVe files store all the CREatures for every AREa you have visited.  You could, of course, just CLUAConsole him in, too.
If you did a BG1 style NPC, with leveling by NPCLEVEL.2DA and a line in Baldur.GAM, then you have to start a new game.  BG2 would let you CLUA them in, and would put them in the GAM file for the save.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Madieron on August 29, 2006, 01:06:06 PM
I did a BG2 character.
Do you mean a .baf file for the script wich places the NPC ?
I've only :
.D, .tlk, .baf, .tp2 and .CRE files. I didn't modify any ARE files.
I'm very sorry, I don't understand what I have to do. :x
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: WizWom on August 29, 2006, 01:30:48 PM
You're doing fine; from the sound of it, you hald close to the tutorial.

Vefiry the AR????.BCS got changed correctly with NearInfinity; if it did, you should have
IF
Global("J#VondoExists","AR1000",0)
THEN
RESPONSE #100
SetGlobal("J#VondoExists","AR1000",1)
CreateCreature("J#Vondo",[1137.2046],3)
END

That will be at the top of the script (bad form, really, EXTEND_BOTTOM  should be used, or OnCreation() put in the block and a Continue() added to the end.  As it stands, it would bust an OnCreation() scripting).

If that scripting is there, then you're good to go, just visit the area.  The only thing that would stop your NPC from showing would be
(1) using mismatched area variables - that is, putting the character in AR0400, but then making the script still try to use "AR1000"
(2) not having the CRE spelled right
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Madieron on August 29, 2006, 04:25:54 PM
Vefiry the AR????.BCS got changed correctly with NearInfinity; if it did, you should have
IF
Global("J#VondoExists","AR1000",0)
THEN
RESPONSE #100
SetGlobal("J#VondoExists","AR1000",1)
CreateCreature("J#Vondo",[1137.2046],3)
END

That will be at the top of the script (bad form, really, EXTEND_BOTTOM  should be used, or OnCreation() put in the block and a Continue() added to the end.  As it stands, it would bust an OnCreation() scripting).

If that scripting is there, then you're good to go, just visit the area.  The only thing that would stop your NPC from showing would be
(1) using mismatched area variables - that is, putting the character in AR0400, but then making the script still try to use "AR1000"
(2) not having the CRE spelled right

I use Context as text editor and I don't see those lines. I just see strange lines like that :

SC
CR
CO
TR
16399 0 0 0 0 "AR1000Mad#MinuitExists" "" OB
0 0 0 0 0 0 0 0 0 0 0 0 ""OB
TR
CO
RS
RE
100AC
30OB
0 0 0 0 0 0 0 0 0 0 0 0 ""OB

So I don't know what to do.
Moreover my .CRE is called : Minui1.CRE ... is it good?
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Grim Squeaker on August 29, 2006, 04:46:03 PM
Yeah, that's what a compiled script file (.bcs) looks like.  In order to read it normally you either need to decompile the file with WeiDU or view it using a program like Near Infinity or Infinity Explorer.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Detherin on December 08, 2006, 11:38:20 PM
Hey everyone, I have been trying my hand at making my own NPC and was wondering if anyone could help me out.

My problem occurs when trying to install the NPC.  I get the following error message:

ERROR: compiling [Rhythm\T#Rhythm.d]!

Really not sure what the problem is.  It gives no further information as to why the .d file has failed to compile, so I'm completely lost.  I've made sure that the file name is correct, and that the T#Rhythm.d file is indeed in my Rhythm folder in the BG2 main directory. 

Any help would be greatly appreciated.
Thanks in advance.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: berelinde on December 09, 2006, 06:45:06 AM
Is the first line of T#Rhythm.d

BEGIN T#Rhythm

or

BEGIN ~T#Rhythm~

 ?

If not, the compiler doesn't know where to put it.

Edit: Doh! I knew that, but got careless typing--dangerous.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Detherin on December 09, 2006, 07:16:36 AM
I've tried the installing with both of "BEGING T#Rhythm.d" and "BEGIN ~T#Rhythm.d~", both produce the same problem when trying to install.

Any other suggestions as to what is causing my problems?
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Grim Squeaker on December 09, 2006, 07:19:25 AM
You don't want the .d suffix on your BEGIN line:

Code: [Select]
BEGIN T#Rhythm
or

Code: [Select]
BEGIN ~T#Rhythm~
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Detherin on December 09, 2006, 07:31:52 AM
Still doesn't solve my problem, unfortunately.

My original was "BEGIN T#Rhtyhm" and I have since tried it as "BEGIN ~T#Rhythm~" and both still give me my installation error...

Any more ideas?

Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: jcompton on December 09, 2006, 10:15:18 AM
There should be more to the error message than that, but I'm going to try this guess: Are you certain you're saving it as a text (.txt, plain text format) file? It will never, ever work if you save as .doc or .rtf or anything like that.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Detherin on December 09, 2006, 12:21:19 PM
I am fairly certain that I am saving it as the correct file type (it is a .txt document written in notepad).  And I have noticed that the error also reads

"ERROR: Sys_error("Rhythm\\T#Rhythm.d: No such file or directory")

This only confuses me further as both the file and directory are clearly there...is there something I am missuing here?  The only other notable thing I can see here is that there are two backslashes...but when I open the .tp2 folder I certainly haven't placed two backslashes (I think I'm right in guessing that the first "Rhythm" here will tell the installer what file my .d file is located in, and can therefore see why a second backslash would cause an error, but I can't for the life of me figure out how to solve this. 

Thanks a lot for your help so far though ^_^.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: jcompton on December 09, 2006, 01:23:56 PM
Are you sure you're consistently spelling rhythm in the same way? You have a typo in the message before this one, for instance.

You might just want to archive up your stuff at this point and put it somewhere that a helpful soul can download it and see what the trouble really is.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Detherin on December 09, 2006, 02:35:12 PM
I've proof read the tp2 file and the .d file a few times, I can't seem to find a typo concerning "rhythm".

Not sure how I would go about archiving my files for someone to download it :s...Yes, I'm a newbie ^_^.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: berelinde on December 09, 2006, 07:00:16 PM
Maybe you could just copy and paste the relevant lines from the tp2, like

COMPILE ~T#RHYTHM.D~
etc.

One of the first rules of proofreading can frequently be found in my own posts: it is practically impossible to effectively proofread your own work. You will stare at it forever and see only what you think you should be seeing. If someone else sees it, or, as I have so often found, you see it posted somewhere public, the tiny little errors will jump out at you.

Sometimes, all it takes is a fresh pair of eyes.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: jcompton on December 09, 2006, 09:22:50 PM
We need to see a file structure at this point, I think.

A tutorial on "how to post things online" is a bit outside the scope of this thread.

- Get a Yahoo account, if you don't have one already.
- Learn how to use Yahoo Briefcase and make things publicly accessible
- Tell us about it when you've done that.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Detherin on December 10, 2006, 07:27:30 AM
Maybe you could just copy and paste the relevant lines from the tp2, like

COMPILE ~T#RHYTHM.D~
etc.

One of the first rules of proofreading can frequently be found in my own posts: it is practically impossible to effectively proofread your own work. You will stare at it forever and see only what you think you should be seeing. If someone else sees it, or, as I have so often found, you see it posted somewhere public, the tiny little errors will jump out at you.

Sometimes, all it takes is a fresh pair of eyes.

Here is my .tp2 file, hope someone can see the problem ^_^.

BACKUP ~rhythm\backup~
AUTHOR ~BlackLotus (black.lotus@gmail.com)~
BEGIN ~Rhythm for BG2:SoA~

// The following is the copying of Rhythm's .cre file, as well as assigning his sound-set.  See the file sndslot.ids for a listening of sounds you can add.

COPY ~rhythm\Rhythm.cre~ ~override\Rhythm.cre~
SAY NAME1 ~Rhythm~
SAY NAME2 ~Rhythm~
SAY SELECT_COMMON4 ~Yes?.~ [Rhythm1]
SAY SELECT_COMMON5 ~Give the word.~ [Rhythm2]
SAY SELECT_COMMON6 ~Point the way.~ [Rhythm3]
SAY SELECT_ACTION1 ~I'm on the job.~ [Rhythm4]
SAY SELECT_ACTION2 ~As you wish.~ [Rhythm5]


// The following is telling WeiDU to compile the following .d files

COMPILE ~rhythm\T#Rhythm.d~

// This is adding our area file to the game

EXTEND_TOP ~Ar0406.bcs~ ~rhythm\ar0406.baf~

// Add this to the end

APPEND ~pdialog.2da~
~T#Rhythm T#RhytP T#RhytJ T#RhytD T#Rhy25P T#Rhy25J T#Rhy25D T#Rhyt25~
UNLESS ~T#Rhythm~
APPEND ~interdia.2da~
~T#Rhythm T#RhytB T#RhyB25~
UNLESS ~T#Rhythm~

*EDIT* I have set up a Yahoo account and loaded up my NPC's files on to briefcase...I'm unsure if it is against forum policy to post a link to my briefcase here though?  Could someone enlighten me, please?
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: blue_frost17 on January 11, 2007, 08:44:51 PM
Um... hi. I'm a big time noob when it comes to mods so... yeah.

Anyway, I've been having a little bit of a problem with getting the VondoTheNPC mod to work.

Ok I've done all the steps and have completed the tp2. file, but here's my problem; when I try to do the setup, the Weidu window says this:

** Error ** [VONDOTHENPC-SETUP.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.
[C:\Program Files\Black Isle\BGII - SoA\VondaTheNPC-setup.exe] Using scripting style "BG"


I'm not sure what the problem is because I've done everything the tutorial said.
(If it's some stupid mistake, please forgive me. My hair is naturally blond so I'm bound to do stupid things.)
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: jcompton on January 12, 2007, 09:40:52 AM
Ok I've done all the steps and have completed the tp2. file, but here's my problem; when I try to do the setup, the Weidu window says this:

Watch carefully:

Quote
** Error ** [VONDOTHENPC-SETUP.TP2] not found.

Your TP2 is called "vondothenpc-setup.tp2"...

Quote
[C:\Program Files\Black Isle\BGII - SoA\VondaTheNPC-setup.exe] Using scripting style "BG"

...but your WeiDU .exe is "vonda". The two names must match for the fancy TP2 recognition bit to work.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: blue_frost17 on January 12, 2007, 02:58:14 PM
(Slams fist into head) GRRRRRRR! Sorry, it was a typo on the last post.

The last part says:

[C:\Program Files\Black Isle\BGII - SoA\VondoTheNPC-setup.exe] Using scripting style "BG"

Sorry for the miss-print. As I said, I make stupid mistakes and typos is one of them.

I'm really sorry to bother you all, but I need help!
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: jcompton on January 12, 2007, 03:31:52 PM
It's complaining that it does not see both the .exe and the .tp2 in the same directory. Check that they are both in the same directory and with the same name.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: blue_frost17 on January 12, 2007, 03:51:04 PM
They're both in the same area of my BGII folder, but after looking at some of the other tp2 mods files I began to notice something.

When I look at the File Name for the tp2 file for say the Solaufien mod, it says: Solaufien-setup; and when I look at the File Type it says: TP2 File.

The File Name for Vondo is: VondoTheNPC.tp2; but the File Type says: Text document.

Now I saved the dialog file the way it says in the tutorial, and it saved as a DLG File; but I saved the tp2 file the way it says in the tutorial but it still says its a Text Document.

Could this be the problem?

(P.S. thank you for all your help :))
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: jcompton on January 12, 2007, 04:04:54 PM
Ugh. Yes, it is, and it's because you have Windows Explorer hiding file extensions, so the real end of that file is .tp2.txt .

Open a Windows Explorer window and do Tools/Folder Options, then in the resulting settings window go to the View tab, and uncheck "Hide extensions for known file types."

Then rename the file so it just ends in .tp2, not .tp2.txt.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: blue_frost17 on January 14, 2007, 08:56:18 AM
(Drops to knees) Hail jcompton! Hail jcompton! Hail jcompton!

Thank you! Thank you so much!  ;D
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: blue_frost17 on January 14, 2007, 01:12:52 PM
(Sigh) Sorry to bug you all again, but I can't get Vondo to appear. I saw WizWom's post and checked to see if I had miss-printed in the BAF File. but it was correct, so I'm trying to figure out the CLUAconsole code, but I'm stumped ???.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Rabain on January 15, 2007, 05:39:11 AM
Hiya,

All about the CLUA is here: http://iesdp.gibberlings3.net/clua/bg2.htm

Also remember that it is case sensitive so everything must be exactly as it appears in the instruction.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: berelinde on January 15, 2007, 05:55:54 AM
Open up your game override folder and check to be sure your CRE is there, that it installed correctly.

Then type the following into the console:

CLUAConsole:CreateCreature("creature")

That should spawn him, if he installed.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: blue_frost17 on January 15, 2007, 11:40:12 AM
Ok, finally got Vondo to work with and without the CLUAconsole, but now...

(hangs head in shame) he won't initiate dialog. :'(
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: berelinde on January 15, 2007, 03:01:30 PM
What's his default script? DEFAULT.bcs or INITDLG.bcs? If it's DEFAULT.bcs or None, the pc is going to have to start the ball rolling with the dialogue. If that doesn't work, is it possible you didn't assign his scripts and dialogue file correctly? *or* it's also possible that there is something wrong with his first dialogue block.

Start with the obvious: open your CRE in the override with NI and verify that your dialogue file, override script, default script, script name or DV, and everything else are assigned correctly. If they are, then the problem is with the first block of dialogue.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: blue_frost17 on January 19, 2007, 08:42:59 PM
(Laughs maniacally) IT IS ALIVE! :D

VONDO LIVES!

It works! Thank you! Thank you so very much!

I didn't compile the dialog scripts right, but problem solved and IT WORKS!!!

(Takes deep breath) Now, my ascension to Godhood has begun! ;)
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: muffin-tacos on March 11, 2007, 05:49:47 AM
Hi!  :)

I happen to be stuck on the CRE file stuff. I've done my charecter in ShadowKeeper, saved it in the CHR file and now I don't know what to do. And what is worst, I don't understand NearInfinity! So I'm really stuck here... can somebody explaine how NearInfinity works and how I'm supposed to save my NPC file and explain the CRE stuff more because I don't understand anything about it.
I'm really lost here  :(

So PLEASE contact me soon.
Reach me by my e-mail address: hallowini_99@hotmail.com and I don't want any random people writing to me that aren't saying anything useful that can help me (like sending me adverts and crap like that).

Looking forward to help!
See ya soon  :pirate
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: berelinde on March 11, 2007, 06:58:40 AM
I had a problem using NI exclusively for this purpose, as I'm a borderline technophobe.

I used ShadowKeeper to edit my CHR to suit my purposes, then used ShadowKeeper to convert the CHR to a CRE. But that isn't the end of the process.

After that, I used NI to remove the "export allowed" flag, change the ally/enemy field to Neutral-128.

Most of the time, I don't bother assigning the portraits/dialogue files/override script/script name(DV) with NI because I do that in the tp2.

NI allows you the convenience of using one program to do all these things, but for some reason, my brain has an easier time accepting the three-step process.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Lu on March 11, 2007, 06:54:08 PM
Quote
[...] After that, I used NI to remove the "export allowed" flag, change the ally/enemy field to Neutral-128
  You may also need to check (and correct) Morale, Morale Recovery, and Morale Break fields in the .CRE file, IIRC
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: berelinde on March 11, 2007, 07:33:00 PM
Yeah, I guess you do! After all , an NPC is not <CHARNAME>.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Discord on March 16, 2007, 05:39:05 PM
Kind of a stupid question, but I'm new at this:

When you write the follow up dialogue for when the PC returns to talk to Vondo after rejecting him in the first meeting, do you put that into the original ".d" file from the first meeting dialog, or do you make a whole new file?

Thanks!
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: jcompton on March 16, 2007, 06:59:05 PM
All conversations which take place before a character has ever joined should go in the same DLG resource. It's only after an NPC has been in the party that the B/P/J dialogues start being used.

So the answer to your question is "yes, put them in the original file" but more specifically "put them under the same DLG resource" since one .d file can create multiple DLGs.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Kendo Khan on April 17, 2007, 08:52:57 PM
ok, I have no idea what I am doing with this, and dont want to deal with the hassle of ALL of your steps. (I know they were easy, but I am fairly lazy and can't code past xhtml) If I just wanted to get a new, custom NPC into my game on my comp, would it work to go through steps I and II and then using the CLUAConsole:CreateCreature("xxxxxx") to summon my new NPC and have them join? Thanks.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: ZenOfAnger on June 03, 2007, 11:19:31 AM
Sorry for a noobish question, but once you convert the CHR to CRE, where do you save it?
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Kulyok on June 03, 2007, 11:24:16 AM
Wherever you like. Usually (by default) it is in {BG2 directory}/characters after conversion, if you were converting a .chr file from there.

If you've a mod half-ready, then in the {mod directory}/Cre  is the best place.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: flameswing on August 27, 2007, 08:18:46 AM
Ok...sorry to revive an old post...but...i have tried every way i could think of to fix this.

I have my basic NPC in the game, all fine and lovely...but i tested the booting her out of the party bit...after i remove her from the party, she doesn't start the "why are you booting me?" dialog, and my player character goes to speak to her and gets "Varsa has nothing to say to you."
Could anyone possibly think of why this may be?
Yes, it's in the *P.d file, and yes i have WeiDu appending it into the pdialog.2da file, which it seems to do fine.

Cheers guys.  :)
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Kulyok on August 27, 2007, 08:33:49 AM
Please, post your *p.d filename, *p.d contents and the relevant lines from pdialog.2da in a separate thread in Modding Q&A forum.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Guest on September 26, 2007, 05:07:27 PM
I have a couple questions

A basic combat script for them to use would be WTASIGHT.bcs, or WTARSGT.bcs for ranged weapons.   I didn't see any option on NI that said combat script....where exactly do you put this?

Also, I read something about an npc override script. I understand what your supose to write but,
does it go in the folder created for all the files such as cre... etc.?

I followed the tutorial but part of my npc script isn't working. The kick out and rejoin. Its acting
like it doesnt know the npc joined so it can't start the dialogue. I looked in SK and there isn't any
global variables stating that the npc joined or even exists. I don't know what to do at this point.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Kulyok on September 27, 2007, 01:06:43 AM
Check all steps have been performed: you've written your P file for kicking out and rejoining, you've appended your dialogue files to interdia.2da and pdialog.2da, your variables are functioning correctly(see any working mod, say, Kelsey or Xan for examples of functioning variables).

You can put WTASIGHT/WTARSGT to any slot; CLASS or RACE script will function fine. With your override script, I recommend first compile it and put it to the override, then open your .cre via NI and write your OVERRIDE script name there.

Don't forget your NPC's script name/death variable(how the game will call him or her): it should be in SCRIPT NAME(I think) field.

Modding Q&A is the best section to deal with these questions. Also, chances are it's already been asked and answered, so Search function might be helpful.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Vogonvor on December 21, 2007, 04:50:13 PM
OK i followed the instructions, editing names and the like I fixed some errors with the dialogue easily enough but it comes up with:

FATAL ERROR: Sys_error<"dialog.tlk: Permission denied">

Does anyone have any idea what I need to do to make it work?

Thanks
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Kulyok on December 22, 2007, 01:08:51 AM
Don't install the mods with BG2/other BG-related utilities(ShadowKeeper, Infinity Explorer) running in the background.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Vogonvor on December 22, 2007, 02:20:33 AM
Thanks
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Foodthing on February 27, 2008, 09:54:20 AM
Sorry for reviving a old post (Not only that, but with my *first* post.) but i have a few issues with NI, and since banging my fist in the wall doesn't work, i figured i could look for help here.

Anyway, i start NI, convert the CHR file to CRE and then i proceed to change the DV. Now, when i try to change the override script like it says in the tutorial it doesn't work. I get a list of (what i assume are) existing scripts, and none of them help me. ~
Thing is, i'm completely illiterate when it comes to these things, and i assume there's something painfully obvious that i've missed but can't figure out what it is.
oh, and i can't change the Dialog either, since when i try to edit it as strings (yet again, like the tutorial tells me) it gives me a error message (Error updating value)
So, does anyone know what i can do to fix this?

Thanks, and sorry again for my necromantic reanimations of old topics  :P
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: jcompton on February 27, 2008, 10:31:59 AM
Either double-click the field, or right-click it and select Edit As String in order to do free entry of your new script name.

And as for the "error updating value", don't write MYFILE.DLG, just write "MYFILE".
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Kulyok on February 27, 2008, 11:06:23 AM
Either double-click the field, or right-click it and select Edit As String in order to do free entry of your new script name.

And as for the "error updating value", don't write MYFILE.DLG, just write "MYFILE".

I just want to emphasize that I only discovered this function about two weeks ago. :)


And don't worry about reviving an old thread with a good question. Good luck with your mod.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Foodthing on February 27, 2008, 11:09:13 AM
Still, no. I still get the same kind of error. I tried to just write ''myfile'' and edit as string. Nuthin'. I've double checked everything i've written, made sure to follow the tutorial..what could i be doing wrong?
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Kulyok on February 27, 2008, 11:16:19 AM
Okay, right-click, choose "edit as string", then double-click at the empty field, a cursor appears, you enter a value, go to a different field, save, close and then re-open. (And double-check it's the right file, naturally.) Does it work?
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: berelinde on February 27, 2008, 11:33:46 AM
I had that problem with NI, as well. Which is why I simply set the script name, dialogue file, and override script in the tp2:
Code: [Select]
COPY ~mymod/cre/crefile.cre~ ~override~
  SAY NAME1 ~Name~
  SAY NAME2 ~Name~
  WRITE_ASCII 0x248 ~mynpcs~ #8     // assign override script
  WRITE_ASCII 0x2cc ~mynpc~ #8      // assign pre-joining dialogue file
  WRITE_ASCII 0x280 ~mynpcdv~ #32  // assign DV
  WRITE_ASCII 0x34  ~mynpcs~ #8     // assign small portrait
  WRITE_ASCII 0x3c  ~mynpcl~ #8     // assign medium portrait
It's just easier for me.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Foodthing on February 29, 2008, 02:39:30 PM
I see. Well, thanks for the help and the encouragment   :) I'll see if it works when i get some time.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Retrickster on May 13, 2008, 09:27:04 PM
If you have the latest version of Java you'll probably have to use the latest NI beta, as the current non-beta release is incompatible.

And it took me so long to find this, its the closest answer I have found to why I could open the .jar NI application but could not use it to open the .cre or any other type of files except for plain txt files like the .BIO files.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: RabbiSatan on June 15, 2008, 09:39:10 AM
Heya guys,

I've got a quick question about the hex values, name/number and location.

I've tried what was suggested earlier in the thread, by going to Options and turning on "Show Hex Offsets", but the hex offsets don't correlate with what other people are saying are the hex offsets for certain sections.

For example, the original post said the offset for Death Variable was 0x2e4, but in Near Infinity, it's "280 h" - am I doing something wrong?

It's also different for dialog, mine says 2cc h, but ghrey's original post says it's 0x330.

Am I doing something wrong?

Thanks :)
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Taimon on June 15, 2008, 11:27:03 AM
I guess, Grey's post refers to a CRE inside a CHR file. (additional 0x64 offset from the CHR header)
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: RabbiSatan on June 16, 2008, 08:04:18 AM
Hm, I've encountered a rather curious problem.

I've mostly finished making my NPC, got the dialogue done (except for leaving the party and talking again), appended the area script, etc etc. But I've encountered a problem with weidu not installing the mod because the mod's title reference for the user is not parsing?

Here's the error:

Quote
WARNING: parsing log [WeiDU.log]: Sys_error("WeiDU.log: No such file or directory")

[SETUP-MEPHAESTUS.TP2] PARSE ERROR at line 3 column 8-17
Near Text: Mephaestus
   syntax error

[SETUP-MEPHAESTUS.TP2]  ERROR at line 3 column 8-17
Near Text: Mephaestus
   Parsing.Parse_error
ERROR: parsing [SETUP-MEPHAESTUS.TP2]: Parsing.Parse_error
ERROR: problem parsing TP file [SETUP-MEPHAESTUS.TP2]: Parsing.Parse_error

And here's the tp2 file:

Quote
BACKUP ~Mephaestus\backup~
AUTHOR ~rabbi_satan@hotmail.com
BEGIN ~Mephaestus the NPC for BGII:ToB~

COPY ~Mephaestus\RSJC#MEPH.cre~ ~override\RSJC#MEPH.cre~
SAY NAME1 ~Mephaestus~
SAY NAME2 ~Mephaestus~

Anyone have any clues? Thanks :)
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Kulyok on June 16, 2008, 08:08:36 AM
It should be

AUTHOR ~rabbi_satan@hotmail.com~
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: RabbiSatan on June 16, 2008, 08:22:27 AM
Woo, thanks for the quick response :)

Yeah, I missed the ~ at the end of the email, thanks for pointing that out :)

I'll correct it now, and report back with the results.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: RabbiSatan on June 16, 2008, 08:33:40 AM
Heya Kulyok, hope you're still here :)

Got rid of that problem, but ran into another -

Quote
WeiDU v 185 Log

 F:\Black Isle\BGII - SoA\setup-mephaestus.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, 621 bytes
Possible HD/CD Path: [F:\Black Isle\BGII - SoA\]
Possible HD/CD Path: [F:\Black Isle\BGII - SoA\CD1\]
Possible HD/CD Path: [F:\Black Isle\BGII - SoA\CD3\]
Possible HD/CD Path: [F:\Black Isle\BGII - SoA\CD4\]
Possible HD/CD Path: [F:\Black Isle\BGII - SoA\CD2\]
Possible HD/CD Path: [F:\Black Isle\BGII - SoA\CD5\]
[./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-MEPHAESTUS.TP2] LEXER ERROR at line 11 column 26-35
Near Text: \
   invalid character [\]

[SETUP-MEPHAESTUS.TP2]  ERROR at line 11 column 26-35
Near Text: \
   Parsing.Parse_error
ERROR: parsing [SETUP-MEPHAESTUS.TP2]: Parsing.Parse_error
ERROR: problem parsing TP file [SETUP-MEPHAESTUS.TP2]: Parsing.Parse_error

FATAL ERROR: Parsing.Parse_error

      WeiDU Timings
load TLK                         0.000
parsing .tp2 files               0.010
loading files                    0.064
unmarshal KEY                    0.194
unmarshal TLK                    0.230
TOTAL                            0.498

The line in questions is:

Quote
EXTEND_TOP ~AR1000.bcs~ ~Mephaestus\AR1000.baf~

Any ideas as to why this is a happening?

Many thanks :)
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Kulyok on June 16, 2008, 08:41:25 AM
No. Nobody is going to troubleshoot missing "~"'s and errors in your code - especially if you're not providing the code itself. You will have to troubleshoot yourself - better start now. A tip, though: Weidu never provides the _exact_ line. You'll have to check the previous line, and, perhaps, a few lines above.

If you want to try your luck, start a new topic in Modding Q&A - some mods get built entirely on Q&A support, so.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: RabbiSatan on June 16, 2008, 08:43:26 AM
Alrighty, I get the message, no need for hostilities :)

Thanks though, I guess I can't rely on everyone else all the time.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: jcompton on June 16, 2008, 09:50:54 AM
Kulyok's just trying to promote independence and good reporting techniques. But, yes, because parser errors are often the product of a mistake that occurs higher up in the file, you usually don't get much in the way of results by just staring at the actual line in question. Depends on the type of error. (But this one sounds awfully like another missing tilde.)
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: RabbiSatan on June 16, 2008, 10:36:39 AM
Kulyok's just trying to promote independence and good reporting techniques. But, yes, because parser errors are often the product of a mistake that occurs higher up in the file, you usually don't get much in the way of results by just staring at the actual line in question. Depends on the type of error. (But this one sounds awfully like another missing tilde.)

Yeah, it actually was another missing tilde.

But anyway, I am now at the point where I can install my mod without a hitch - another landmark achieved. However, my cre isn't popping up in location 2000,3000 of the Government district. But I'll sort that out myself :)

Many thanks for all the help.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Retal on July 18, 2008, 09:45:14 AM
Ok, so..
I've followed the tutorial, done everything i could, had LOADS of errors with installation, spent LOADS of time finding all those little-but-oh-how-important errors in the actual code and finally installed the 'mod' without any errors. My NPC pops up where she should, but..at first she 'had nothing to say' and now not only does she have nothing to say, but i can also control her, as if she was in my party (but she isnt).

I'm pretty sure i messed up something with NearInifinity .cre setup, but i have no idea what that can be. I think i did not edit/clear some fields that make her PC. The tutorial was clear till that point but then i got lost. I set:
Flags :                No Flag Set
Override Script :  <NPCname>.bcs
Class/Race Scritp: None
General Script:     WTASIGHT.bcs
Default Script:     Initdlg.bcs
Death Variable:    <NPCname>
Diablog:              <exactly the same as is suposed to be created by the .D file's BEGIN line, in my case it is : BEGIN Ave_Noit so I set the dialog as Ave_Noit>

I did not chance anything else in the .cre file, and nothing at all in the .char file.

Did i do something wrong assigning those values? or maybe the problem is elsewhere?
I was so excited to make my own NPC and ...bummer

Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Workinprogress on August 10, 2008, 07:08:05 PM
Hi, I was wondering... is it possible to alter a mod on your game, as in alter dialogue wording or whatever?

If so, how?

BTW, I'm not suggesting a form of mod infringement, just if you thought that some wording or whatever was out of place.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Kulyok on August 11, 2008, 12:17:39 AM
It's possible - as long as you do it on your own computer, and don't upload it in the internet, nobody cares. Here's how: unpack the mod in your BG2 directory. Before installing the mod, go to the mod directory {Baldur's Gate 2}/ModDirectory, and edit whatever you like - dialogue, scripts, portraits. Then install.

Warning: if you don't know how to code, you may screw it up, so that you'll have to delete the result and download the mod again.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Workinprogress on August 11, 2008, 11:20:33 AM
Thanks for the tip!  :-ban
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Revi on October 06, 2008, 05:56:12 PM

// The following is the copying of Vondo's .cre file, as well as assigning his sound-set.  See the file sndslot.ids for a listing of sounds you can add.

Where should I place my NPC's sounds? I'd like her to use a custom made soundset, and I have all the .WAV files, but when I have WEIDU compile my .tp2 file it crashes on this bit:

Quote
COMPILE ~LokitheAdventurer\V#LOKI.d~
SAY SELECT_COMMON1 ~I'm here.~ [INNOC0]

When I remove the soundset assignments it doesn't crash and compiles just fine.. so I was thinking maybe the soundfiles are in the wrong place? I have them in \sounds at the moment, along with all the other custom soundsets I've used for various PC's.

Revi

PS: I know you can also assign sounds via NI, but I'd prefer it if I could do it this way.

Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Revi on October 06, 2008, 06:24:49 PM
Never mind my nubbly question, figured it out myself. Thank you for this great walkthrough, it's really helped me develop a basic understanding of how to write an NPC mod :)
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: SittingOnTheThroneOfBhaal on March 12, 2009, 01:58:31 PM
Hey, I'm quite new to modding and I've been trying to create an NPC for my game, and after going through many errors and problems using NI (windows vista...argh), and finally getting it all together, I've tried to install it using the Weidu installer, but I come up with this:


Install Component [Avaria for BG2:SoA]?
nstall, or [N]ot Install or [Q]uit?
Installing [Avaria for BG2:SoA]
Copying and patching 1 file ...
[Avaria/AVARIA.CRE] loaded, 2984 bytes
override/AVARIA.CRE copied to Avaria/backup/0/AVARIA.CRE, 2984 bytes
Copied [Avaria/AVARIA.CRE] to [override/AVARIA.CRE]
Compiling 1 dialogue file ...
ERROR: compiling [Avaria/M#AVARIA.d]!
Stopping installation because of error.

ERROR Installing [Avaria for BG2:SoA], rolling back to previous state
[Avaria/backup/0/UNSETSTR.0] SET_STRING uninstall info not found
Will uninstall   1 files for [AVARIA/SETUP-AVARIA.TP2] component 0.
  Restoring backed-up [Avaria/backup/0/AVARIA.CRE]
Avaria/backup/0/AVARIA.CRE copied to override/AVARIA.CRE, 2984 bytes
Uninstalled      1 files for [AVARIA/SETUP-AVARIA.TP2] component 0.
ERROR: Sys_error("Avaria/M#AVARIA.d: No such file or directory")

As far as I can tell is that there is something occuring during the compiling of the .d file, but after looking though it, all the coding seems fine, which I'll provide for others to see if they spot any problems.

Code: [Select]
BEGIN M#AVARIA

IF ~NumTimesTalkedTo(0)~ THEN BEGIN FirstMeeting
SAY ~You there! You look like adventuring types, help me! Please!~
IF ~~ THEN REPLY ~Slow down! Who are you and what's the problem?~ GOTO HelpA
IF ~~ THEN REPLY ~Sorry, we don't have the time.~ GOTO RejectA
END

IF ~~ THEN BEGIN HelpA
SAY ~My name is Avaria, and I need your help. I'm running from a group of assassins. Please hurry, we have to hide!~
IF ~~ THEN REPLY ~Okay, but how can we help?~ GOTO JoinPA
IF ~~ THEN REPLY ~No, I don't want to mess around with assassins.~ GOTO RejectA
END

IF ~~ THEN BEGIN JoinPA
SAY ~Oh, I don't know! Hide me! Let me join your group, I've a good hand in combat, just help me!~
IF ~~ THEN REPLY ~Alright then, you can join us.~ DO ~SetGlobal("AvariaJoined","LOCALS",1)
JoinParty()~ EXIT
IF ~~ THEN REPLY ~Sorry, I don't want you to join us, maybe another time?~ GOTO RejectA
END

IF ~~ THEN BEGIN RejectA
SAY ~WHAT? PLEASE! I'm desperate! I'm going to be killed unless you help me!~
IF ~~ THEN REPLY ~Okay then, I'm sorry. You can join us, what help do you need?~ DO ~SetGlobal ("AvariaJoined","LOCALS",1)
JoinParty()~ EXIT
IF ~~ THEN REPLY ~Sorry, it's too risky with the assassins and all that, you're on your own.~ GOTO RejectedA
END

IF ~~ THEN BEGIN RejectedA
SAY ~What?! NO! PLEASE! Damn you! Curse you! May the demon blood I carry consume you and torture you for eternity!~ DO ~EscapeArea()~ EXIT
END

BEGIN M#AVAP
IF ~Global("AvariaJoined","LOCALS",1)~ THEN BEGIN KickAv
SAY ~What? But we're not finished! Don't kick me out yet! You'll not find me again if you do!~
IF ~~ THEN REPLY ~My mistake, stay in the group.~ DO ~JoinParty()~ EXIT
IF ~~ THEN REPLY ~I'm afraid so, don't worry, you'll be fine out there on your own.~ DO ~EscapeArea()~ EXIT
END

I've also got the .cre, .baf, backup, .tp2 and .d in my Avaria file in the BG2 directory.

Also, I have TOB installed if that makes any difference...

All help would be apprieciated!  ;D ;D ;D ;D ;D
Any help would be really appreciated.

Basic overview of my new NPC is a character who is half human half demon, with their own quest and also the ability to transform into a demon due to her dark heritage. This is of course something I'll come to later once I actually get this bit working, just want to make sure the NPC appears in the game (docks) first.  :)
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: SittingOnTheThroneOfBhaal on March 12, 2009, 01:59:59 PM
Sorry about the dialouge bit being in right-alignment, I edited it that way before to make it seperate from what I was saying, but then decided against it and changed it back...but seems like it didnt...lol :)
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: GeN1e on March 12, 2009, 03:16:24 PM
ERROR: Sys_error("Avaria/M#AVARIA.d: No such file or directory")

I believe weidu says it can't find 'avaria/m#avaria.d'. Perhaps it's 'avaria/avaria.d' currently? Nothing better comes to mind.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: SittingOnTheThroneOfBhaal on March 13, 2009, 04:50:18 PM
it definitely isn't that, my .d file is named M#AVARIA.d and is located in the BGII SoA directory in Avaria file (i.e BGII SoA - Avaria - M#AVARIA.d)
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: jcompton on March 13, 2009, 10:19:56 PM
I fixed the right-align tags and replaced them with code tags, which are much more appropriate to the situation.

Anyway, Genie's right and it certainly seems to be saying that the file isn't there. Are you sure it's not misspelled? It happens from time to time to those of us making up fantasy names...
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: DavidW on March 14, 2009, 04:20:36 AM
It's possible to run into trouble with Vista's user account control - the dialogue file may be in a fake folder that pretends to be, but isn't, in the protected C:\program files folder. If that is the problem, simple solutions are (a) install your games somewhere other than the C:\Program Files folder; (b) disable UAC (which Microsoft doesn't recommend; doubtless this thread will now be hijacked by dozens of people who disagree!). A more complex solution is to turn off file and registry virtualization - a couple of minutes on Google will tell you how.
Title: NEED HELP!
Post by: FarisCultist on May 23, 2009, 10:39:34 PM
IN section 2 right at the beginning where it tells you to convert .chr to .cre. The "File Menu" thing is greyed out and won't let me change it. I've tried opening in new window, also didn't work. Whats going on?
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: jastey on May 24, 2009, 04:53:10 AM
Do you also have this problem if opening one of the game's character files?
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: FarisCultist on May 24, 2009, 03:23:40 PM
No, everything else loadsa up just fine. Just the .chr convert to .cre is greyed out for every chr
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: berelinde on May 24, 2009, 06:27:26 PM
To be honest with you, I use ShadowKeeper to convert CHRs to CREs. I have to use NI to edit the files afterward, removing the exportability flags, among other things, but it's really easy for me to do it this way.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Jarno Mikkola on May 25, 2009, 04:48:25 AM
Just the .chr convert to .cre is greyed out for every chr
Are you sure you selected the chr file before you go to the File to adjust it.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: A_Guest on June 02, 2009, 09:35:58 PM
I feel really stupid, and it's probably something i've overlooked, but my computer can't read .d files, and i don't know how to get it to read them. I'm very new to modding in the sense that i have never done this before, so this will be a first for me, but i'm pretty good (not the best) at teaching myself, and i was wondering if someone could tell me how i'm supposed to read the .d files and whatever other files that exist in this faq
The fact of the matter is, i can't complete the first step because i can't even access a .d file on my computer.
Any help would be wonderful, and please don't troll me, i'm sensitive ;P
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: berelinde on June 02, 2009, 10:05:36 PM
No trolling here. The extensions WeiDU uses are baffling enough, even once you get used to it.

When you want to open a .d file, you should be able to use any text editor, although you will probably have to specify the program you want to use. For example, if you've got the Tiax mod, you'll see some D files. Pick one, right click on it, and choose "Open with". Then you would select your text editor.

Common text editors used for coding are ConTEXT and Crimson Editor, though WordPad and even Notepad will work.

Hope that helped.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: A_Guest on June 03, 2009, 02:36:55 AM
Oh my goodness, i should have realized to try that thank you so much.

Now, i have a bit of another problem:

I made my documentation of all the dialog the character would need, then saved it, made the char in a game, exported, changed to CRE file, and changed the DV; but when i try to give them the override scripts, and such, i can't because (im guessing) it doesnt' recognize the file i write down. Was i supposed to move my .d file to a certain folder or something?
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: berelinde on June 03, 2009, 10:02:50 AM
There's an easier way to set the DV, dialogue file, override script, portraits, etc. than doing it in NI. Just set them in the tp2. You're going to be compiling the files as part of your tp2, so you might as well assign them there, as well.

I'll include an example from one of my mods to give you an example. You'll notice that I even equip the character using the tp2. I've had too many CRE corruptions using NI or DLTCEP to want to carry on using either more than I have to.

Code: [Select]
COPY ~haldamir/character/b!hal.cre~ ~override~
  ADD_CRE_ITEM ~leat04~ #0 #0 #0 ~IDENTIFIED~ ~ARMOR~
  ADD_CRE_ITEM ~sw1h01~ #0 #0 #0 ~IDENTIFIED~ ~SHIELD~
  ADD_CRE_ITEM ~sw1h02~ #0 #0 #0 ~IDENTIFIED~ ~WEAPON1~ EQUIP
  ADD_CRE_ITEM ~potn52~ #0 #0 #0 ~IDENTIFIED~ ~QITEM1~
  ADD_CRE_ITEM ~bow01~ #0 #0 #0 ~IDENTIFIED~ ~INV1~
  ADD_CRE_ITEM ~arow01~ #14 #0 #0 ~IDENTIFIED~ ~QUIVER1~
  ADD_CRE_ITEM ~arow02~ #5 #0 #0 ~IDENTIFIED~ ~QUIVER2~
  SAY NAME1 ~Haldamir~
  SAY NAME2 ~Haldamir~
  WRITE_ASCII 0x248 ~B!HALS~ #8 // assign override script
  WRITE_ASCII 0x2cc ~B!HAL~ #8 // assign pre-joining dialogue file
  WRITE_ASCII 0x280 ~B!HALDAMIR~ #32 // assign DV
  WRITE_ASCII 0x34  ~b!haldas~ #8     // assign small portrait
  WRITE_ASCII 0x3c  ~b!haldam~ #8     // assign medium portrait
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: jastey on June 03, 2009, 01:18:45 PM
In NI, do right click on the script field, and select "edit as string". Then you can double click on the field and type the script's name in, without the ending (bcs).

But what berelinde said. It might seem complicated, but if you know the principle once the bcs etc. setting via tp2 is very comfortable. The hex-numbers needed (for example 248 for the override script ) you can see in NI.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Tieflingz on November 26, 2009, 02:15:14 AM
Reading all the comments there are, experienced and inexperienced modders alike, I start to wonder....

How'd the very first unofficial modder learn all these? Where did his/her tools come from... Must've been tough

Bless you all, Oghma tends to favor the inexpeirenced modders with experienced modders willing to share!
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Mobius572 on January 14, 2010, 05:50:36 PM
What am I doing wrong? I followed the instructions and this is what happened:

Problem:

I run ZaknafeinTheNPC-setup but I get this: [E:\Infinity Engine\BGII-SoA\ZakTheNPC\ZaknafeinTheNPC-setup.exe] WeiDU version 185.
[ZAKNAFEINTHENPC-SETUP.TP2] PARSE ERROR at line 1 colum 0--1
Near Text: syntax error

[ZAKNAFEINTHENPC-SETUP.TP2] ERROR at line 1 colum 0--1
Near Text: Parsing.Parse_error
ERROR: parsing [ZAKNAFEINTHENPC-SETUP.TP2] Parsing.Parse_error
ERROR: problem parsing TP file [ZAKNAFEINTHENPC-SETUP.TP2] Parsing.Parse_error

FATAL ERROR: Parsing.Parse_error

Press ENTER to Quit. >:(

Solution: Is there one? What's going on? Help me, somebody! ???















Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: berelinde on January 15, 2010, 02:24:59 AM
Your weidu installer should named setup-Z...etc...NPC.exe and your tp2 should be named setup-Z...etc...NPC.tp2.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Mobius572 on January 15, 2010, 03:41:30 PM
I did that and the same thing happened. Could someone please e-mail me about helping me with the problems at warjack827@yahoo.com ?
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: guest on June 17, 2010, 08:00:42 AM
Hi I'm not sure if anyone will see this, but I've been trying to follow the NPC Creation tutorials and have done okay so far. But when I go to install my little mod through WeiDU, I get a syntax error/parse error. A few of the previous ones I fixed myself (missing tildes etc) But now I've been looking at this little bit of dialogue which is causing the problem, and I can't for the life of me figure out what's wrong! I think I just need some fresh eyes, or a slap because it will be obvious, but it's driving me mad.

Code: [Select]
IF ~~ THEN BEGIN SalemJoin
SAY ~Hmm. Sit here and drink myself to death, or travel on an adventure with a stranger? Let me just pay my tab to the barkeep and we'll be off!~
IF ~~ THEN DO ~SetGlobal("SALEMJoined","GLOBAL",1) JoinParty()~ EXIT
END

Hope someone will see this, worth a try.
I never realised making a mod could be so frustrating but so strangely addictive at the same time!
Regards, N.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: jcompton on June 17, 2010, 06:34:22 PM
You should include the exact error text, and a broader scope of the code. Very often when you get an error in a piece of code which otherwise looks correct, it means the real problem lurks just above where the error message is displayed--such as an unclosed tilde, or a missing (or extraneous) END, etc.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: SixOfSpades on July 24, 2010, 06:27:52 PM
My NPC itself seems to be basically functional (I can CLUA him in, etc.), but I'm having problems with the scripting. I'm trying to place him in AR0412 (the area in the Planar Sphere with Tolgerias and the hot/cold rooms).

Before installing, looking at AR0412.are in Infinity Explorer says that the area's script is AR0412. Clicking on that filename, however, does nothing, as there *is* no AR0412.bcs in Scripts.bif or the Override folder.

From my TP2:
COPY ~Tweakpack6/s6harvid.cre~ ~override~ // Harvidion
  SAY NAME1 ~Harvidion~
  SAY NAME2 ~Harvidion~
COMPILE ~Tweakpack6/s6harvid.baf~ // Harvidion's AI
APPEND ~mastarea.2da~ ~AR0412  value~  // Allow local variables in AR0412
  UNLESS ~AR0412~
COPY_EXISTING ~AR0412.are~ ~override/AR0412.are~
  WRITE_ASCII 0x94 ~AR0412~
BUT_ONLY_IF_IT_CHANGES
EXTEND_TOP ~ar0412.bcs~ ~Tweakpack6/ar0412.baf~ // Spawn script


I've read most of this thread, with particular attention to Page 3, where Usually Lurking is having problems that sound like mine--per the advice given to him by Ghreyfain and Bons, I added the APPEND and COPY_EXISTING sections to my own code.

After installing, the area behaves exactly as it did before. Pulling up Infinity Explorer again, AR0412.ARE still uses AR0412.BCS as its script--and clicking on that filename still does nothing, because the game can't seem to find it: I can see AR0412.BCS in the Override folder, and if I have Infinity Explorer pull it from there it looks all right . . . but it's still not in the Scripts.bif menu, and it still doesn't seem to be attached to AR0412.ARE, so the script never runs, and my NPC never appears.

What am I missing here?
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Echon on July 24, 2010, 06:38:41 PM
All areas in the game are assigned a script which corresponds to the area filename regardless of whether there is such a script or not. Perhaps the problem lies in patching a non-existant file. Try simply COPYing a new BAF.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: berelinde on July 24, 2010, 06:44:14 PM
Never mind. You already tried my suggestion.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Kulyok on July 25, 2010, 12:39:24 AM
/* stupid mode on */ Are you sure you're compiling AR0412.BAF in your setup.tp2? Because this is about the only thing that could be wrong.

I don't know _anything_ about areas and patching. However, I once had to install a NPC in prison area(AR1005), which, too, didn't have a script, and the three lines(lines you have in your script) worked perfectly:

COPY_EXISTING ~ar1005.are~ ~override~
WRITE_ASCII 0x94 ~AR1005~
BUT_ONLY_IF_IT_CHANGES

/* stupid mode off... maybe */
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Wisp on July 25, 2010, 05:09:41 AM
Can we see your spawn .baf?
I don't know Infinity Explorer well enough to comment on its behaviour, but your code should work.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Miloch on July 25, 2010, 01:57:02 PM
After installing, the area behaves exactly as it did before. Pulling up Infinity Explorer again, AR0412.ARE still uses AR0412.BCS as its script--and clicking on that filename still does nothing, because the game can't seem to find it: I can see AR0412.BCS in the Override folder, and if I have Infinity Explorer pull it from there it looks all right . . . but it's still not in the Scripts.bif menu, and it still doesn't seem to be attached to AR0412.ARE, so the script never runs, and my NPC never appears.
Well... it's not going to be biffed unless you did that explicitly. EXTEND_TOP should create a non-existing script the same way EXTEND_BOTTOM should (which, incidentally, is probably better in most cases, since it won't mess up any OnCreation blocks that have to run first). Use a #8 after your WRITE_ASCII since it's less than 8 characters.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: SixOfSpades on July 25, 2010, 04:48:06 PM
Okay, it works now . . . kinda. Turns out that the stick I was using to beat on the side of my computer to make it work was a couple of sizes too small, and one of the creatures I was manipulating had no death variable. I was also thrown a bit by the way that Near Infinity "can't" find .BCS files that are sitting in the Override (unless you explicitly tell it to look there), but Infinity Explorer and DLTCEP can. So now, AR0412.ARE is indeed running AR0412.BCS, which is this:

IF
   Global("HarvidionSpawn","AR0412",0)
THEN
   RESPONSE #100
      ActionOverride("tolger2",DestroySelf())
      ActionOverride("tolmag02",DestroySelf())
      SetGlobal("HarvidionSpawn","AR0412",1)
END

IF
   Global("HarvidionSpawn","AR0412",1)
   Global("PowerObsidianSphere","AR0413",1)
THEN
   RESPONSE #100
      CreateCreature("tolger2",[87.128],9) // Tolgerias
      CreateCreature("tolmag02",[102.140],8) // Mage
      CreateCreature("s6harvid",[110.98],0) // Harvidion
      SetGlobal("HarvidionSpawn","AR0412",2)
END


The first half runs just fine: When you enter the area, Tolgerias and his sidekick Mage aren't there. But when you come back after re-powering the Sphere, they . . . still aren't there. Is my mistake that I'm trying to access a variable local to AR0413 from AR0412? All 3 creatures have death variables identical to their filenames, by the way.

[ADD]
Use a #8 after your WRITE_ASCII since it's less than 8 characters.
I've dropped the COPY_EXISTING and WRITE_ASCII bit from my TP2, as all it was really doing was rewriting a script reference that was already there. [/ADD]
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Echon on July 25, 2010, 04:56:43 PM
Is my mistake that I'm trying to access a variable local to AR0413 from AR0412?

No. Area variables can be seen by all other scripts.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: SixOfSpades on July 25, 2010, 08:04:20 PM
Sorry, my bad: PowerObsidianSphere is a GLOBAL, not area-based. Everything works now. Thanks, everyone.  :)
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: YouMustGatherYourParty on August 18, 2010, 02:34:32 PM
Hi, new poster here!

I have been following this tutorial(love it btw!) and my problem is this:

My NPC spawns in AR1000 at the cords i have specified in the AR1000.BAF file and also starts walking towards/trying to initiate dialogue(According to initdlg.bcs in my CRE file) with my PC but then nothing happens. My NPC is "blue"/neutral and the code of my .d file, provided by Ghrey, is slightly modified as to fitting my NPC using my prefix Q? and the name of my NPC "Zero":

BEGIN Q?Zero

IF ~NumTimesTalkedTo(0)~ THEN BEGIN FirstMeeting
SAY ~Greetings! My name is Zero.~
IF ~GlobalLT("Chapter","GLOBAL",1)~ THEN REPLY ~Hey Zero, you seen Irenicus around here?~ GOTO InquireIrenicus
IF ~~ THEN REPLY ~Heya.~ GOTO Greet
IF ~Class(Player1,PALADIN)~ THEN REPLY ~I know a paladin when I see one!~ GOTO BothPaladins
IF ~~ THEN REPLY ~Go away.~ GOTO GoAway
END  //Only posting this part, please tell me if you need the rest

I set the third parameter of GlobalLT("Chapter","GLOBAL",1) to "1" since i wanted to test my new NPC from a new game(I assumed this was ok), and then used CLUAConsole:MoveToArea("AR1000") straight out of the Irenicus dungeon, thats all the details i can think of atm.

Would be greatful for some pointers!

/YouMustGatherYourParty
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Ipsy on August 18, 2010, 04:36:53 PM
Quote
GlobalLT("Chapter","GLOBAL",1)
Not possible. The game starts in chapter 1 - there's no chapter 0/prologue.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: YouMustGatherYourParty on August 19, 2010, 02:51:36 PM
Quote
GlobalLT("Chapter","GLOBAL",1)
Not possible. The game starts in chapter 1 - there's no chapter 0/prologue.

Aha, i see, thanks for the explanation.  :)

/YouMustGatherYourParty
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: AJ on September 23, 2010, 01:31:20 AM
and now im confused...it didnt work i got lost at the .CRE file maybe im not supposed to try making NPC's...
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Mobius572 on November 25, 2010, 12:48:08 PM
I'm not sure on the TP2 though, somebody help me out?-
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Pomacanthus on January 13, 2013, 01:38:37 PM
Baffling. Sorry, this is not a noobs guide at all. It is quite obvious that a lot of assumptions are made about the new 'modders' knowledge here.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Kaeloree on January 13, 2013, 05:10:28 PM
Perhaps if you asked some questions, we'd be able to help you?
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Kulyok on January 13, 2013, 11:28:33 PM
It is workable, if you just try to "turn off" your head and just do every line in the tutorial diligently, without thinking - i.e. create a blank text file in the Notepad, later rename it to jondo.dlg via Total Commander, then open and edit it via F4, and do all the other instructions in the tutorial to the letter - not thinking, not criticizing, not trying to do better, just doing. It's tedious, yes, but it's a very good start.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Anonymous Mouser on March 12, 2013, 12:36:54 PM
Very helpful tutorial. I used it in conjunction with other tutorials to make a workable joinable NPC.

However, I'm running into an irritating issue. The NumTimesTalkedTo(0) and NumTimesTalkedToGT(0) variables aren't working for me. My NPC will start the same, first conversation every time she's clicked on without going to the NumTimesTalkedToGT(0) block of text.


Here are some examples of my code, the text obviously changed.

This is the first block:

Code: [Select]
BEGIN M#JUlbra

APPEND ~M#JUlbra~
IF ~NumTimesTalkedTo(0)~ THEN BEGIN Greeting
SAY ~Hello~
IF ~~ THEN REPLY ~Hi.~ GOTO control
IF ~~ THEN REPLY ~Go away.~ GOTO gamble
IF ~~ THEN REPLY ~I don't have time for such a stupid person.~ EXIT
END

This is the last block that should be the second conversation:

Code: [Select]
IF ~NumTimesTalkedToGT(1)~ THEN BEGIN Second
SAY ~My, my, is curiousity eating you yet?~
IF ~~ THEN REPLY ~What did you do exactly?~ GOTO explain
IF ~~ THEN REPLY ~Still not sure.~ GOTO goodbye
IF ~~ THEN REPLY ~What are your talents exactly?~ GOTO talents
END
END

The last block/second conversation is not firing, even when I change the code to this:

Code: [Select]
IF ~NumTimesTalkedToGT(0)~ THEN BEGIN Second
SAY ~My, my, is curiousity eating you yet?~
IF ~~ THEN REPLY ~What did you do exactly?~ GOTO explain
IF ~~ THEN REPLY ~Still not sure.~ GOTO goodbye
IF ~~ THEN REPLY ~What are your talents exactly?~ GOTO talents
END
END

A little help would be greatly appreciated.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Kulyok on March 12, 2013, 01:33:34 PM
NumTimesTalkedToGT(0) is what you need, yes. It definitely works for me in Assassinations, for one.  However, while it works well for non-joinable quest NPCs, with a joinable NPC, you might run into problems with keeping score later(not to mention your current problem). I would rather advise you

1) to use a Global variable for that:
IF ~Global("PrefixedVariableFirstDLG","GLOBAL",0)~ f
SAY ~Hello~
++ ~Hi.~ DO ~SetGlobal("PrefixedVariableFirstDLG","GLOBAL",1)~ + control
++ ~Go away.~ DO ~SetGlobal("PrefixedVariableFirstDLG","GLOBAL",1)~ +  gamble
IF ~~ THEN REPLY ~I don't have time for such a stupid person.~ DO ~SetGlobal("PrefixedVariableFirstDLG","GLOBAL",1)~ EXIT
END

IF ~Global("PrefixedVariableFirstDLG","GLOBAL",0)~ second
...

2) Try use shorthand for scripting(the sort I wrote above; also, if you go to http://www.pocketplane.net/oneday and download, say, Coran, his code is a good template, too).

3) If you're serious about your NPC, at some point you might need to register a unique prefix for ALL your filenames and variable names here to prevent incompatibilities:
http://forums.blackwyrmlair.net/index.php?showtopic=113
You definitely shouldn't be using M#, because it's a conflicting prefix, unfortunately.


EDIT: And you probably will get better results if you post EXACT code you have a problem with, because rephrasing it probably loses something in the process(perhaps the very error).
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Anonymous Mouser on March 12, 2013, 02:51:01 PM
Awesome! Thank you for the tips. And setting the global variable worked like a charm.
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: tibicina on May 16, 2014, 01:34:13 PM
Two questions. I created a working, installable NPC. Got her to spawn correctly, created and assigned her a kit, and have created custom items for her. I've read that they can be assigned to her (and installed) via the tp2, but want to be sure that it'll work to have the actual item files in an internal "items" folder inside my mod folder when I install. The game, essentially, will be adding the items to the override at install, but I'm anxious about whether the tp2 will look for the items.

The other question, which may really not be a beginner question is how to get her to "level up" at joining if she's brought into the party after level 1. I've observed other NPC mods do this and am willing to take a stab at messing with coding if necessary. She has a kit assigned to her already installed, so the game knows what to do with her as she levels, but I don't know how to code the actual command to add levels similar to my PC, if that makes sense...

Thanks!!  ;D
Title: Re: A Beginner's Guide to NPC creation with WeiDU
Post by: Kulyok on May 17, 2014, 12:26:26 AM
XP code is easy - if you download Branwen tutorial NPC mod from http://www.pocketplane.net/oneday , you'll see XP adjustments in her main script(everything is commented, you'll find it easily).

As for custom items, this is my preferred way of dealing with these: install them in the game first, then open your NPC's cre file via Near Infinity or DLTCEP, and choose these items(since they're installed already, you'll be able to equip them). This way you needn't add them to the .cre via .tp2(you can, but it's more of a headache. But that's just me).