Author Topic: The Complete and Total NOOB's Guide to Creating an NPC  (Read 51720 times)

0 Members and 1 Guest are viewing this topic.

Offline theacefes

  • Global Moderator
  • Level 3
  • *****
  • Posts: 1250
  • Karma: +3/-0
  • Gender: Female
  • XTREME METAL ROCKER PUNK CHICK WITH ULTRA SURFBOARD
    • MSN Messenger - bohdi2185@msn.com
    • AOL Instant Messenger - bohdi2185
    • Yahoo Instant Messenger - theacefes@yahoo.com
    • View Profile
    • My Personal Website
    • Email
The Complete and Total NOOB's Guide to Creating an NPC
« Reply #15 on: November 18, 2005, 08:23:14 PM »
Heheh *hugs* no problem, I'm glad it helped. :D
-Ace
NPC Creation Guide - Latest Version
My Music Reels (mod-related and others)


Magical Unicorns - Because ponies are so last year.

theacefes: People probably look at our pictures and think "hmm one admin looks psychotic and the other looks like Captain Picard..."
grimsqueaker: TOGETHER THEY FIGHT CRIME

Offline Andyr

  • Level 1
  • *
  • Posts: 102
  • Karma: +0/-0
    • View Profile
    • http://www.gibberlings3.net
The Complete and Total NOOB's Guide to Creating an NPC
« Reply #16 on: November 20, 2005, 04:26:18 PM »
Quote from: "Kulyok"
Quote from: "theacefes"
CONtext is nice because of the highlighting, true.

I put notepad simply as an example, if users want to use it they can, and after they look at this thread they'll see that there are other options as well. I did my entire mod on Notepad and it worked quite easily for me, with the Go To function and all, but I'm not forcing anyone else to use it, hehe.


I'd vote for Notepad, too. It's simple to the point of primitive, and very fast. I compiled over 600 kb of dialogue over 40 minutes using it.

Besides, some of us are prohibited from installing software at work, even as light as Context.


You mod at work?
"We are the Gibberlings Three, as merry a band as you ever did see..." - Home of IE mods

<jcompton> Suggested plugs include "Click here so Compton doesn't ban me. http://www.pocketplane.net/ub"

Offline Kulyok

  • Level 1
  • *
  • Posts: 336
  • Karma: +16/-17
    • View Profile
    • http://www.pocketplane.net/xan
The Complete and Total NOOB's Guide to Creating an NPC
« Reply #17 on: December 02, 2005, 01:57:26 PM »
Quote from: "Andyr"
Quote from: "Kulyok"
Quote from: "theacefes"
CONtext is nice because of the highlighting, true.

I put notepad simply as an example, if users want to use it they can, and after they look at this thread they'll see that there are other options as well. I did my entire mod on Notepad and it worked quite easily for me, with the Go To function and all, but I'm not forcing anyone else to use it, hehe.


I'd vote for Notepad, too. It's simple to the point of primitive, and very fast. I compiled over 600 kb of dialogue over 40 minutes using it.

Besides, some of us are prohibited from installing software at work, even as light as Context.


You mod at work?


Sorry, just noticed your post. Yes, I do. Refused promotion twice past the last year, too: I can't help doing what I want to do instead of doing something I am indifferent to for more money. Programming... Brrr!

Offline markmid

  • Newbie
  • *
  • Posts: 19
  • Karma: +0/-0
    • View Profile
The Complete and Total NOOB's Guide to Creating an NPC
« Reply #18 on: March 07, 2006, 03:18:35 AM »
Hey, thanks for the guide.

Being a newbie I followed it literally to the letter, like a machine my first time through :)

There is a minor typo:

SAT HAPPY ~This group is great~

SAY Happy

I point this out for those copy pasting the code.

But more importantly I cannot select the relevant .bcs file in the near infinity list and cannot enter K#John without switching to edit as a string mode. I have done this and everything has installed fine twice, however I get the response 'John has nothing to say to you' when I try and talk to him. Now I know parts of the mod are working because when I kill john he calls out text for help and AH when he dies but the dialogue section doesn’t seem to respond yet.

I am assuming (guessing) I need to create a seperate bcs file for him, so I’ll go ahead and try and copy paste another NPC’s and edit it. I just wanted to highlight this possibility for error, to any newbie following the guide blindly like I am :).  

Perhaps someone could create some newbie directions to create .bcs files in addition or rather a quick break down of their purpose.

Thanks for the tutorial though, it has saved me a great deal of time.

Offline Shed

  • Newbie
  • *
  • Posts: 96
  • Karma: +0/-0
    • MSN Messenger - shed_plant@hotmail.com
    • Yahoo Instant Messenger - shed_plant
    • View Profile
    • http://www.shedplant.net
