Jump to content


Photo

2 problems that I can't seem to solve


  • Please log in to reply
7 replies to this topic

#1 The Amazing Maurice

The Amazing Maurice

    Did-a-chick? Dad-a-cham? Ded-a-check?

  • Member
  • 388 posts

Posted 20 July 2004 - 03:28 AM

... can anyone please help? :)

1st problem is that I can't get my NPC to spawn - I've tried everything I can think of but can't seem to see the problem...

Copy of BR#AR0700.baf file

IF
Global("BR#BrageExists","AR0700",0)
THEN
RESPONSE #100
SetGlobal("BR#BrageExists","AR0700",1)
CreateCreature("BR#Brage",[2275.1369],4)
END


Copy of .tp2

BEGIN ~BrageNPC for BG2:SoA~

COPY ~BrageNPC\brageS.bmp~ ~override\brageS.bmp~

COMPILE ~BrageNPC\BR#Brage.d~
USING ~~

COMPILE ~BrageNPC\BR#AR0700.baf~
USING ~~

COPY ~BrageNPC\BR#Brage.cre~ ~override\BR#Brage.cre~
SAY NAME1 ~Brage~
SAY NAME2 ~Brage~
WRITE_ASCII 0x34 ~brageS~
WRITE_ASCII 0x250 ~BR#Brage~
WRITE_ASCII 0x2CC ~BR#Brage~
WRITE_ASCII 0x280 ~BR#Brage~


EXTEND_BOTTOM ~Ar0700.bcs~ ~BrageNPC\br#ar0700.bcs~

APPEND ~pdialog.2da~
~BR#Brage BR#BrageP BR#BrageJ BR#BrageD~
UNLESS ~BR#Brage~
UNLESS ~25POST~

APPEND ~pdialog.2da~
~BR#Brage BR#BrageP BR#BrageJ BR#BrageD BR#Bra25P BR#Bra25J BR#Bra25D BR#Bra25~
UNLESS ~BR#Brage~
IF ~25POST~


I think it's something to do with the EXTEND_BOTTOM line, but I can't seem to work it out...

2nd problem is that when the NPC is rejected before joining and re-spoken to he reverts to multi-player dialouge and dissapears. It works fine when he's joined tho so (once again) I'm assuming it's to do with the p dialouge...

Copy of BR#Brage.dlg (wasn't sure whether this should be at the bottom of the .d file or a new file in itself. Either way it dosn't work)

BEGIN BR#BrageP

IF ~Global("BrageJoined","LOCALS",1)~ THEN BEGIN KickOut
SAY ~Are you sure you want me to leave <CHARNAME>, for I will carry on
with my quest with or without you.~
IF ~~ THEN REPLY ~My apologies. Take no offence, I meant nothing by it.~
DO ~JoinParty()~ EXIT
IF ~~ THEN REPLY ~I am sure. Our paths may cross again captain, farewell.~ DO ~SetGlobal("BrageJoined","LOCALS",0)
~ EXIT
END

IF ~Global("BrageJoined","LOCALS",0)~ THEN BEGIN Rejoin
SAY ~Once again I see you before me <CHARNAME>, do you wish we travel
together again? I am acomplishing nothing here.~
IF ~~ THEN REPLY ~Then let us be off.~ DO ~SetGlobal("BrageJoined","LOCALS",1)
JoinParty()~ EXIT
IF ~~ THEN REPLY ~Unfortuantly I have no room for you at the moment, maybe
someother time.~ EXIT
END


I'm betting these are pretty simple,common errors, so I apologise for my ignorance beforehand. :D

#2 SConrad

SConrad

    I swear to drunk I'm not God

  • Administrator
  • 11149 posts

Posted 20 July 2004 - 03:42 AM

Your problem is that you're compile-ing and extending two diffrent scripts.

When you compile something, the compiled version is located in the override.

So, the:
COMPILE ~BrageNPC\BR#AR0700.baf~
USING ~~
will result in BR#AR0700.bcs being in the override.

So when you're trying to extend the AR0700.bcs with:
EXTEND_BOTTOM ~Ar0700.bcs~ ~BrageNPC\br#ar0700.bcs~
you extend it with a non-existant script, since the script you're trying to extend with isn't located in the BrageNPC-folder.

You don't even have to do the compile-ing if you're going to extend another script with it. Just do:
EXTEND_BOTTOM ~Ar0700.bcs~ ~BrageNPC\br#ar0700.baf~
That' it, if you aren't using a .tra for the script, which you don't.

Alternatively, you could:
COMPILE ~BrageNPC\BR#AR0700.baf~
USING ~~

