Jump to content


Photo

Need some Help with NPC creation


  • Please log in to reply
13 replies to this topic

#1 IchigoRXC

IchigoRXC
  • Member
  • 15 posts

Posted 12 October 2011 - 11:12 AM

Hello, I have been using a few guides on how to create NPCs. So far I have gotten one into the game and the WeiDU installer seemed to work fine but when I spoke to the NPC dialogue opened but there was no text and no options to choose from.

This is my .d file.
   BEGIN R#Eve

IF ~NumTimesTalkedTo(0)~ THEN BEGIN Talk1

SAY ~You, your face is so familiar, yet so unknown to me. I am Eve.~

IF ~~ THEN REPLY ~How do you know my face? How do you know me? Were you sent to kill me like the others?~ GOTO HiThere

IF ~~ THEN REPLY ~I am sure you do not know me. Please leave me be.~ GOTO EndTalk

END


IF ~~ THEN BEGIN HiThere

SAY ~No, you are not who I am after. My name is Eve, Agent of Kelemvor, Scion of Death. I have been tasked to bring a mighty Necromancer to Justice for defiling the dead and seeking Lichdom. I maybe of use to you, perhaps I shall bring death to your foes, as I do mine.~

IF ~~ THEN REPLY ~I would appreciate anyhelp I can get, and will gladly help you in your quest Eve.~

DO ~SetGlobal("R#EveJoined","LOCALS",1) JoinParty()~ EXIT

IF ~~ THEN REPLY ~I am afraid I can not accept your help right now, perhaps we shall meet again.~

EXIT

END


IF ~~ THEN BEGIN EndTalk

SAY ~Very well. I will keep looking into this area, return if you change your mind.~

IF ~~ THEN EXIT

END


IF ~NumTimesTalkedToGT(0)~ THEN BEGIN Talk2

SAY ~You have returned, are you in need of my assistance?~

IF ~~ THEN REPLY ~If are offering it, I would gladly accept.~

DO ~SetGlobal("R#EveJoined","LOCALS",1) JoinParty()~ EXIT

IF ~~ THEN REPLY ~No, I am sorry there is no time.~ EXIT

END


BEGIN R#EveP

IF ~Global("R#EveJoined","LOCALS",1)~ THEN BEGIN LeaveGroup

SAY ~I see you are no longer in need of my services~

IF ~~ THEN REPLY ~My mistake, our time together is not yet over.~ DO ~JoinParty()~ EXIT

IF ~~ THEN REPLY ~Farewell Eve.~ EXIT

END


IF ~Global("R#EveJoined","LOCALS",0)~ THEN BEGIN ComeBack

SAY ~You have need of me once more?~

IF ~~ THEN REPLY ~Your skills have been missed.~

DO ~SetGlobal("R#EveJoined","LOCALS",1)JoinParty()~ EXIT

IF ~~ THEN REPLY ~Not right now Eve, I am sorry.~ EXIT

END


