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

Biubid_boy

  • Guest
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #100 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.

Crevan the Liar

  • Guest
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #101 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)

Offline Grim Squeaker

  • Fallen
  • Planewalker
  • *****
  • Posts: 1019
  • Gender: Male
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #102 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
"You alone can make my song take flight..."

Offline KingMick

  • Planewalker
  • *****
  • Posts: 32
  • is woefully new to modding
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #103 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?  ???

Offline Kismet

  • Devil's Minion #5
  • Global Moderator
  • Planewalker
  • *****
  • Posts: 653
  • Gender: Female
  • Veni; Vidi; Velcro.
    • Pocket Plane Group
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #104 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.
Cailean - An archer NPC for the insatiably nosy!  Guaranteed more fun than shampooing cats!

Offline KingMick

  • Planewalker
  • *****
  • Posts: 32
  • is woefully new to modding
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #105 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 :)

Offline Grim Squeaker

  • Fallen
  • Planewalker
  • *****
  • Posts: 1019
  • Gender: Male
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #106 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.
"You alone can make my song take flight..."

Offline KingMick

  • Planewalker
  • *****
  • Posts: 32
  • is woefully new to modding
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #107 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 ;)

Offline KingMick

  • Planewalker
  • *****
  • Posts: 32
  • is woefully new to modding
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #108 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.

Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #109 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.
Earn Money Sleeping.

Offline KingMick

  • Planewalker
  • *****
  • Posts: 32
  • is woefully new to modding
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #110 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.

Offline Grim Squeaker

  • Fallen
  • Planewalker
  • *****
  • Posts: 1019
  • Gender: Male
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #111 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...
"You alone can make my song take flight..."

Offline KingMick

  • Planewalker
  • *****
  • Posts: 32
  • is woefully new to modding
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #112 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

Offline Grim Squeaker

  • Fallen
  • Planewalker
  • *****
  • Posts: 1019
  • Gender: Male
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #113 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.
"You alone can make my song take flight..."

Offline taplonaplo

  • Planewalker
  • *****
  • Posts: 14
  • Gender: Male
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #114 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)
« Last Edit: March 14, 2006, 04:28:14 PM by taplonaplo »

flameswing

  • Guest
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #115 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?

Offline Grim Squeaker

  • Fallen
  • Planewalker
  • *****
  • Posts: 1019
  • Gender: Male
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #116 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.
"You alone can make my song take flight..."

Offline KingMick

  • Planewalker
  • *****
  • Posts: 32
  • is woefully new to modding
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #117 on: March 14, 2006, 05:49:15 PM »
thanks taplonopa, I will try those things

Offline KingMick

  • Planewalker
  • *****
  • Posts: 32
  • is woefully new to modding
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #118 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?
« Last Edit: March 14, 2006, 06:32:48 PM by KingMick »

Offline Kismet

  • Devil's Minion #5
  • Global Moderator
  • Planewalker
  • *****
  • Posts: 653
  • Gender: Female
  • Veni; Vidi; Velcro.
    • Pocket Plane Group
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #119 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~
Cailean - An archer NPC for the insatiably nosy!  Guaranteed more fun than shampooing cats!

Offline KingMick

  • Planewalker
  • *****
  • Posts: 32
  • is woefully new to modding
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #120 on: March 14, 2006, 06:47:15 PM »
Yes and yes.

Offline KingMick

  • Planewalker
  • *****
  • Posts: 32
  • is woefully new to modding
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #121 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...
« Last Edit: March 14, 2006, 07:15:34 PM by KingMick »

flameswing

  • Guest
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #122 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!

Offline taplonaplo

  • Planewalker
  • *****
  • Posts: 14
  • Gender: Male
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #123 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 =(
« Last Edit: March 15, 2006, 04:53:21 AM by taplonaplo »

Offline Grim Squeaker

  • Fallen
  • Planewalker
  • *****
  • Posts: 1019
  • Gender: Male
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #124 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.
"You alone can make my song take flight..."

 

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