The Complete and Total NOOB's Guide to Creating an NPC
« Reply #19 on: March 07, 2006, 03:30:51 AM »
In your TP2:
Code: [Select]
COPY ~John/JOHN.cre~ ~override/JOHN.cre~
WRITE_ASCII DIALOG ~K#John~


Or change the offset in DLTCEP or NearInfinity.
Not a carebear.

Spellhold Studios

Offline markmid

  • Newbie
  • *
  • Posts: 19
  • Karma: +0/-0
    • View Profile
The Complete and Total NOOB's Guide to Creating an NPC
« Reply #20 on: March 07, 2006, 03:46:33 AM »
Thanks I tried your suggestion but before I could test my NPC I had a dialogue which came up something like.

’NO VALID LINKS’

As the reply. The actual NPC conversation text was forced over the player button oddly.
Quite Bizzare :)

I have uninstalled the mod and its still present but I have a fairly recent backup so it won’t take me more than a few minutes to fix. I will then experiment with your offset suggestion.

Offline Shed

  • Newbie
  • *
  • Posts: 96
  • Karma: +0/-0
    • MSN Messenger - shed_plant@hotmail.com
    • Yahoo Instant Messenger - shed_plant
    • View Profile
    • http://www.shedplant.net
The Complete and Total NOOB's Guide to Creating an NPC
« Reply #21 on: March 07, 2006, 03:59:55 AM »
You've probably made a mistake in your dialogue file. If you post it here, maybe we can see what the problem is.
Not a carebear.

Spellhold Studios

Offline markmid

  • Newbie
  • *
  • Posts: 19
  • Karma: +0/-0
    • View Profile
The Complete and Total NOOB's Guide to Creating an NPC
« Reply #22 on: March 07, 2006, 04:27:00 AM »
I have a completely fresh BG2 patched install. The NPC still requires your fix shed but is working now.

It must have been a conflict with another mod. My first lesson I guess, only mod from a fresh install, I didn’t think it would matter for this tiny alteration :)

Do all NPC’s require the fix you have posted Shed?

Slightly off topic but can I ask for a couple of tips on how to keep this NPC
as compatible as possible. I often read people posting that if the modder has tried to make their NPC compatible with other mods then it is more likely to be.

The NPC’s name was Jalen and was spawned at the very start of the game. It caused an error in the initial ctb (check the bodies) mods dialogue with Gorion for some reason.

Thanks for your help.

Offline Shed

  • Newbie
  • *
  • Posts: 96
  • Karma: +0/-0
    • MSN Messenger - shed_plant@hotmail.com
    • Yahoo Instant Messenger - shed_plant
    • View Profile
    • http://www.shedplant.net
The Complete and Total NOOB's Guide to Creating an NPC
« Reply #23 on: March 07, 2006, 04:51:29 AM »
Quote from: "markmid"
It must have been a conflict with another mod. My first lesson I guess, only mod from a fresh install, I didn’t think it would matter for this tiny alteration :)
That depends if you've been insalling/uninsalling lots of mods around your own (which tends to screw up your install, as I know from experience). I still think it's more likely you made a mistake, but I can't tell without seeing your code.

Quote
Do all NPC’s require the fix you have posted Shed?

If they're made by following this guide, yes.

Quote
Slightly off topic but can I ask for a couple of tips on how to keep this NPC
as compatible as possible. I often read people posting that if the modder has tried to make their NPC compatible with other mods then it is more likely to be.

One thing is to get your own filename prefix, so you don't call your files the same as anything in game or made by another modder. Apply here. The next things is not to overwrite files already in the game, but patch them instead. That way, if another mod has already changed the file, both changes will be kept. The third and most important note on compatibility is not to break anything ;) .

Quote
The NPC’s name was Jalen and was spawned at the very start of the game. It caused an error in the initial ctb (check the bodies) mods dialogue with Gorion for some reason.

CtB changes a lot, including the starting script.
Not a carebear.

Spellhold Studios

Offline Kulyok

  • Level 1
  • *
  • Posts: 336
  • Karma: +16/-17
    • View Profile
    • http://www.pocketplane.net/xan
The Complete and Total NOOB's Guide to Creating an NPC
« Reply #24 on: March 07, 2006, 06:13:07 AM »
Quote from: "Shed"
Quote from: "markmid"

Do all NPC’s require the fix you have posted Shed?

If they're made by following this guide, yes.


No, they don't. The guide clearly says:

Quote
17) Dialogue: Right click and choose "edit as string" and type K#John. This is the dialogue that we just made.  