This is my t2p file

   BACKUP ~Eve/backup~

    AUTHOR ~IchigoRXC (wilson.Ross@hotmail.co.uk)~

    BEGIN ~Eve for BG2:SoA~

    // This adds our CRE file

    COPY ~Eve/R#Eve.cre~ ~override/R#Eve.cre~

    /* This allows for your NPC's name to be shown in the game during conversations and also on the character sheet*/

    SAY NAME1 ~Eve~

    SAY NAME2 ~Eve~

    /* This is the biography. In NearInfinity, go to that side tab and find CHR. Open that and find Sam.BIO You can create your own bio this way by simply deleting the default PC bio and typing your own. Save this.*/

    SAY BIO ~When you ask her about her past, Sam says to shut up.~

    /* These are the different things that your NPC will say when they respond to your commands.*/

    SAY MORALE ~Sticking around is only going to get us killed.~

    SAY HAPPY ~This group is great~

    SAY UNHAPPY_ANNOYED ~Your actions do not please me..~

    SAY UNHAPPY_SERIOUS ~This is not the path I wish to follow!~

    SAY UNHAPPY_BREAKING ~Our time is at an end.~

    SAY LEADER ~I shall lead~

    SAY TIRED ~Fatigue has set in.~

    SAY BORED ~Is there nothing for us to do?~

    SAY BATTLE_CRY1 ~Kelemvor have mercy when you meet!~

    SAY BATTLE_CRY2 ~Time to meet my God!~

    SAY BATTLE_CRY3 ~Death is just the begining.~

    SAY BATTLE_CRY4 ~The dead must stay dead!~

    SAY DAMAGE ~Ack!~

    SAY DYING ~I am in need!~

    SAY HURT ~I am wounded!~

    SAY AREA_FOREST ~The forest, full of shadows and places to hide.~

    SAY AREA_CITY ~The city, filled with cretins and peons.~

    SAY AREA_DUNGEON ~The darkness is where I feel at home.~

    SAY AREA_DAY ~Another day.~

    SAY AREA_NIGHT ~I can better aid you in the dark.~

    SAY SELECT_COMMON1 ~I await your command.~

    SAY SELECT_COMMON2 ~What do you need of me?~

    SAY SELECT_COMMON3 ~Yes?~

    SAY SELECT_COMMON4 ~What can I do for you?~

    SAY SELECT_COMMON5 ~Is there something on your mind?~

    SAY SELECT_COMMON6 ~I'm listening.~

    SAY SELECT_ACTION1 ~Silently.~

    SAY SELECT_ACTION2 ~Swiftly.~

    SAY SELECT_ACTION3 ~I'm on it.~

    SAY SELECT_ACTION4 ~It shall be done.~

    SAY SELECT_ACTION5 ~A trivial matter.~

    SAY SELECT_ACTION6 ~Yes.~

    SAY SELECT_ACTION7 ~Ofcourse~

    SAY SELECT_RARE1 ~I lay these beings to rest for you Lord, the balance of death shall never falter.~

    SAY SELECT_RARE2 ~The Undead shall fall by my blade, dark and alone.~

    SAY CRITICAL_HIT ~Kelemvor guides me!~

    SAY CRITICAL_MISS ~A shame.~

    SAY TARGET_IMMUNE ~A change of tactics, perhaps?~

    SAY INVENTORY_FULL ~I am burdened!~

    // This is compiling Sam's dialogue

    COMPILE ~Eve/R#Eve.d~

    // This is adding our area file to the game

    EXTEND_TOP ~AR0313.bcs~ ~Eve/AR0313.baf~

    /* Add this to the end (Appends .2DA files in the game so that it recognizes your NPC's files*/

    APPEND ~pdialog.2da~

    ~R#Eve R#EveP R#EveJ R#EveD R#Eve25P R#Eve25J R#Eve25D R#Eve25~

    UNLESS ~R#Eve~

    APPEND ~interdia.2da~

    ~R#Eve R#EveB R#EveB25~

    UNLESS ~R#Eve~

and my area file

IF

Global("R#EVEExists","AR0313",0)

THEN

RESPONSE #100

SetGlobal("R#EVEExists","AR0313",1)

CreateCreature("R#EVE",[733.336],3)

END




In the .cre file, I have unticked the export flagging assigned an Override Script to R#Eve and the Dialogue to R#Eve, and changed the character to neutral(128).

Can anyone help?

Edited by IchigoRXC, 13 October 2011 - 02:07 AM.

"War... War never changes"

#2 berelinde

berelinde

    Troublemaker

  • Modder
  • 4916 posts

Posted 12 October 2011 - 11:28 AM

NVM. Missed it the first time.

Edited by berelinde, 12 October 2011 - 11:29 AM.

"Imagination is given to man to console him for what he is not; a sense of humor, for what he is." - Oscar Wilde

berelinde's mods
TolkienAcrossTheWater website
TolkienAcrossTheWater Forum


#3 Choo Choo

Choo Choo

    AIR CONDITIONER GRILL

  • Modder
  • 3001 posts

Posted 12 October 2011 - 01:18 PM

Hmm, there doesn't seem to be anything wrong with your coding that I can see - but I'm not used to seeing code in long-hand, and yours is extremely long-handed; not a bad thing, mind, I'm just not used to it - and the tp2 file looks sound, although I'm not very good with those...

It might be that you forgot to set the death variable to R#Eve on her .cre file. Referencing the file name in the tp2 puts her in the game, but the dialogues are assigned to a DV. Check, that might be it. :) Otherwise, I don't know, I'm sorry.

Good luck!

theacefes: You have to be realistic as well, you can't just be Swedish!


#4 IchigoRXC

IchigoRXC
  • Member
  • 15 posts

Posted 12 October 2011 - 01:30 PM

Hmm, there doesn't seem to be anything wrong with your coding that I can see - but I'm not used to seeing code in long-hand, and yours is extremely long-handed; not a bad thing, mind, I'm just not used to it - and the tp2 file looks sound, although I'm not very good with those...

