Author Topic: NPC creation questions  (Read 8953 times)

Offline neriana

  • Planewalker
  • *****
  • Posts: 585
  • Gender: Female
    • Darien NPC for BG2
NPC creation questions
« on: April 06, 2004, 04:44:30 AM »
I'm sure the following is painfully obvious to anyone with a clue, but I am not in that category.

From Ghreyfain's NPC  faq:
"Once it's in .cre format, you can assign it its Death Variable, Dialogue file, Scripts (if any), and Name. This is all fairly simple, so I don't think I need to explain any futher. Save it and that's that."

1) Should his Death Variable just be his filename? In this case, J#Voldo?
2) How do you assign him a dialogue file before such file technically exists? At this point, all I've got is a .d file.
3) I think I get the scripts part.
4) It took me about half an hour to figure out how to assign a name and I'm 90% sure that I did it wrong, since I needed to use both NI and Shadowkeeper. Could someone please tell me the RIGHT way to do it?

Thanks!
The color of infinity inside an empty glass.

Offline Kismet

  • Devil's Minion #5
  • Global Moderator
  • Planewalker
  • *****
  • Posts: 653
  • Gender: Female
  • Veni; Vidi; Velcro.
    • Pocket Plane Group
Re: NPC creation questions
« Reply #1 on: April 06, 2004, 07:55:01 AM »
A death variable doesn't have to be the NPC's name, although it generally is (with your own modding prefix in front of course.)

If you use DLTCEP you can assign the dialog file before it exists.  If you're using NI I think you right click on the space and choose "edit as string".  I don't have NI here at work so I don't think that's exactly right but it's close. :)

You assign the NPC's name in the .tp2 file.
COPY ~MyMod\MyNPC.cre~ ~override\MyNPC.cre~
  SAY NAME1 ~MyNPC~
  SAY NAME2 ~MyNPC~
Cailean - An archer NPC for the insatiably nosy!  Guaranteed more fun than shampooing cats!

Offline neriana

  • Planewalker
  • *****
  • Posts: 585
  • Gender: Female
    • Darien NPC for BG2
Re: NPC creation questions
« Reply #2 on: April 06, 2004, 05:13:14 PM »
My obliviousness about naming probably comes from trying to slog through the WeiDu readme at 2 AM. I downloaded DLTCEP and it does make things easier, as both Bons and Kismet said. Thank you!
The color of infinity inside an empty glass.

Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
Re: NPC creation questions
« Reply #3 on: April 06, 2004, 06:53:04 PM »
A point which should be made is that the name the .cre has on your computer doesn't matter.  It could be "Long Sword +1: This sword is magical.  STATISTICS: Blah", but when the mod is installed, the code Kismet posted above is what adds the strings to the users dialog.tlk and changes the .cre to refer to those strings.

A good way to assign non-existant dialogue to a .cre is with NI.  Right-click the dialog field, select "edit as string" and then write in what the dialog file will be named without the .dlg extension, and hit enter.

The death variable (DV) can be anything up to 32 characters, though I recommend something a bit shorter.  This is used in various .2da files like pdialog.2da, interdia.2da, as well as script triggers and actions like InParty("DV") and Dead("DV").

Each .cre variant should also have the SAME death variable, so that scripts work for all versions of the .cre that can possibly join your party.
Earn Money Sleeping.

Offline hlidskialf

  • Owner of the first chair with an ale-fridge
  • Planewalker
  • *****
  • Posts: 100
  • Gender: Male
Re: NPC creation questions
« Reply #4 on: April 07, 2004, 01:48:04 AM »
The death variable (DV) can be anything up to 32 characters, though I recommend something a bit shorter. 

Another reason against huge DV is that when a cre dies, it's DV gets tagged onto the end of the "SPRITE_IS_DEAD_" global. In summation, they can't exceed 32, or your game will turn your fridge off and your ale gets warm.   :'(
Unknown to most, hlidskialf is the first incarnation of the eternal warrior with a beer fridge in his chair.

Offline SimDing0™

  • Back In Black
  • Global Moderator
  • Planewalker
  • *****
  • Posts: 3496
  • Gender: Male
  • Word Enhancer
Re: NPC creation questions
« Reply #5 on: April 07, 2004, 09:28:19 AM »
18 is generally considered an acceptable maximum, since it allows for SPRITE_IS_DEAD.

I wonder what happens if your death variable has a space in. Do variable names take spaces?

Offline neriana

  • Planewalker
  • *****
  • Posts: 585
  • Gender: Female
    • Darien NPC for BG2
Re: NPC creation questions
« Reply #6 on: April 07, 2004, 08:29:43 PM »
OK, my NPC's in the game. I have just one problem, so far:  His text doesn't show up. I can still get him to join by hitting the correct numbers for the responses. His bio also doesn't show up,  but at least it no longer says something about Rillifane.
 
All of his (5) sounds and his name work, along with his stats etc.
The color of infinity inside an empty glass.

