Jump to content

I'm just a sad starter


Bardess

Recommended Posts

Another thing :p I tried to use CHAIN to make Fiars interject in a dialogue with another NPC I've made (the quest giving one, so it's in her .d file). I used the == BZ_Fiars command, but upon installing, it says ERROR locating recource for CHAIN3 Resource BZ_FIARS.DLG not found in KEY file. What is that supposed to mean? :p What didn't I do?

Link to comment

Of which file? I have that at the top of the BZ_Fiars file, but problems seem to be occuring with the "Z_lenna" one. :p

Here's a part of it, I hope it can help something...

 

CHAIN
IF ~NumTimesTalkedToGT(0) Global("Z_NopeLenna","GLOBAL",0)~ THEN Z_lenna LennaAwaits
~I'm a wench who wants to be served by adventurers for a lame 48GP, you knew that?~
END
+ ~Global("Z_FoundRi","GLOBAL",1) InParty("Z_fiars")~ + ~Sure did. That's why we took Fiars, who's, by the way, just killed your husband, in.~ + Drinks
+ ~Global("Z_FoundRi","GLOBAL",1) !InParty("Z_fiars")~ + ~Oh, yes, but it's better to work for you than have that scum Fiars around.~ + Drinks1
++ ~I sure as hells didn't know!~ + Findout

CHAIN
IF ~~ THEN Z_lenna Findout
~Well, you've just found out!~
EXIT

CHAIN
IF ~~ THEN Z_lenna Drinks
~Hmpf!~
== BZ_Fiars
~Hi, ma'am! Thought I should just pass by and remind you whom I killed back in the Docks.~
== Z_lenna
~WHAT? I think I'm going to walk out now.~
DO ~EscapeArea() SetGlobal("Z_LennaOde","GLOBAL",1)~
EXIT

 

Huh? It used to work untill I added Fiars's lines.

Link to comment

I've never had much luck using GOTO in CHAIN, so I usually use EXTERN.

 

I haven't asked if you minded proofreading, so I haven't proofread your dialogue. Assuming that you compile BZ_Fiars before you compile whatever dialogue file this is in, you'll be OK.

 

There are going to be people who will tell you that it is not necessary to use EXTERN with CHAIN each and every time, but I can never rember when it is or is not all right, so I use it all the time.

 

Thing is, you have to make sure you compile BZ_Fiars first.

 

CHAIN
IF ~NumTimesTalkedToGT(0) Global("Z_NopeLenna","GLOBAL",0)~ THEN Z_lenna LennaAwaits
~I'm a wench who wants to be served by adventurers for a lame 48GP, you knew that?~
END
+ ~Global("Z_FoundRi","GLOBAL",1) InParty("Z_fiars")~ + ~Sure did. That's why we took Fiars, who's, by the way, just killed your husband, in.~ EXTERN Z_lenna Drinks
+ ~Global("Z_FoundRi","GLOBAL",1) !InParty("Z_fiars")~ + ~Oh, yes, but it's better to work for you than have that scum Fiars around.~ EXTERN Z_lenna Drinks1
++ ~I sure as hells didn't know!~ EXTERN Z_lenna Findout

CHAIN
IF ~~ THEN Z_lenna Findout
~Well, you've just found out!~
EXIT

CHAIN
IF ~~ THEN Z_lenna Drinks
~Hmpf!~
== BZ_Fiars
~Hi, ma'am! Thought I should just pass by and remind you whom I killed back in the Docks.~
== Z_lenna
~WHAT? I think I'll just walk out now.~
DO ~EscapeArea() SetGlobal("Z_LennaOde","GLOBAL",1)~
EXIT

 

You are trying to compile in the game directory, right?

Link to comment

That once happened to me as well. Every time I make a change to the mod and want to install it, I expect to find at least 5 new errors. If there are less, *then* I'm happy.

 

Yay! Now there's only little more to be done for my starting quest to be completed. :p

Link to comment

Maybe I didn't choose the right opportunity to set his timer?

Here's a part of his script and BZ_Fiars file.

 

IF
Global("FiarsJoined","LOCALS",1)
THEN
RESPONSE #100
	SetGlobalTimer("FiarsFriends","LOCALS",5)
END

IF
See(Player1)
!StateCheck(Player1,STATE_SLEEPING)
InParty(Myself)
CombatCounter(0)
GlobalTimerExpired("FiarsFriends","LOCALS")
THEN
RESPONSE #100
	Interact(Player1)
END


In BZ_Fiars file:

