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

Offline Bons

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 1237
  • Gender: Female
  • Glad Corvis Isn't Dead Club
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #75 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.

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

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

Offline Usually Lurking

  • Planewalker
  • *****
  • Posts: 15
  • Gender: Male
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #76 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.
Beware the fury of a patient man. - John Dryden

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

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

Offline Qwallath

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



     



Offline jastey

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

Offline Qwallath

  • Planewalker
  • *****
  • Posts: 23
  • Gender: Male
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #79 on: December 30, 2005, 01:16:29 PM »
Yep, that did the trick. Thanks!

Flameswing

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

Offline Bons

  • Global Moderator
  • Planewalker
  • *****
  • Posts: 1237
  • Gender: Female
  • Glad Corvis Isn't Dead Club
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #81 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 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

Newt had always suspected that people who regularly used the word "community" were using it in a very specific sense that excluded him and everyone he knew.

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

Patty

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

Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #83 on: March 09, 2006, 03:16:09 AM »
Cool. :)
Earn Money Sleeping.

Biubid_boy

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

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 #85 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?
Cailean - An archer NPC for the insatiably nosy!  Guaranteed more fun than shampooing cats!

Patty

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

Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #87 on: March 10, 2006, 01:08:50 AM »
Earn Money Sleeping.

Biubid_Boy

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

Offline Grim Squeaker

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

Biubid_boy

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

Offline Grim Squeaker

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

Biubid_boy

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

Biubid_boy

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

Offline the bigg

  • The Avatar of Fighter / Thieves
  • Planewalker
  • *****
  • Posts: 3804
  • Gender: Male
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #94 on: March 11, 2006, 07:30:51 AM »
Try posting your code.
Author or Co-Author: WeiDU (http://j.mp/bLtjOn) - Widescreen (http://j.mp/aKAiqG) - Generalized Biffing (http://j.mp/aVgw3U) - Refinements (http://j.mp/bLHoCc) - TB#Tweaks (http://j.mp/ba02Eg) - IWD2Tweaks (http://j.mp/98OFYY) - TB#Characters (http://j.mp/ak8J55) - Traify Tool (http://j.mp/g1Ry9A) - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics (http://j.mp/9UeIwB) - Nalia Mod (http://j.mp/dng9l0) - Nvidia Fix (http://j.mp/aRWjjg)
Code dumps: Detect custom secondary types (http://j.mp/hVzzXG) - Stutter Investigator (http://j.mp/gdtBn8)

If possible, send diffs, translations and other contributions using Git (http://j.mp/aBZFrq).

Biubid_boy

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

Offline Grim Squeaker

  • Fallen
  • Planewalker
  • *****
  • Posts: 1019
  • Gender: Male
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #96 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.
« Last Edit: March 11, 2006, 05:55:57 PM by Grim Squeaker »
"You alone can make my song take flight..."

Biubid_boy

  • Guest
Re: A Beginner's Guide to NPC creation with WeiDU
« Reply #97 on: March 11, 2006, 06:19:21 PM »
I get a parse error for SAY ~ dwarven smith~.

Offline Grim Squeaker

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

Biubid_boy

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

 

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