It might be that you forgot to set the death variable to R#Eve on her .cre file. Referencing the file name in the tp2 puts her in the game, but the dialogues are assigned to a DV. Check, that might be it. :) Otherwise, I don't know, I'm sorry.

Good luck!


Thanks Choo Choo, I have literally just started with making these, so I am pretty much working straight from tutorials. I have set the DV, but I will check to make sure I have done it right

When I install the Mod via WeiDU is says
"Installing [Eve for BG2:SoA]
Copying and patching 1 file ...
Compiling 1 dialogue file ...
Extending game scripts ...
Appending to files ...
Appending to files ...


SUCESSFULLY INSTALLED [Eve for BG2:SoA]"

Edited by IchigoRXC, 12 October 2011 - 02:03 PM.

"War... War never changes"

#5 berelinde

berelinde

    Troublemaker

  • Modder
  • 4916 posts

Posted 12 October 2011 - 02:37 PM

I would be more inclined to blame NI here. Or more specifically, not saving the file to the correct location. I prefer to assign the DV, creature dialogue file, and override script in the tp2 rather than with NI because I have done this myself too many times to count. If you open up your mod folder and examine the creature file there with DLTCEP, I would be willing to bet that the creature's script and dialogue file are unassigned.

"Imagination is given to man to console him for what he is not; a sense of humor, for what he is." - Oscar Wilde

berelinde's mods
TolkienAcrossTheWater website
TolkienAcrossTheWater Forum


#6 GeN1e

GeN1e

    A very GAR character

  • Modder
  • 1604 posts

Posted 12 October 2011 - 04:19 PM

It might be that you forgot to set the death variable to R#Eve on her .cre file. Referencing the file name in the tp2 puts her in the game, but the dialogues are assigned to a DV.

Only matters for NPCs that've been in party. Before tagging along they use what they've been assigned manually.

As for NI not saving changes... were there no file assigned, there'd be "Eve has nothing to say to you", not an empty window.

PS Did you install if with game running? Might have easily resulted in what you've described, because dialog.tlk is loaded along with the launcher, while other files can be modified on the fly and only require to reload without shutting down the process.

Oh, and you've got a typo here

SAY CRITICAL_HIT ~Kalemvor guides me!~


Edited by GeN1e, 12 October 2011 - 04:35 PM.

Retired from modding.


#7 berelinde

berelinde

    Troublemaker

  • Modder
  • 4916 posts

Posted 12 October 2011 - 08:01 PM

As for NI not saving changes... were there no file assigned, there'd be "Eve has nothing to say to you", not an empty window.

You're right! I totally missed that part. Can you tell I'm more accustomed to the "NPC has nothing to say to you" scenario?

And yeah, when you get a blank dialogue box, Gen1e's diagnosis is usually accurate. The good news is that closing the game, uninstalling your mod, and installing it again often corrects the problem.

"Imagination is given to man to console him for what he is not; a sense of humor, for what he is." - Oscar Wilde

berelinde's mods
TolkienAcrossTheWater website
TolkienAcrossTheWater Forum


#8 IchigoRXC

IchigoRXC
  • Member
  • 15 posts

Posted 13 October 2011 - 02:06 AM

[quote name='GeN1e' date='13 October 2011 - 01:19 AM' timestamp='1318465199' post='524726']
[quote name='Choo Choo']It might be that you forgot to set the death variable to R#Eve on her .cre file. Referencing the file name in the tp2 puts her in the game, but the dialogues are assigned to a DV.[/quote]Only matters for NPCs that've been in party. Before tagging along they use what they've been assigned manually.

As for NI not saving changes... were there no file assigned, there'd be "Eve has nothing to say to you", not an empty window.

PS Did you install if with game running? Might have easily resulted in what you've described, because dialog.tlk is loaded along with the launcher, while other files can be modified on the fly and only require to reload without shutting down the process.[/qoute]

Well I unistalled everything, returned it to a clean state and then tried to reinstall, making sure nothing was open. I still had the same issues. Pesky girl!

[quote]Oh, and you've got a typo here [quote]SAY CRITICAL_HIT ~Kalemvor guides me!~[/quote]

Thankyou I will change this :)
[/quote]


[quote name='berelinde' date='13 October 2011 - 05:01 AM' timestamp='1318478511' post='524734']
You're right! I totally missed that part. Can you tell I'm more accustomed to the "NPC has nothing to say to you" scenario?

