Jump to content


Photo

Why is this dialog crashing the game?


  • Please log in to reply
2 replies to this topic

#1 Smiling Imp

Smiling Imp
  • Member
  • 156 posts

Posted 19 July 2012 - 11:34 AM

BEGIN ~BRUTAX~

IF ~Global("BRUTAX","GLOBAL",0)InParty("7XSHAR")~ THEN BEGIN INTRO1b
SAY ~You are not going to cower off before I have had the chance to crush you, are you Shar-Teel?~
IF ~~ THEN DO ~SetGlobal("BRUTAX","GLOBAL",1)~ EXTERN ~7XsharJ~ BRUTAX1-1
END

IF ~Global("BRUTAX","GLOBAL",0)IsGabber("7XSHAR")~ THEN BEGIN INTRO1c
SAY ~You are not going to cower off before I have had the chance to crush you, are you Shar-Teel?~
IF ~~ THEN DO ~SetGlobal("BRUTAX","GLOBAL",1)~ EXTERN ~7XsharJ~ BRUTAX1-1
END

IF ~~ THEN BEGIN BRUTAX2-1
SAY ~Count yourself lucky, amazon, that Caratacus does not wish for me to kill you just yet..~
=
~Once he has had his fill of gold and has no further use for you though, it will be my pleasure to hack you into pieces.~
IF ~~ THEN EXTERN ~7XsharJ~ BRUTAX3-1
END

IF ~~ THEN BEGIN BRUTAX4-1
SAY ~Grrrrrr...~
IF ~~ THEN EXIT
END

APPEND 7XsharJ
IF WEIGHT #-10 ~~ THEN BEGIN BRUTAX1-1
SAY ~The next time we face each other in the battle pits, Brutax, my blade is going to tickle your innards.~ [shart8]
IF ~~ THEN EXTERN ~BRUTAX~ BRUTAX2-1
END
END

APPEND 7XsharJ
IF WEIGHT #-10 ~~ THEN BEGIN BRUTAX3-1
SAY ~You could not hack a branch off a tree, much less defeat me in battle, you useless male dung heap!~ [shart7]
IF ~~ THEN EXTERN ~BRUTAX~ BRUTAX4-1
END
END


I am having a headache with some of my dialogs now.. :crying: Sometimes they work, sometimes nothing, but every instance where I try to EXTERN and APPEND my dialogs like this has been acting screwy. Can anyone please drop me some advice, b/c I have tried a few different things now but can't get this resolved.

Edited by Smiling Imp, 19 July 2012 - 11:36 AM.

Baldur's Gate 1 NPCs in SoA & ToB

 

http://www.baldursga...downfile&id=177

 

Forum:

 

http://www.baldursga...php?board=133.0

 

Smiling Imp Cross Banter Mod

 

http://www.baldursga...a=view;down=196

 

ZELINK (Zelda x Link) mod for Baldur's Gate 2 SOA

 

http://archive04.fil...3b/n/ZELINK.ace


#2 cmorgan

cmorgan
  • Modder
  • 2301 posts

Posted 20 July 2012 - 07:51 AM

I think the toughest thing is to keep track of targets in APPEND :)

If it is crashing in-game, or cutting off, it is likely that the problem is a typo in the target .dlg name or an uncompiled .dlg as target. Perhaps brutax exists already, and is getting blown away by the BEGIN? That line creates a new

If the .cre has the .dlg file assigned, it is being compiled, and the targets are correct, then try a recode without the dashes, or using CHAIN and see if it works...
I assume you want to have the interaction only happen once, and have it varied by whether Shar Teel is the one talking to him or if someone else is doing the talking. I'd suggest that you could make this simpler by writing two complete and separate things, both of which could play -

/* BRUTAX > 7XSHAR */
CHAIN IF ~Global("X7BRUTAX","GLOBAL",0) InParty("7XSHAR")~ THEN BRUTAX introsharbrutax
~You are not going to cower off before I have had the chance to crush you, are you Shar-Teel?~
DO ~SetGlobal("X7BRUTAX","GLOBAL",1)~
== BRUTAX ~text~
== 7XsharJ ~text~
EXIT

The quickest way to figure out what is wrong is to deompile BRUTAX after the mod is installed, and take a look at what WeiDU says you said.

(By the way, I added your prefix to your globals. You will not *believe* how much easier it is to track and troubleshoot your changes if they all start with your prefix, whether you yous NI, DLCEPT, or WeiDU and a text editor - a sort of a text file of vars can lay everything right alongside and see where something went off the rails. Anything that isn't an existing in-game var, .cre, DV, or script should get this not only to simplify your troubleshooting, but to avoid a fellow modder accidentally using Brutax and messing stuff up on both ends!)

Edited by cmorgan, 20 July 2012 - 07:55 AM.


#3 cmorgan

cmorgan
  • Modder
  • 2301 posts

Posted 20 July 2012 - 11:00 AM

OK, quick follow up - I ran a full install of v5. There is definitely a stray BEGIN or something in your files, when someone does a full install - and I can tell that by the way the state numbers run.

After a full install,
F:\BGII - SoA\script compiler\decompiled\7XSHARJ.d shows 203 states.
But
F:\BGII - SoA\script compiler\decompiled\BRUTAX.d links to
(state 2) EXTERN ~7XSHARJ~ 207
(state 3) EXTERN ~7XSHARJ~ 208

So, somewhere after BRUTAX got compiled,.something messed about with X7SHARJ.

(The Kagain ToB stuff you already know about).

My suggestion is to separate a .d out with just the "begin" calls for each of the dialogs, then use APPEND and CHAIN to add to that initial entry, like this:

in initial_dialog_priming.d
BEGIN 7XSHARJ
BEGIN 7XBRUTAX
// etc. etc.)

and in your regular .ds, just use
APPEND ~7XBRUTAX~
APPEND ~7XSHARJ~

etc.

Let me see if I can attach the decompiled files so you can troubleshoot for yourself...
Attached File  7XSHARJ.d   186.52K   263 downloads
Attached File  BRUTAX.d   5.7K   165 downloads

These are on a clean, un-fixpacked, un-touched vanilla BGII - ToB install, so no oter mods are messing with yours.

Edited by cmorgan, 20 July 2012 - 11:01 AM.