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

Offline FarisCultist

  • #1 Pirate Lover!
  • Planewalker
  • *****
  • Posts: 20
  • Gender: Male
  • "I want to see buttons of me around town."
    • Counter-Strike Clan: Heaven or Hell Forums
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #300 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

Offline berelinde

  • Planewalker
  • *****
  • Posts: 1188
  • Gender: Female
    • Gavin, cleric of Lathander, for Tutu
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #301 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.

Offline Jarno Mikkola

  • The Imp.
  • Planewalker
  • *****
  • Posts: 184
  • Gender: Male
    • website jocuri
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #302 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.

A_Guest

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

Offline berelinde

  • Planewalker
  • *****
  • Posts: 1188
  • Gender: Female
    • Gavin, cleric of Lathander, for Tutu
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #304 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.

A_Guest

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

Offline berelinde

  • Planewalker
  • *****
  • Posts: 1188
  • Gender: Female
    • Gavin, cleric of Lathander, for Tutu
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #306 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

Offline jastey

  • Planewalker
  • *****
  • Posts: 1424
  • Gender: Female
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #307 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.

Offline Tieflingz

  • Backstabber
  • Planewalker
  • *****
  • Posts: 5
  • Gender: Male
  • Backstabber
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #308 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!
All hail Lawful Evilness<br />Oh, and Hiding in Shadows/Invisible Potion Gulping with Backstabbing in the face.

Offline Mobius572

  • Planewalker
  • *****
  • Posts: 11
  • Gender: Male
  • A God among Men
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #309 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! ???















"Death comes swiftly.  FEEL ITS ICY BREATH!"-Sarevok Anchev

Offline berelinde

  • Planewalker
  • *****
  • Posts: 1188
  • Gender: Female
    • Gavin, cleric of Lathander, for Tutu
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #310 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.

Offline Mobius572

  • Planewalker
  • *****
  • Posts: 11
  • Gender: Male
  • A God among Men
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #311 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 ?
"Death comes swiftly.  FEEL ITS ICY BREATH!"-Sarevok Anchev

guest

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

Offline jcompton

  • Niche Exploiter
  • Administrator
  • Planewalker
  • *****
  • Posts: 7244
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #313 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.
Cespenar says, "Kelsey and friends be at the Pocket Plane? Ohhh yesssss!" http://www.pocketplane.net

Offline SixOfSpades

  • Planewalker
  • *****
  • Posts: 821
  • Gender: Male
    • Volothamp's Comeuppance
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #314 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?

Offline Echon

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 1941
  • Gender: Male
    • The Fields of the Dead
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #315 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.

Offline berelinde

  • Planewalker
  • *****
  • Posts: 1188
  • Gender: Female
    • Gavin, cleric of Lathander, for Tutu
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #316 on: July 24, 2010, 06:44:14 PM »
Never mind. You already tried my suggestion.
« Last Edit: July 24, 2010, 06:52:53 PM by berelinde »

Offline Kulyok

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 6253
  • Gender: Female
  • The perfect moment is now.
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #317 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 */

Offline Wisp

  • Planewalker
  • *****
  • Posts: 1108
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #318 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.

Offline Miloch

  • Barbarian
  • Planewalker
  • *****
  • Posts: 1030
  • Gender: Male
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #319 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.

Offline SixOfSpades

  • Planewalker
  • *****
  • Posts: 821
  • Gender: Male
    • Volothamp's Comeuppance
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #320 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]
« Last Edit: July 25, 2010, 05:00:21 PM by SixOfSpades »

Offline Echon

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 1941
  • Gender: Male
    • The Fields of the Dead
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #321 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.

Offline SixOfSpades

  • Planewalker
  • *****
  • Posts: 821
  • Gender: Male
    • Volothamp's Comeuppance
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #322 on: July 25, 2010, 08:04:20 PM »
Sorry, my bad: PowerObsidianSphere is a GLOBAL, not area-based. Everything works now. Thanks, everyone.  :)

YouMustGatherYourParty

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

Offline Ipsy

  • Planewalker
  • *****
  • Posts: 12
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #324 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.

 

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