If it, for any reason, doesn't work for you, dump any file called "K#John.dlg"(or whatever it is) into your override directory and re-load the game in NI. Should work.

Byte patching for a simple NPC mod is overkill. So sayeth a stupid woman.

Offline markmid

  • Newbie
  • *
  • Posts: 19
  • Karma: +0/-0
    • View Profile
The Complete and Total NOOB's Guide to Creating an NPC
« Reply #25 on: March 07, 2006, 07:12:54 AM »
Shed-

Thanks for the advice, I will reserve my prefix and post my code in a second for people to look at, its a carbon copy of what was posted here almost. Additionally I will rename my prefixes and move my NPC out of the start dungeon, I just placed him there so I could quickly test him.

Kulyok -

Sorry to nit pick but we are discussing step 10)

So not this line:

'17) Dialogue: Right click and choose "edit as string" and type K#John. This is the dialogue that we just made.'

But this line:

'10) Scroll down until you get to Override Script: type in K#John (or whatever your npc's filename is)'


I was just doing a run through of the tutorial without assuming or trying anything different than exactly what was stated. I find its best even if you think you know something, to start at the very beginning and build up from there. :)

I will post my code for you to look through, thanks to you both for the help and advice.

Offline markmid

  • Newbie
  • *
  • Posts: 19
  • Karma: +0/-0
    • View Profile
The Complete and Total NOOB's Guide to Creating an NPC
« Reply #26 on: March 07, 2006, 07:47:14 AM »
As I said the main problem is probably because I have no override .bcs file to select, so a fix is needed; I will try your suggestion next Kulyok. I am also going to hunt around for a utility to copy or create bcs files now and read up on exactly what they do.

Here however is the structure of the file which caused the strange bug in ctb's dialogue. I have renamed my NPC and its prefix, in the hopes of avoiding any conflicts. Originally it was M#, which I see is taken on the link you provided shed and could of  been the source of my strange second bug.

MJM#Ralonar.d

BEGIN MJM#Ralonar

IF ~NumTimesTalkedTo(0)~ THEN BEGIN Talk1
SAY ~Hey there, I'm Ralonar and I'm a new NPC!~

IF ~~ THEN REPLY ~I'm <CHARNAME>, how are you, Ralonar?~ GOTO HiThere
IF ~~ THEN REPLY ~I'm sorry, but I don't have time to speak with you
right now.~ GOTO EndTalk
END

IF ~~ THEN BEGIN HiThere
SAY ~I'm fine. Can I join your group?~
IF ~~ THEN REPLY ~Sure, why not?~ DO ~SetGlobal("RalonarJoined","LOCALS",1)
JoinParty()~ EXIT
IF ~~ THEN REPLY ~I'm afraid I can't accept your offer right now.
Perhaps later.~ EXIT
END

IF ~~ THEN BEGIN EndTalk
SAY ~(sigh) Very well. Just come back if you change your mind.
I'll be here.~
IF ~~ THEN EXIT
END

IF ~NumTimesTalkedGT(0)~ THEN BEGIN Talk2
SAY ~You're back! Can I join now?~
IF ~~ THEN REPLY ~Sure, why not?~ DO

~SetGlobal("RalonarJoined","LOCALS",1)
JoinParty()~ EXIT
IF ~~ THEN REPLY ~On second thought, I don't think that's a good
idea right now.~ EXIT
END

----

MJM#RalonarP.d

BEGIN MJM#RalonarP

IF ~Global("RalonarJoined","LOCALS",1)~ THEN BEGIN LeaveGroup
SAY ~What? You don't need me?~
IF ~~ THEN REPLY ~My mistake, please stay.~ DO ~JoinParty()~ EXIT
IF ~~ THEN REPLY ~You suck. Bye.~ EXIT
END


IF ~Global("RalonarJoined","LOCALS",0)~ THEN BEGIN ComeBack
SAY ~You want me to rejoin?~
IF ~~ THEN REPLY ~Welcome back.~ DO ~SetGlobal("RalonarJoined","LOCALS",1)
JoinParty()~ EXIT
IF ~~ THEN REPLY ~Nope, you still suck.~ EXIT
END

----

Setup-Ralonar.tp2

BACKUP ~Ralonar\backup~
AUTHOR ~markmid (Nospam@nospam.com)~
BEGIN ~Ralonar for BG2:SoA~

COPY ~Ralonar\Ralonar.cre~ ~override\Ralonar.cre~

SAY NAME1 ~Ralonar~
SAY NAME2 ~Ralonar~

SAY BIO ~When you ask him about his past, Ralonar says to shut up.~

