Jump to content

Crossing the Great Divide


Recommended Posts

We need to add one more variable to the list.

 

"tutu_scriptp" should be "_" for Tutu

"tutu_scriptp" should be "p" for BGT

 

There are only two creatures in the game that require this, the two prostitutes that stand outside Feldpost's in Beregost. Still, it should probably go in there.

 

I know that I need them in Gavin.

Link to comment
"tutu_scriptp" should be "_" for Tutu

"tutu_scriptp" should be "p" for BGT

If I may, I'd suggest going ahead and extending this series to all 26 letters. I know I've already hit a few that weren't in the last library (h and t, IIRC). For ease, Id also suggest shift-F2'ing this chunk into an alphabetized list.

Link to comment

I am on it now. And I know that putting the whole thng into one setup is good, but perhaps splitting it will encourage a BG1 er to do the same thing, so that things written with the rcorrect coding structure (no OR(#), etc) can also be tucked onto BG1 seamlessly).

 

Playing with it now; further suggestions welcome... I will check back in about an hour.

Link to comment

OK, is there a cleaner way of doing this, before I update the tutorial?

 

/*
* "The BG1 NPC Project"
* Version 12 Combined Tutu/BGT installer
* authored and coded by tons of dedicated people from all walks of life
* August 27, 2007
* Version 12 Beta 4 Pre-Release
*/


/* Backup folder */
BACKUP ~BG1NPC/backup~

/* Author */
AUTHOR ~The BG1 NPC Project Team: forums.gibberlings3.net/index.php?showforum=45~

/* enable all error messages; nothing suppressed. comment this out for release version - cmorgan */
MODDER

/* launch the readme file immediately. If you want to disable the ReadMe, place two slashes before it, like //README  */
README ~bg1npc/bg1npcreadme.html~

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

 /* 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

/* Language Settings */
AUTO_TRA ~BG1NPC/TRA/%s~
LANGUAGE ~English~ ~english~ ~BG1NPC/TRA/english/setup.tra~

/* BEGIN The BG1 NPC Project: Required Modifications for v12 */
BEGIN @1005
 /* Tells other mods BG1NPC Core is installed */
 COPY ~BG1NPC/Core/X#component.xx~ ~override/X#BG1NPCCore.G3~

 

where ~BG1NPC\lib\g3_tutu_cpmvars.tpa~ and ~BG1NPC\lib\g3_bgt_cpmvars.tpa~ contents are here:

 

http://dev.gibberlings3.net/index.php/Comm...s:_Tutu_and_BGT

Edited by cmorgan
Link to comment
will encourage a BG1 er to do the same thing, so that things written with the rcorrect coding structure (no OR(#), etc) can also be tucked onto BG1 seamlessly)

 

That's what I did for my quest mod: I used the structure of this tutorial to cross-modd for BG1, BG1 + TotSC, Tutu and BGT. Miloch and I are thinking about creating BG1 libraries. Until then I just want to write what I did.

 

The overall code has to be BG1 engine syntax. Only exception I made was "EraseJournalEntry()", since it's standard for Tutu / BGT.

 

The variables I used for the cross platform modding to match all games were:

 

%FACE_x%, "x" being a number from 0 to 16: Face orientation in "CreateCreature()", i.e. "CreateCreature([xxx.yyy]%FACE_x%)".

For BG1, it's "CreateCreature([xxx.yyy])", for Tutu and BGT it's "CreateCreature([xxx.yyy],X)", with "X" being the face orientation.

 

For BG1 with TotSC, Tutu and BGT, this would be

 

/* TotSC, Tutu, BGT: Face orientation for CreateCreature([xxx.yyy]%FACE_x%) */

OUTER_SPRINT ~FACE_0~ ~,0~

OUTER_SPRINT ~FACE_1~ ~,1~

OUTER_SPRINT ~FACE_2~ ~,2~

OUTER_SPRINT ~FACE_3~ ~,3~

OUTER_SPRINT ~FACE_4~ ~,4~

OUTER_SPRINT ~FACE_5~ ~,5~

OUTER_SPRINT ~FACE_6~ ~,6~

OUTER_SPRINT ~FACE_7~ ~,7~

OUTER_SPRINT ~FACE_8~ ~,8~

OUTER_SPRINT ~FACE_9~ ~,9~

OUTER_SPRINT ~FACE_10~ ~,10~

OUTER_SPRINT ~FACE_11~ ~,11~

OUTER_SPRINT ~FACE_12~ ~,12~

OUTER_SPRINT ~FACE_13~ ~,13~

OUTER_SPRINT ~FACE_14~ ~,14~

OUTER_SPRINT ~FACE_15~ ~,15~

OUTER_SPRINT ~FACE_16~ ~,16~

 

For BG1 without TotSC, there is no face orientation:

 

/* BG1: Face orientation for CreateCreature([xxx.yyy]%FACE_x%) */

OUTER_SPRINT ~FACE_0~ ~~

OUTER_SPRINT ~FACE_1~ ~~

OUTER_SPRINT ~FACE_2~ ~~

OUTER_SPRINT ~FACE_3~ ~~

OUTER_SPRINT ~FACE_4~ ~~

OUTER_SPRINT ~FACE_5~ ~~

OUTER_SPRINT ~FACE_6~ ~~

OUTER_SPRINT ~FACE_7~ ~~

OUTER_SPRINT ~FACE_8~ ~~

OUTER_SPRINT ~FACE_9~ ~~

OUTER_SPRINT ~FACE_10~ ~~

OUTER_SPRINT ~FACE_11~ ~~

OUTER_SPRINT ~FACE_12~ ~~

OUTER_SPRINT ~FACE_13~ ~~

OUTER_SPRINT ~FACE_14~ ~~

OUTER_SPRINT ~FACE_15~ ~~

OUTER_SPRINT ~FACE_16~ ~~

 

 

%ERASEJOURNALENTRY_X%, x being the number of the string.

 

For Tutu and BGT, these would be (I have a list until @150 I can provide, before anyone else starts typing!)

 

/* EraseJournalEntry() for Tutu and BGT*/

OUTER_SPRINT "ERASEJOURNALENTRY_0" "ErasejournalEntry(@0)"

OUTER_SPRINT "ERASEJOURNALENTRY_1" "ErasejournalEntry(@1)"

OUTER_SPRINT "ERASEJOURNALENTRY_2" "ErasejournalEntry(@2)"

OUTER_SPRINT "ERASEJOURNALENTRY_3" "ErasejournalEntry(@3)"

OUTER_SPRINT "ERASEJOURNALENTRY_4" "ErasejournalEntry(@4)"

OUTER_SPRINT "ERASEJOURNALENTRY_5" "ErasejournalEntry(@5)"

OUTER_SPRINT "ERASEJOURNALENTRY_6" "ErasejournalEntry(@6)"

OUTER_SPRINT "ERASEJOURNALENTRY_7" "ErasejournalEntry(@7)"

OUTER_SPRINT "ERASEJOURNALENTRY_8" "ErasejournalEntry(@8)"

OUTER_SPRINT "ERASEJOURNALENTRY_9" "ErasejournalEntry(@9)"

OUTER_SPRINT "ERASEJOURNALENTRY_10" "ErasejournalEntry(@10)"

etc.

 

For BG1, with or without TotSC:

 

/* EraseJournalEntry() for BG1*/

OUTER_SPRINT "ERASEJOURNALENTRY_0" ""

OUTER_SPRINT "ERASEJOURNALENTRY_1" ""

OUTER_SPRINT "ERASEJOURNALENTRY_2" ""

OUTER_SPRINT "ERASEJOURNALENTRY_3" ""

OUTER_SPRINT "ERASEJOURNALENTRY_4" ""

OUTER_SPRINT "ERASEJOURNALENTRY_5" ""

OUTER_SPRINT "ERASEJOURNALENTRY_6" ""

OUTER_SPRINT "ERASEJOURNALENTRY_7" ""

OUTER_SPRINT "ERASEJOURNALENTRY_8" ""

OUTER_SPRINT "ERASEJOURNALENTRY_9" ""

OUTER_SPRINT "ERASEJOURNALENTRY_10" ""

 

Order of Journal entries: In Tutu /BGT, there is the distinction between SOLVED_JOURNAL and UNSOLVED_JOURNAL. In BG1, it's both JOURNAL.

For BG1, the syntax for AddJournalEntry() is without specification, i.e. AddJournalEntry(@0). For Tutu and BGT, the destinction between QUEST and QUEST_DONE is made, to sort it into the right diary page: AddJournalEntry(@0,QUEST) would be an unsolved quest entry.

So, what we need is:

 

/* order of journal entries, BG1 */

OUTER_SPRINT "SOLVED_JOURNAL" "JOURNAL"

OUTER_SPRINT "UNSOLVED_JOURNAL" "JOURNAL"

OUTER_SPRINT "QUEST" ""

OUTER_SPRINT "QUEST_DONE" ""

 

/* order of journal entries, Tutu and BGT */

OUTER_SPRINT "SOLVED_JOURNAL" "SOLVED_JOURNAL"

OUTER_SPRINT "UNSOLVED_JOURNAL" "UNSOLVED_JOURNAL"

OUTER_SPRINT "QUEST" ";QUEST"

OUTER_SPRINT "QUEST_DONE" ",QUEST_DONE"

 

Additionally, I needed some of the for Tutu and BGT already listed variables to use them in BG1, mainly

 

/* BG1: tp2, d, and baf parsing variables based on conversion */

OUTER_SPRINT "tutu_var" ""

 

/* BGT-only shutdown of D and BAF after BG1 content */

OUTER_SPRINT ~BGT_VAR~ ~~

 

/* BG1 Chapters */

OUTER_SPRINT "tutu_chapter_1" "1"

OUTER_SPRINT "tutu_chapter_2" "2"

OUTER_SPRINT "tutu_chapter_3" "3"

OUTER_SPRINT "tutu_chapter_4" "4"

OUTER_SPRINT "tutu_chapter_5" "5"

OUTER_SPRINT "tutu_chapter_6" "6"

OUTER_SPRINT "tutu_chapter_7" "7"

OUTER_SPRINT "PrologueChapter" "0"

OUTER_SPRINT "PrologueChapterAdvance" "0"

 

This way, I have one dialogue file and one script file for all three (four) games.

This is no method where a pure Tutu /BGT mod can be made working for BG1; as I said BG1 syntax is required. But for a newly created mod that can live without "AreaCheck()", "PartyRested()" and dream scripts etc. this is a nice way of minimising the work and possible copy&paste bugs.

Edited by jastey
Link to comment
This is no method where a pure Tutu /BGT mod can be made working for BG1
I do some sneaky things (ok, maybe some stupid things) with REPLACE_TEXTUALLY and scripting, probably would work the same for dialogs whereby a Tutu/BGT mod will also work for BG1 (and vice versa, which is marginally easier due to supposed backward-compatibility).

 

For example, I have a "targeting" block in a script for a creature in a BG2 (Tutu/BGT) engine mod. This CRE does not like spellcasters, particularly not druids, so goes after them first. Well, in the BG2 engine, we can cover all multi-classes with the "_ALL" flag:

IF
 !See([GOODCUTOFF.0.0.DRUID_ALL])
 !See([GOODCUTOFF.0.0.SORCERER])
 !See([GOODCUTOFF.0.0.MAGE_ALL])
 !See([GOODCUTOFF.0.0.CLERIC_ALL])
 !See([GOODCUTOFF.0.0.BARD_ALL])
 !See([GOODCUTOFF])

In BG1, this fails to compile, so instead I'll COPY the script and REPLACE_TEXTUALLY so I end up with something like this.

IF
 !See([GOODCUTOFF.0.0.DRUID])
 !See([GOODCUTOFF.0.0.MAGE])
 !See([GOODCUTOFF.0.0.CLERIC_MAGE])
 !See([GOODCUTOFF.0.0.CLERIC])
 !See([GOODCUTOFF.0.0.BARD])
 !See([GOODCUTOFF])

Yeah, it's not *exact* but it *emulates* the BG2 engine behaviour, which is good enough (for me anyway... I'm not out to make a BG1 SCS or something...).

 

Then of course, there's the Tutu underscore, which I'll just replace during compile also (I think cmorgan has described this above already):

IF
 HPPercentLT(Myself,70)
 !GlobalTimerNotExpired("tcn","LOCALS")
 HasItem("%tsu%POTN08",Myself)

(In Tutu, %tsu% becomes _ and otherwise it gets replaced with nothing.)

 

Then there are other cases where I want my CRE to use a BG2 (or even TotSC) spell that may not be available in plain BG1. Well if I'm feeling ambitious (and this is rare) I'll actually *port* the spell and all its resources to BG1. That can get hairy. If I'm feeling less than ambitious, I'll use the BG2 spell and simply REPLACE_TEXTUALLY its reference with a roughly-equivalent BG1 spell in the script when the mod install detects that platform. And if I'm feeling lazy (and yes, this is most common) I'll just use the BG1 spell to begin with in both scripts for maximum compatibility. It usually doesn't matter a whole lot for what I do, and I find it's more worthwhile to spend time on plot twists and dialogue options rather than cool eye candy like making Call Woodland Nymphs work in BG1 (eh... ok fine... I have spent a lot of time on that whistle.gif).

 

And if I'm in doubt with which spells work on which platforms, I find Oogi's School at Dudleyville to be an excellent reference and far less time-consuming than looking up stuff with multiple DLTCEP/NI instances (though I do a lot of that too of course).

 

I usually don't bother with having alternate scripts or resources for BG1/Tutu/BGT where I can avoid it, hence the reason for the REPLACE_TEXTUALLY in the TP2 on a common script. It makes for duplicate editing when you want to change some little thing in the script which is otherwise platform-independent. Sometimes I can't easily avoid that as with compressed/uncompressed BAMs for spell graphics and the like, but that's fairly easy once you figure out what works (and there's some other thread floating out on that but I'm too lazy to cross-reference it at the moment :)).

 

Area name differences are easy - just look up the Tutu/BGT area list in my signature and substitute "AR" for "FW" in the Tutu areas for BG1/TotSC.

 

I have more tips and maybe some TP2 examples, but most of my code is on my other laptop, which just fried another video card :).

Link to comment

Reminder to self - post the .rar'ed cmp_var libraries, because the development wiki is not operating.

 

Until I get to it, anyone can access this by downloading bg1npc and looking in the bg1npc\lib\ directory for the current master lists of things that need to be set as variables to allow a Tutu/BGT combined installer.

 

ETA should be July 13th by 5pm CST.

Link to comment
ETA should be July 13th by 5pm CST.
:)

 

To be honest, I only declare the ones I need in any particular mod, to keep the bloat factor/download size down. (Also when I'm squashing bugs, which is frequently, the fewer lines of code I have to tear through, the better.) Though I do consult the BG1 NPC lib and other mod libs pretty frequently for reference.

Link to comment

How would I make a.d-file that needs extra dialogue blocks for a BGT-install? For BGT, Thalantyr has an additional dialogue state 35 for the general "What can I do for you" after the first encounters. This state is not present in an unmodded Tutu or BG game. In the .d I want to E_B to this state, but only for BGT. I cannot put it into an extra .d file, as it has transitions to custom dialogue files (BG1UB, "The mysterious vial"). The dialogue block in question is:

 

 

//extra BGT stuff

EXTEND_BOTTOM THALAN 35

IF ~Global("D0TaintedOreQuest","GLOBAL",1)

PartyHasItem("POTN48")~ THEN REPLY @28 GOTO Examine //"Examine" is a custom dialogue state in the .d

IF ~Global("D0TaintedOreQuest","GLOBAL",2)

PartyHasItem("POTN48")~ THEN REPLY @29 GOTO Examine

END

Link to comment

You have a .tra file that contains the line already, and there is USING, so you could create a small bgt-only snippet and do something like this

 

in .tp2

 

ACTION IF ~game is bgt~ THEN BEGIN

OUTER_SPRINT ~bgt_dialog~ ~

EXTEND_BOTTOM THALAN 35

IF ~Global("D0TaintedOreQuest","GLOBAL",1)

PartyHasItem("POTN48")~ THEN REPLY @28 GOTO Examine //"Examine" is a custom dialogue state in the .d

IF ~Global("D0TaintedOreQuest","GLOBAL",2)

PartyHasItem("POTN48")~ THEN REPLY @29 GOTO Examine

END

~

END ELSE BEGIN

OUTER_SPRINT ~bgt_dialog~ ~~

END

 

COMPILE EVALUATE_BUFFER ~myDialogFile~

USING ~the original tra file~

 

and put a line in the relevant d %bgt_dialog%

 

I don't know if that would work, haven't tested doing large multiline OUTER_SPRINT...

 

wait a minute -

 

Thinking about it, I would skip all that. I would run a small .d that only gets used when game_is BGT and map the .tra to the small file using USING

Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...