Jump to content

Scripting Woes


EiriktheScald

Recommended Posts

As long as it's working for you.

 

Just a couple things: are you really having Eirik start dialogue with the wolf? How's that working out?

If Sarevok can pretend to talk to Gorion (when he really starts dialog with player 1), why not? It seems to work just fine. I like how the dialog 'forces' you to read the text. The first time through, with DisplayString(), I hardly noticed Eirik was talking. And DisplayStringHead() is alright for an exclamation; not very elegant with sentences of any length.

Link to comment

She meant StartDialogueNoSet("thewolf"). This action is causing your NPC to initiate dialogue with the wolf. I wouldn't be surprised if it works fine (although I'm not sure who gabber is; probably the wolf, and none of the PCs will get the lips), but it's not something BioWare ever did; better to just always start dialogue with a party member.

Link to comment
She meant StartDialogueNoSet("thewolf"). This action is causing your NPC to initiate dialogue with the wolf. I wouldn't be surprised if it works fine (although I'm not sure who gabber is; probably the wolf, and none of the PCs will get the lips), but it's not something BioWare ever did; better to just always start dialogue with a party member.

You're right, no lips on any player. Doesn't BG2 have a talking sword? (I never went through BG2) I wonder how that one was set up?

 

@berelinde: You lost me. :) Chain what?

 

 

Anything else in the script that doesn't make sense or could be improved? It took me the longest time to figure out that once an attack action is issued, you need the continue() statement to look for additional actions. Otherwise, nothing happens until the attack is resolved.

Link to comment

This is what I mean:

 

In your BAF:

 

IF

Conditions

THEN

RESPONSE #100

SetGlobal("TalkGlobal","GLOBAL",1)

StartDialogueNoSet(Player1)

END

 

Then in your D:

 

CHAIN

IF ~Global("TalkGlobal","GLOBAL",1)~ THEN ESEIRIK ESWolfie

~Die, you horrible wolf!~

DO ~SetGlobal("TalkGlobal","GLOBAL",2)~

== ESWOLF ~Yeah, right!~

== ESEIRIK ~Really, I mean it!~

== ESWOLF ~Talk to the paw.~

== ESEIRIK ~Oh yeah? Take that!~

== ESWOLF ~Erk. I think I'm dying!~

== ESEIRIK ~See! I told you!~

EXIT

 

Player1 will see everything in the above pathetic dialogue (and will get the lips), but it's all between Eirik and the wolf.

Link to comment

If you mean that when you give him a movement command, he walks a few steps and then stops, it means that you are not closing a variable and a script is looping.

 

You'd probably want to make sure a player is actually viewing it for the same reason you might put a !StateCheck(Player1,CD_STATE_NOTVALID) in your script: no sense playing the dialogue if the PC isn't going to see it. But from what you're saying, it sounds like it works just fine as is. So, carry on.

Link to comment

I broke the script out even further. Works sweet now; and no looping scripts.

 

IF
!InParty(Myself)
Global("ESEncounterWolf","GLOBAL",0) //ensures that it only plays once
AreaCheck("FW2800")
See([PC])
THEN
RESPONSE #100
	SetGlobal("ESEncounterWolf","GLOBAL",1)
	PlaySound("esWolf")
CreateCreature("esWOLF01",[1398.240],12) // Wolf
FaceObject(Player1)
Wait(1)
	StartDialogueNoSet(Player1)
END

IF
Global("ESEncounterWolf","GLOBAL",2)
THEN
RESPONSE #100
	SetGlobal("ESEncounterWolf","GLOBAL",3)
ActionOverride("esWOLF",MoveToPoint([1533.240]))
	MoveToPointNoInterrupt([1668.240])
MoveViewObject(Myself,VERY_FAST)
END

IF
Global("ESEncounterWolf","GLOBAL",3)
!StateCheck(Player1,CD_STATE_NOTVALID)
THEN
RESPONSE #100
ActionOverride("esWOLF",FaceObject("ESEIRIK"))
Wait(1)
PlaySound("WOLFF03")
	FaceObject("esWOLF")
Wait(1)
	StartDialogueNoSet("esWOLF")
END

IF
Global("ESEncounterWolf","GLOBAL",4)
THEN
RESPONSE #100
SetGlobal("ESEncounterWolf","GLOBAL",5)
SetGlobalTimer("ESWolfAttacks","GLOBAL",10)
	ActionOverride("esWOLF",Attack("ESEIRIK"))
Attack("esWOLF")
Continue()
END

IF
Dead("esWOLF") // Wolf
See([PC])
NumTimesTalkedTo(2)
THEN
RESPONSE #100
	StartDialogueNoSet([PC])
END

IF
	GlobalTimerExpired("ESWolfAttacks","GLOBAL")
!Dead("esWOLF") // Wolf
See("esWOLF")
Detect([PC])
THEN
RESPONSE #100
	Kill("esWOLF")
END

Link to comment

It means that the custom state CD_STATE_NOTVALID is absent from your state.ids file. Give me half a second, and I can give you the correct code to include in your tp2 so that your game recognizes that state (and you avoid the error).

Link to comment

Stick this toward the beginning of your tp2, and you'll be all set:

 

 

/* STATE.IDS patching - borrowed from BG1 NPC Project and CamDawg */

/* adds custom IsValidForPartyDialogue state */

APPEND ~STATE.IDS~ ~0x80101FEF CD_STATE_NOTVALID~

UNLESS ~CD_STATE_NOTVALID~

 

This handy little state check will make your life much easier. I would heartily recommend including it everywhere you don't want to specifically have dialogue for a specific state (I'm thinking about including some dialogue specifically for a case when the PC is put to sleep...). It covers sleep, death, silence, and more. Good stuff.

Link to comment

Archived

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

×
×
  • Create New...