Offline Kismet

  • Devil's Minion #5
  • Global Moderator
  • Planewalker
  • *****
  • Posts: 653
  • Gender: Female
  • Veni; Vidi; Velcro.
    • Pocket Plane Group
Re: NPC creation questions
« Reply #7 on: April 07, 2004, 08:32:58 PM »
Sounds like you installed the mod while the game or a game editor was running (or your dialog.tlk file is write protected).  Or you didn't use a .tp2 file and didn't specify --tlkout dialog.tlk when compiling the dialogs.
Cailean - An archer NPC for the insatiably nosy!  Guaranteed more fun than shampooing cats!

Offline neriana

  • Planewalker
  • *****
  • Posts: 585
  • Gender: Female
    • Darien NPC for BG2
Re: NPC creation questions
« Reply #8 on: April 07, 2004, 08:34:22 PM »
No to all of the above, though I may have used the --tlkout function incorrectly. Checking...
The color of infinity inside an empty glass.

Offline jcompton

  • Niche Exploiter
  • Administrator
  • Planewalker
  • *****
  • Posts: 7246
Re: NPC creation questions
« Reply #9 on: April 07, 2004, 09:07:43 PM »
In general, it's a good idea to start using a TP2 as early in your design process as possible, because it lets you uninstall and reinstall easily when you make changes. And because you can't forget about --tlkout...
Cespenar says, "Kelsey and friends be at the Pocket Plane? Ohhh yesssss!" http://www.pocketplane.net

Offline neriana

  • Planewalker
  • *****
  • Posts: 585
  • Gender: Female
    • Darien NPC for BG2
Re: NPC creation questions
« Reply #10 on: April 07, 2004, 09:20:03 PM »
I have been using .tp2 from the beginning. I've tried about 8 different command line options as well, both with and without --tlkout. Why would everything else work, but the text not show up?
The color of infinity inside an empty glass.

Offline jcompton

  • Niche Exploiter
  • Administrator
  • Planewalker
  • *****
  • Posts: 7246
Re: NPC creation questions
« Reply #11 on: April 07, 2004, 09:21:42 PM »
Sorry, I mean, use a TP2 AND a Setup-xxxx.exe, rather than doing it at the command line.

Another thing that can block your ability to write to .tlk is if another WeiDU is open and installing a mod. This can happen if you're installing a mod that calls a process at the end, like viewing a README. WeiDU won't actually close and relinquish its hold on dialog.tlk until that README has been closed.
Cespenar says, "Kelsey and friends be at the Pocket Plane? Ohhh yesssss!" http://www.pocketplane.net

Offline neriana

  • Planewalker
  • *****
  • Posts: 585
  • Gender: Female
    • Darien NPC for BG2
Re: NPC creation questions
« Reply #12 on: April 07, 2004, 09:29:48 PM »
But to do that, I'd have to know how to create a Setup.exe. Which I don't. Big surprise.  ;D
The color of infinity inside an empty glass.

Offline Kismet

  • Devil's Minion #5
  • Global Moderator
  • Planewalker
  • *****
  • Posts: 653
  • Gender: Female
  • Veni; Vidi; Velcro.
    • Pocket Plane Group
Re: NPC creation questions
« Reply #13 on: April 07, 2004, 09:31:56 PM »
rename a copy of weidu.exe to setup-whateveryourtp2fileiscalled.exe
Cailean - An archer NPC for the insatiably nosy!  Guaranteed more fun than shampooing cats!

Offline Kish

  • HEROISM OK
  • Planewalker
  • *****
  • Posts: 790
    • Oversight mod.
Re: NPC creation questions
« Reply #14 on: April 07, 2004, 09:32:36 PM »
Download the latest version of WeiDU from www.weidu.org and rename it Setup-Nameofthetp2.exe .
Beauty standing amidst fiery destruction.

Offline neriana

  • Planewalker
  • *****
  • Posts: 585
  • Gender: Female
    • Darien NPC for BG2
Re: NPC creation questions
« Reply #15 on: April 07, 2004, 09:34:22 PM »
Ooh, thanks.

Edit: It works! Yay! Now I get to try something else that will break it!
« Last Edit: April 07, 2004, 09:37:13 PM by neriana »
The color of infinity inside an empty glass.

Offline neriana

  • Planewalker
  • *****
  • Posts: 585
  • Gender: Female
    • Darien NPC for BG2
Re: NPC creation questions
« Reply #16 on: April 08, 2004, 09:59:45 PM »
I can talk to the NPC when he's in the party and he'll spout his "So you've returned and want me to join you?" dialogue.  ???
The color of infinity inside an empty glass.

Offline jcompton

  • Niche Exploiter
  • Administrator
  • Planewalker
  • *****
  • Posts: 7246
Re: NPC creation questions
« Reply #17 on: April 08, 2004, 10:08:05 PM »
That's a sign of an improperly formatted PDIALOG entry, most likely.
Cespenar says, "Kelsey and friends be at the Pocket Plane? Ohhh yesssss!" http://www.pocketplane.net