SAY MORALE ~Sticking around is only going to get us killed.~
SAY HAPPY ~This group is great~
SAY UNHAPPY_ANNOYED ~You're starting to take the wrong path in
morals.~
SAY UNHAPPY_SERIOUS ~I'll leave if you dont stop!~
SAY UNHAPPY_BREAKING ~You suck, I'm outta here.~
SAY LEADER ~Yay I'm the leader!~
SAY TIRED ~I'm tired.~
SAY BORED ~I'm bored.~
SAY BATTLE_CRY1 ~TO BATTLE!~
SAY BATTLE_CRY2 ~Time to die!~
SAY BATTLE_CRY3 ~DIE NOW!~
SAY BATTLE_CRY4 ~DIE!~
SAY DAMAGE ~Ow!~
SAY DYING ~AH!~
SAY HURT ~Help me!~
SAY AREA_FOREST ~We're in a forest.~
SAY AREA_CITY ~We're in a city~
SAY AREA_DUNGEON ~We're in a dungeon.~
SAY AREA_DAY ~It's day.~
SAY AREA_NIGHT ~It's dark.~
SAY SELECT_COMMON1 ~Yeah?~
SAY SELECT_COMMON2 ~What do you need?~
SAY SELECT_COMMON3 ~Grunt.~
SAY SELECT_COMMON4 ~What?~
SAY SELECT_COMMON5 ~Yes?~
SAY SELECT_COMMON6 ~I'm listening.~
SAY SELECT_ACTION1 ~Uh huh.~
SAY SELECT_ACTION2 ~Sure.~
SAY SELECT_ACTION3 ~I'm on it.~
SAY SELECT_ACTION4 ~YAY!~
SAY SELECT_ACTION5 ~Not hard at all~
SAY SELECT_ACTION6 ~Yep~
SAY SELECT_ACTION7 ~Okay~
SAY SELECT_RARE1 ~I'm ready.~
SAY SELECT_RARE2 ~I got it.~
SAY CRITICAL_HIT ~Yeah!~
SAY CRITICAL_MISS ~Damn!~
SAY TARGET_IMMUNE ~No effect?~
SAY INVENTORY_FULL ~It's too heavy!~

COMPILE ~Ralonar\MJM#Ralonar.d~

EXTEND_TOP ~AR0602.bcs~ ~Ralonar\AR0602.baf~

APPEND ~pdialog.2da~
~M#Ralonar MJM#RalonarP MJM#RalonarJ MJM#RalonarD MJM#Ral25P MJM#Ral25J MJM#Ral25D MJM#Ral25~
UNLESS ~MJM#Ralonar~

APPEND ~interdia.2da~
~MJM#Ralonar MJM#RalonarB MJM#RalB25~
UNLESS ~MJM#Ralonar~

Offline Kulyok

  • Level 1
  • *
  • Posts: 336
  • Karma: +16/-17
    • View Profile
    • http://www.pocketplane.net/xan
The Complete and Total NOOB's Guide to Creating an NPC
« Reply #27 on: March 07, 2006, 08:15:02 AM »
Your filenames cannot exceed 8 symbols. "M#Ralon" will work, whereas "MJM#Ralonar" won't.

Offline markmid

  • Newbie
  • *
  • Posts: 19
  • Karma: +0/-0
    • View Profile
The Complete and Total NOOB's Guide to Creating an NPC
« Reply #28 on: March 07, 2006, 08:20:19 AM »
Ah thank you, you have just saved me finding a new bug the hard way :)

Originally they were M#Jalen. The M# Prefix is pretty crowded though so i'm reserving MJ and using MJ2 for compatibility.

-- EDIT

Well everything appears to be working now without the fix but I am getting this on install now:

Parse Warning at line 25 colum 21-21

[NumTimesTalkedGT] not found in TRIGGER.IDS

Which is just odd :) but it doesn't seem to be affecting anything dialogue wise.

I would put my previous problems down to using a modded version of BG2 and probably the M# prefix, any other newbies be warned about operating on a modded version of BG, with even a tiny mod :)

Offline Shed

  • Newbie
  • *
  • Posts: 96
  • Karma: +0/-0
    • MSN Messenger - shed_plant@hotmail.com
    • Yahoo Instant Messenger - shed_plant
    • View Profile
    • http://www.shedplant.net
The Complete and Total NOOB's Guide to Creating an NPC
« Reply #29 on: March 07, 2006, 09:19:14 AM »
http://iesdp.gibberlings3.net/scripting/bg2triggers.htm

0x403A NumTimesTalkedToGT(I:Num*)
Returns true only if the player's party has spoken to the active CRE more than the number of times specified.
Not a carebear.

Spellhold Studios