Jump to content

BG1 Tweaks Modding


grogerson

Recommended Posts

OK. I've managed to cobble together what I think is a decent mod. I may be a fair cobbler, but I'm no programmer. I need to make one change, and I need help on one tweak in process.

 

I noted over at SHS someone installing a Tutu game actually installed both BG1 Tweaks and the BG2 Tweak Pack. I want to set a check in the former so it will detect if it's a BG2 install it's going into, and terminate (with the appropriate notification, of course). A simple ARE or CRE check should do, but I've no idea how have it not install. Any ideas?

 

The tweak I'm working on allows you to send party members to an inn if kicked out (modified from SCS; if I get it to work I'll ask permission to include it, DavidW). It looks like it's almost working. Almost... My problem is I'm getting a CTD when I return to the inn. This is the error message I get.

 

"An Assertion failed in D:\Dev\Baldur\ObjAnimation.cpp at line number 14565."

 

Again, can anyone help?

Link to comment

BEGIN ~nice, friendly mod component~
 REQUIRE_PREDICATE ( ENGINE_IS ~bg1~ || ENGINE_IS ~totsc~ ) ~this is not the tweak pack you're looking for~

 

Works nicely.

 

WeiDU --tlkout dialog.tlk --ftlkout dialogf.tlk --log setup-blarg.debug  blarg.tp2 setup-blarg.tp2 blarg/blarg.tp2 blarg/setup-blarg.tp2 
[WeiDU] WeiDU version 20834
This is a non-stable version. Unless you're sure about what you're doing, consider downgrading.
[WeiDU] Using scripting style "BG2"

SKIPPING: [nice, friendly mod component]
this is not the tweak pack you're looking for

Press ENTER to exit.

Link to comment
The tweak I'm working on allows you to send party members to an inn if kicked out (modified from SCS; if I get it to work I'll ask permission to include it, DavidW). It looks like it's almost working. Almost... My problem is I'm getting a CTD when I return to the inn. This is the error message I get.

 

"An Assertion failed in D:\Dev\Baldur\ObjAnimation.cpp at line number 14565."

IIRC, something like this is usually a bad character animation (possibly an invalid readied selection, like a two-handed weapon with a shield). Make sure they're not giving items to Player1 or something else causing them to switch weapons or equipment from when they leave to when they spawn.

 

I'm not sure offhand what else would be causing this (assuming you can enter the inn when your code doesn't run and you don't get any problems with that character before it's kicked out of the party).

Link to comment

Icendoan and erik - Thanks. From both your replies, sounds like WeiDU has a built-in game check. Is this correct? And this will stop installation in anything other that BG1 and BG1-TotSC?

 

devSin - SCS is coded so that you have to visit the inn before sending anyone there. No problems entering the inn, nor with the NPC, only when I send the NPC to the inn, and only when they should appear on screen. Any idea what "line number 14565" is?

 

From the tp2:

BEGIN ~NPCs go to inns~
COPY_EXISTING ~misc01.itm~ ~override/dw#12.xxx~
INCLUDE ~newtweaks/misc/inns.tph~
LAUNCH_ACTION_MACRO ~wait_at_inns~

From inns.tph (Imoen only):

DEFINE_ACTION_MACRO ~wait_at_inns~ BEGIN
COPY ~newtweaks/misc/depart.d~ ~override/dw#imoen.d~
REPLACE_TEXTUALLY ~dmwwscriptname~ ~imoenp~
REPLACE_TEXTUALLY ~dmwwstatenumber~ ~2~
REPLACE_TEXTUALLY ~dmwwresponse~ ~811~
REPLACE_TEXTUALLY ~dmwwfailoc~ ~[814,1006]~
REPLACE_TEXTUALLY ~dmwwbereloc~ ~[812,980]~
COMPILE 	~override/dw#imoen.d~
END

From depart.d (FAI only):

EXTEND_BOTTOM ~dmwwscriptname~ dmwwstatenumber
IF ~Global("EnteredArmInn","GLOBAL",1)
!Global("IslandTravel","GLOBAL",1) //not on Werewolf Isle
!Global("teth","GLOBAL",1) //not trapped under Candlekeep AR2613, 2615, 2619, 5506
!Global("teth","GLOBAL",2)~
THEN REPLY @801 GOTO dmww_fai
END
APPEND ~dmwwscriptname~
IF ~~ THEN BEGIN dmww_fai 
 SAY @dmwwresponse
 IF ~~ THEN DO ~RunAwayFromNoInterrupt([PC],2)
 LeaveAreaLUA("AR2301","",dmwwfailoc,14)~