IF ~GlobalTimerExpired("FiarsFriends","LOCALS")~ THEN BEGIN Gudari1
SAY ~Bla bla~
(there's more, of course)

Link to comment

Ah, I think I've spotted two things that could be contributing. I'm going to post my recommendations and comment in the reasons for them.

 

IF
Global("FiarsJoined","LOCALS",1)
Global("Z_FiarsFT","LOCALS",0) /* without variable check, this will cause a stutter */
THEN
RESPONSE #100
	SetGlobal("Z_FiarsFT","LOCALS",1) /* sets your variable */
	RealSetGlobalTimer("FiarsFriends","GLOBAL",5) /* I don't think you can use a local variable as a timer */
END

IF
See(Player1)
!StateCheck(Player1,STATE_SLEEPING)
InParty(Myself)
CombatCounter(0)
!See([ENEMY]) /* you don't want chitchat if there is a visible enemy, to you? */
Global("Z_FiarsFT","LOCALS",1)
RealGlobalTimerExpired("FiarsFriends","GLOBAL")
THEN
RESPONSE #100
	SetGlobal("Z_FiarsFT","LOCALS",2) /* Changing the variable again is the trigger to start the talk */
	RealSetGlobalTimer("FiarsFriends","GLOBAL",1800) /* sets the timer for half an hour if there is a second talk to follow this one. */
	Interact(Player1)
END


In BZ_Fiars file:

IF ~Global("Z_FiarsFT","LOCALS",2)~ THEN BEGIN Gudari1
SAY ~Bla bla~
++ ~PC response 1.~ DO ~SetGlobal("Z_FiarsFT","LOCALS",2)~ + Gudari1.1
++ ~PC response 2.~ DO ~SetGlobal("Z_FiarsFT","LOCALS",2)~ + Gudari1.2
++ ~PC response 3.~ DO ~SetGlobal("Z_FiarsFT","LOCALS",2)~ + Gudari1.3
END
//(there's more, of course)
/* Yes, of course there is, but don't forget to use a variable as a trigger to start the dialogue and remember to close the variable during the dialogue or it will loop. */

 

It's your call whether you want to use the B file or the J file as your friendtalk/lovetalk file. Some use the J, others use the B. I like to use the J, because that way, if something happens and the lovetalk doesn't fire, the player can use PID to get the hanging dialogue. Using the B file, that isn't an option. Should you decide to move it to the J file, you would replace BZ_Fiars with Z_FiarsJ and use StartDialogueNoSet() instead of Interact()

 

Edit: Had errors in my own example. Also, what Domi says about GLOBAL vs. LOCALS is very true. You're going to find it easier to control the relationship via console and SK, or monitor what's going on.

Link to comment

Edit: Oh, Berelinde beat me to it :p

 

Oh. This is not a very good script. You need to make your talks depend on Global, not on the timer expiery. I use Global timers here, because it IWD stuff, but you will need the RealGlobal timers instead.

 

LOCALS are sort of a poor man's version of GLOBAL becasue they are memorized only on the NPC, and nobody else will know that things happened. So, it's better to use GLOBAL, not LOCALS. Bio uses LOCALS seemingly to avoid coding every NPC separately, so they can call all the similar variables the same way :p

 

IF

InParty("rizdaer")

!AnyPCSeesEnemy()

Global("P#RizdaerPCTalk", "GLOBAL",0)

THEN

RESPONSE #100

IncrementGlobal("P#RizdaerPCTalk","GLOBAL",1)

SetGlobalTimer("P#RizdaerPCTalkTimer","GLOBAL",8400)

END

 

This block starts up the sequence shifting the FriendTalk global to 1.

 

IF

InParty("rizdaer")

!AnyPCSeesEnemy()

GlobalTimerExpired("P#RizdaerPCTalkTimer","GLOBAL")

Global("P#RizdaerPCTalk","GLOBAL",1)

THEN

RESPONSE #100

IncrementGlobal("P#RizdaerPCTalk","GLOBAL",1)

SetGlobalTimer("P#RizdaerPCTalkTimer","GLOBAL",1)

StartDialogueNoSet(Player1)

END

 

While this block will advance the global and kick the dialogue.

 

The condition on your D-file then will become

 

IF ~Global("P#RizdaerPCTalk","GLOBAL",2)~

 

Your NPC will talk on the even numbers and "wait" on the odd ones.

 

Electively, you can either shift the Global up and reset the timer from the script using the block below or via dialogue (dialogue is more sturdy apparently)

 

IF

InParty("rizdaer")

GlobalTimerExpired("P#RizdaerPCTalkTimer","GLOBAL")

Global("P#RizdaerPCTalk","GLOBAL",2)

THEN

RESPONSE #100

IncrementGlobal("P#RizdaerPCTalk","GLOBAL",1)

SetGlobalTimer("P#RizdaerPCTalkTimer","GLOBAL",8400)

END

 

And for the sake of all gods DO NOT use B-file/Interact() for SCRIPTED dialogues. Use J-file and StartDialogueNoSet. Otherwise you'll have to deal with Weights and all related problems.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...