EXTEND_BOTTOM ~Ar0700.bcs~ ~override\br#ar0700.bcs~

Posted Image Khadion NPC mod - Team leader, head designer
Posted Image Hubelpot NPC mod - Team leader, coder
Posted Image NPC Damage - Coder
Posted Image PC Soundsets - Coder, voice actor
Posted Image Brythe NPC mod - Designer
Posted Image DragonLance TC - Glory of Istar - Designer
Posted Image The NPC Interaction Expansion Project - Writer for Cernd, Sarevok
Posted Image The Jerry Zinger Show - Producer

Iron Modder 5 - Winner


#3 hlidskialf

hlidskialf

    Incarnation of the Eternal Ale Warrior

  • Modder
  • 2510 posts

Posted 20 July 2004 - 03:52 AM

SConrad got the first problem bang on. It can all be reduced to a single line.
As for the second, make sure that the .cre file in question has a Death Variable that matches exactly with the name given in the PDialog.2da. As well, be sure that you've removed the "Export" flag from the cre. If you don't do this, the game will treat it as a multiplayer character and use the default multiplayer dialog instead of the one you've assigned. (It's also a good idea to ensure you've removed the various script assignment on the cre that you didn't make yourself. ie Leftovers.)

The great wolf Fenrir gapes ever at the dwelling of the gods.


#4 The Amazing Maurice

The Amazing Maurice

    Did-a-chick? Dad-a-cham? Ded-a-check?

  • Member
  • 388 posts

Posted 20 July 2004 - 03:55 AM

Cheers guys. I'll check them out in a sec.

One thing I've named (for simplicitys sake) all the files & the death variable BR#Brage - will that shoot me in the foot later on?

#5 SConrad

SConrad

    I swear to drunk I'm not God

  • Administrator
  • 11149 posts

Posted 20 July 2004 - 04:01 AM

No, it won't. As long as you refer to them correctly.

Posted Image Khadion NPC mod - Team leader, head designer
Posted Image Hubelpot NPC mod - Team leader, coder
Posted Image NPC Damage - Coder
Posted Image PC Soundsets - Coder, voice actor
Posted Image Brythe NPC mod - Designer
Posted Image DragonLance TC - Glory of Istar - Designer
Posted Image The NPC Interaction Expansion Project - Writer for Cernd, Sarevok
Posted Image The Jerry Zinger Show - Producer

Iron Modder 5 - Winner


#6 The Amazing Maurice

The Amazing Maurice

    Did-a-chick? Dad-a-cham? Ded-a-check?

  • Member
  • 388 posts

Posted 20 July 2004 - 04:42 AM

Ah good. Cheers again BTW, it works fine now. One thing - To stop the NPC from walking up to CHARNAME do I just omit the THEN RESPONSE #100 from the .baf?

About the 2nd problem I've taken a look in NI about the problems that Hild suggested. I'd already removed the export flag & the death variable (BR#Brage) matches the .2da - I've taken the liberty to post the .cre screen, as someone might be able to spot the error quicker than trying to make me understand it. :lol:

Posted Image

#7 hlidskialf

hlidskialf

    Incarnation of the Eternal Ale Warrior

  • Modder
  • 2510 posts

Posted 20 July 2004 - 05:10 AM

No, you MUST have that RESPONSE #100 in the script to compile the bloody thing. heheheh It's integral to the logic structure. What's causing the NPC to approach the PC is you've scripted him to do so somewhere. Otherwise he'd just stand there until the PC initiated dialog.
As for your dialog problem, it's looking like the second part of what I advised. Your .cre file still has the DPlayer3.bcs assigned to him. Part of that includes a block which resets the dialog:
IF
 !InParty(Myself)
THEN
  RESPONSE #100
 Dialog(Player1)
 ChangeAIScript("",DEFAULT)
 SetDialogue("multig")
END

See why/how that causes the problem? Remove that script and all should be well. ;)

The great wolf Fenrir gapes ever at the dwelling of the gods.


#8 The Amazing Maurice

The Amazing Maurice

    Did-a-chick? Dad-a-cham? Ded-a-check?

  • Member
  • 388 posts

Posted 20 July 2004 - 06:01 AM

Yeah I see what you mean. I changed his script to NPC.bcs (I'm pretty sure thats just a generic attack script) and it works fine now. The walking up to CHARNAME also stopped when I changed the script.

I'm still getting an error where the kickout & rejoin dialog won't show but I think I know what that's due to, so I should be able to sort that one out.

Thanks for your help :D