And yeah, when you get a blank dialogue box, Gen1e's diagnosis is usually accurate. The good news is that closing the game, uninstalling your mod, and installing it again often corrects the problem.
[/quote]

I have had the "she doesnt have anything to say to you bug" before, when I was fiddling around trying to figure out what was wrong with the NPC. Now I know that it is because nothing was assigned, thankyou. That just assures me that something is assigned, it just is not being read correctly. *facepalm*
"War... War never changes"

#9 IchigoRXC

IchigoRXC
  • Member
  • 15 posts

Posted 13 October 2011 - 02:16 AM

I would be more inclined to blame NI here. Or more specifically, not saving the file to the correct location. I prefer to assign the DV, creature dialogue file, and override script in the tp2 rather than with NI because I have done this myself too many times to count. If you open up your mod folder and examine the creature file there with DLTCEP, I would be willing to bet that the creature's script and dialogue file are unassigned.

Could you show me, or guide me to a guide which tells me how to do this. I have a faint idea, but the last thing I need to do is add in more messy code when it doesnt work already. :P
"War... War never changes"

#10 berelinde

berelinde

    Troublemaker

  • Modder
  • 4916 posts

Posted 13 October 2011 - 03:18 AM


I would be more inclined to blame NI here. Or more specifically, not saving the file to the correct location. I prefer to assign the DV, creature dialogue file, and override script in the tp2 rather than with NI because I have done this myself too many times to count. If you open up your mod folder and examine the creature file there with DLTCEP, I would be willing to bet that the creature's script and dialogue file are unassigned.

Could you show me, or guide me to a guide which tells me how to do this. I have a faint idea, but the last thing I need to do is add in more messy code when it doesnt work already. :P

This is from Haldamir, an NPC mod with really, really straight-forward code.

COPY ~haldamir/character/b!hal.cre~ ~override~
  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

In NI, there is an option to display hex offsets. that's what the WRITE_ASCII stuff is. Also, you can check out this thread for some of the other fun things you can do with the tp2.

"Imagination is given to man to console him for what he is not; a sense of humor, for what he is." - Oscar Wilde

berelinde's mods
TolkienAcrossTheWater website
TolkienAcrossTheWater Forum


#11 IchigoRXC

IchigoRXC
  • Member
  • 15 posts

Posted 13 October 2011 - 04:12 AM


As for NI not saving changes... were there no file assigned, there'd be "Eve has nothing to say to you", not an empty window.

You're right! I totally missed that part. Can you tell I'm more accustomed to the "NPC has nothing to say to you" scenario?

And yeah, when you get a blank dialogue box, Gen1e's diagnosis is usually accurate. The good news is that closing the game, uninstalling your mod, and installing it again often corrects the problem.



Ok I added this code, unfortunately it is still doing the same. I thought I would add another bit of Info, when I hold my cursor over her, a scroll appears over her head, but no name is present.
"War... War never changes"

#12 berelinde

berelinde

    Troublemaker

  • Modder
  • 4916 posts

Posted 13 October 2011 - 04:47 AM

You might need to rebuild your installation.

"Imagination is given to man to console him for what he is not; a sense of humor, for what he is." - Oscar Wilde

berelinde's mods
TolkienAcrossTheWater website
TolkienAcrossTheWater Forum


#13 IchigoRXC

IchigoRXC
  • Member
  • 15 posts

Posted 13 October 2011 - 05:30 AM

You might need to rebuild your installation.



Ok I am going to do that. Thankyou for your help, can I ask one last thing. Which bits are case sensitive? As whatever I put into NI becomes caps, while all of my mods use Eve, NI used EVE. I followed Kat Bella's K#Sam guide and I still encountered the errors. This will not stop me. I shall succeed.
"War... War never changes"

#14 berelinde

berelinde

    Troublemaker

  • Modder
  • 4916 posts

Posted 13 October 2011 - 07:13 AM

The only parts that are case-sensitive are tp2 syntax stuff: COPY_EXISTING, COMPILE, EVALUATE_BUFFER, BEGIN, UNLESS, BUT_ONLY_IF_IT_CHANGES, etc. File names are not case sensitive... but they should be consistent if you want to make life easier for Linux players. These days, I put everything in lowercase by default. It saves some people from having to run tolower before they can install the mod.

"Imagination is given to man to console him for what he is not; a sense of humor, for what he is." - Oscar Wilde

berelinde's mods
TolkienAcrossTheWater website
TolkienAcrossTheWater Forum