EXIT
END

Anything here that could screw up the animations?

Link to comment
devSin - SCS is coded so that you have to visit the inn before sending anyone there. No problems entering the inn, nor with the NPC, only when I send the NPC to the inn, and only when they should appear on screen. Any idea what "line number 14565" is?
It's just the line number in the source file where the assertion fired. I haven't seen enough ObjAnimation failures to know exactly what's going on at that point. As for your code, I really don't see anything alarming there.

 

I would suggest checking the coordinates (it shouldn't make a difference, but double-check that they're valid and not spawning on top of impassable terrain or on top of another actor). Also, LeaveAreaLUA() is primarily a party call; MoveBetweenAreas() (Tutu) or MoveGlobal() (TotSC) is what I'd recommend using for characters leaving or who are outside the party.

 

You could also try killing the RunAwayFromNoInterrupt() (I didn't think that existed in TotSC) and setting the orientation to 0 (from 14), but that's really just grasping at straws. :(

Link to comment

Thanks for the info, devSin. I'll check it out.

 

Actually RunAwayFromNoInterrupt() exists in BG1 without TotSC. It works for another tweak (sending player-created NPC's to an inn). Figured I'd try it for this one. In BG1 you can send only one, however. Any others simply disappear. This limit vanishes with TotSC.

Link to comment
Icendoan and erik - Thanks. From both your replies, sounds like WeiDU has a built-in game check. Is this correct? And this will stop installation in anything other that BG1 and BG1-TotSC?

 

Yup. It was added soon after the bigg started meddling with weidu :thumbsup: ... The code I posted is all you need, I tested it on bg1 and bg2 installs while writing.

Link to comment

I've focused the Send NPC's to an Inn to Imoen only (all others are commented out). Originally, she was supposed to appear in the FAI just left of the entrance. She was not there, and there was some corruption just right of Bentley that caused the CTD. I moved the location to just outside the main gates (AR2300). No CTD, but no Imoen either.

 

When I install the tweak I get the "installed with errors" warning. Here's the pertinent element of the debug file.

Install Component [NPCs go to inns]?

nstall, or [N]ot Install or [Q]uit?

Installing [NPCs go to inns]

Copying 1 file ...

[./override/misc01.itm] loaded, 170 bytes

Copied [misc01.itm] to [override/dw#12.xxx]

Copying and patching 1 file ...

[newtweaks/misc/depart.d] loaded, 1912 bytes

Copied [newtweaks/misc/depart.d] to [override/dw#imoen.d]

Compiling 1 dialogue file ...

BIFF may be in hard-drive CD-path [O:\CD5\/DATA/DEFAULT.BIF]

BIFF may be in hard-drive CD-path [O:\CD4\/DATA/DEFAULT.BIF]

BIFF may be in hard-drive CD-path [O:\CD3\/DATA/DEFAULT.BIF]

BIFF may be in hard-drive CD-path [O:\CD2\/DATA/DEFAULT.BIF]

BIFF may be in hard-drive CD-path [O:\CD1\/DATA/DEFAULT.BIF]

BIFF may be in hard-drive CD-path [f:\black isle\bg1 basic\/DATA/DEFAULT.BIF]

[f:\black isle\bg1 basic\/DATA/DEFAULT.BIF] 430794 bytes, 152 files, 0 tilesets

[./override/ACTION.IDS] loaded, 5668 bytes

 

[action list near line 45, column 43 of override/dw#imoen.d] PARSE WARNING at line 46 column 1-33

Near Text: ,

syntax error

WARNING: cannot verify action ~RunAwayFromNoInterrupt([PC],2)

LeaveAreaLUA("AR2300","",[1574,3490],0)~: Parsing.Parse_error

Warning at src/dparser.mly.69

 

[action list near line 53, column 41 of override/dw#imoen.d] PARSE WARNING at line 54 column 1-32

Near Text: ,

syntax error

WARNING: cannot verify action ~RunAwayFromNoInterrupt([PC],2)

LeaveAreaLUA("AR3304","",[812,980],0)~: Parsing.Parse_error

Warning at src/dparser.mly.69

Processing 1 dialogues/scripts ...

BIFF may be in hard-drive CD-path [O:\CD5\/DATA/DIALOG.BIF]

BIFF may be in hard-drive CD-path [O:\CD4\/DATA/DIALOG.BIF]

BIFF may be in hard-drive CD-path [O:\CD3\/DATA/DIALOG.BIF]

BIFF may be in hard-drive CD-path [O:\CD2\/DATA/DIALOG.BIF]

BIFF may be in hard-drive CD-path [O:\CD1\/DATA/DIALOG.BIF]

BIFF may be in hard-drive CD-path [f:\black isle\bg1 basic\/DATA/DIALOG.BIF]

[f:\black isle\bg1 basic\/DATA/DIALOG.BIF] 783087 bytes, 1003 files, 0 tilesets

[iMOENP.DLG] loaded

[iMOENP.DLG] saved 7 states, 10 trans, 3 strig, 7 ttrig, 8 actions

Anyone know what the problem is, primarily the "src/dparser.mly.69" parsing error?

 

Edit: erik and Icendoan, your ideas aren't doing what I was hoping for. And I've tried them both. I'm looking for a check at the very beginning of the installation process that will stop it if the game is anything other than BG1. Unless I'm missing something, I'd have to put your checks in every tweak. A pain for me, and annoying for whoever is installing BG1 Tweaks. ... Am I missing something?

Link to comment

(bows in respect) Thank you, jastey. It's working now. Such a little thing... Pardon me while I do a Charlie Brown against the maple tree in the front yard...

 

Now to ask DavidW for permission...

 

Still -- how do you keep a mod (not just a component) from installing in the wrong game? Anyone have any ideas I can check out?

Link to comment

Try either putting an ALWAYS at the top, so it checks at the very beginning, like BG1NPC does for setting crossplatform variables:

 

ALWAYS
 ACTION_IF FILE_EXISTS_IN_GAME ~FW0100.are~ THEN BEGIN
/* Tell the player it is using Tutu stuff */
PRINT @1000
INCLUDE ~BG1NPC\lib\g3_tutu_cpmvars.tpa~
 END ELSE BEGIN
ACTION_IF FILE_EXISTS_IN_GAME ~AR7200.are~ THEN BEGIN
  /* Tell the player it is using BGT stuff */
  PRINT @1001
  INCLUDE ~BG1NPC\lib\g3_bgt_cpmvars.tpa~
  /* Tell the player it is not Tutu or BGT */
  END ELSE BEGIN FAIL @1002
END
 END

 /*  alter fluid states */
 INCLUDE ~BG1NPC\lib\g3_fluid_cpmvars.tpa~

 /* prep tras for sound references */
 COPY ~BG1NPC/TRA/%LANGUAGE%/BG1NPC_tmp.tra~ ~BG1NPC/TRA/%LANGUAGE%/BG1NPC.tra~
 EVALUATE_BUFFER
 LOAD_TRA ~BG1NPC/TRA/%LANGUAGE%/BG1NPC.tra~

END

 

An ALWAYS clause runs even if someone tries to install a single component from way down in the stack. The simplification for your purposes is something like

 

 

BACKUP ~mymod\backup~

AUTHOR ~grogerson~

README ~mymod\readme-mymod.html~

MODDER //comment out for release version

VERSION ~v1-beta~

ALWAYS
 ACTION_IF GAME_IS  ~bg1~ THEN BEGIN
/* Tell the player yes, this works on BG */
PRINT ~Hey, yo, word up - this game is BG. Go ahead and install my mod.~
 END ELSE BEGIN FAIL ~duh - this game is NOT BG. Go read the docs I spent all that time creatin'. What, you be stupid, yo? ~
 END
END

 

or ENGINE_IS or whatever you want.

 

I think that is absolutely as close as you can get to having that error message pop up right at the beginning.

 

On a BG install of BG1NPC (which still occasionally happens, believe it or not :) ), the FAIL statement runs immediately, dumping the player out of the installation. WeiDU just checks each of these blocks and does all of the actions before each component in the install, including the FAIL check, and including the first component.

Link to comment

Archived

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

×
×
  • Create New...