Offline neriana

  • Planewalker
  • *****
  • Posts: 585
  • Gender: Female
    • Darien NPC for BG2
Re: NPC creation questions
« Reply #18 on: April 08, 2004, 10:36:02 PM »
Yes, I figured that. I basically copied code from Ghreyfain's tutorial. Here's my PDIALOG:

BEGIN E#DarienP

IF ~Global("DarienJoined","LOCALS",1)~ THEN BEGIN KickOut
SAY ~You're telling me to leave? Have you actually thought this through?~
IF ~~ THEN REPLY ~Oops, not really.~ DO ~JoinParty()~ EXIT
IF ~~ THEN REPLY ~Yes, I don't want you in the party now.~ GOTO KickedOut
END

IF ~~ THEN BEGIN KickedOut
SAY ~All right, it's your decision to make. I'll be at the Docks when you need me again.~
IF ~~ THEN REPLY ~No, I need you to wait here.~ DO ~SetGlobal("DarienJoined","LOCALS",0)~ EXIT
IF ~~ THEN REPLY ~All right, I'll find you there if I need you.~ DO ~SetGlobal("DarienJoined","LOCALS",0)~ EXIT //Goto Docks here
END

IF ~Global("DarienJoined","LOCALS",0)~ THEN BEGIN Rejoin
SAY ~You want me back?~
IF ~~ THEN REPLY ~Yes, we could use your skills.~ DO ~SetGlobal("DarienJoined","LOCALS",1)
JoinParty()~ EXIT
IF ~~ THEN REPLY ~No.~ EXIT
END

When I talk to him while he's in the party, when I kick him out, and when I talk to him after kicking him out, here's what happens:

IF ~NumTimesTalkedToGT(0)~ THEN BEGIN ReturnDialogue
SAY ~So you're back?~
IF ~~ THEN REPLY ~Yes. I've decided I want you in the party.~ DO ~SetGlobal("DarienJoined","LOCALS",1)
JoinParty()~ EXIT
IF ~~ THEN REPLY ~Yes, but I still have no use for you.~ GOTO RefusedAgain
END

The color of infinity inside an empty glass.

Offline jcompton

  • Niche Exploiter
  • Administrator
  • Planewalker
  • *****
  • Posts: 7246
Re: NPC creation questions
« Reply #19 on: April 08, 2004, 11:13:38 PM »
Show the PDIALOG.2DA line from your TP2.
Cespenar says, "Kelsey and friends be at the Pocket Plane? Ohhh yesssss!" http://www.pocketplane.net

Offline neriana

  • Planewalker
  • *****
  • Posts: 585
  • Gender: Female
    • Darien NPC for BG2
Re: NPC creation questions
« Reply #20 on: April 08, 2004, 11:57:08 PM »
APPEND ~pdialog.2da~
~E#Darien E#DarienP E#DarienJ E#DarienD E#Darien25P E#Darien25J E#Darien25D E#Darien25~
UNLESS ~E#Darien~
The color of infinity inside an empty glass.

Offline Jessayla

  • Planewalker
  • *****
  • Posts: 9
  • Gender: Female
Re: NPC creation questions
« Reply #21 on: April 09, 2004, 12:01:03 AM »
I'm certainly no expert, but I believe your problem is that your file names are too long.  Try keeping them to a maximum of 8 characters.
The Gibberlings Three, as merry a band as you ever did see!  Home to many exciting projects, including Delainy, Aklon, Tabiya, the Tiefling Sisters and the Viconia Relationship mod, along with many others.

Offline jcompton

  • Niche Exploiter
  • Administrator
  • Planewalker
  • *****
  • Posts: 7246
Re: NPC creation questions
« Reply #22 on: April 09, 2004, 12:15:51 AM »
Jess wins the prize. ALL DLG names and references must be 8 characters MAXIMUM.

So most of those entries are just being treated as "E#Darien", if they're being treated as anything at all.
Cespenar says, "Kelsey and friends be at the Pocket Plane? Ohhh yesssss!" http://www.pocketplane.net

Offline neriana

  • Planewalker
  • *****
  • Posts: 585
  • Gender: Female
    • Darien NPC for BG2
Re: NPC creation questions
« Reply #23 on: April 09, 2004, 12:20:16 AM »
Bah. Well, at least it's easy to fix. These meta-things keep biting me in the butt. Thanks.
The color of infinity inside an empty glass.

Offline neriana

  • Planewalker
  • *****
  • Posts: 585
  • Gender: Female
    • Darien NPC for BG2
Re: NPC creation questions
« Reply #24 on: April 13, 2004, 11:25:33 PM »
I've noticed that some people use ("Lovetalk","LOCALS",#) while others use ("Lovetalk","GLOBAL",#). Is there a reason to favor one over the other?
The color of infinity inside an empty glass.

 

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

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

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