Jump to content

Converting existing mods to support EET


Recommended Posts

For a full tutorial on how to make a mod compatible with EET please refer to Modder's Notes distributed with the mod package. Instead of repeating what is already written there this topic is only meant to present overall scope of the required changes and general directions.

1. Mods that doesn't support EE engine at all

How-to: Converting existing mods to the EE engine

 

2. BG2:EE only mods

If the mod is compatible with BG2:EE and only has BG2 content than adding compatibility is a matter of minutes. Here are usual steps:

  • GAME_IS weidu command returns true if the IE game variant is one of the entries specified, otherwise it returns false. EET is recognized as ~eet~ by this command instead of ~bg2ee~, so the mod should be adopted properly if needed. Some older mods may use outdated coding which checks for file existence to determinate what type of platform is used instead of GAME_IS, so such situation also should be taken into account.
  • EET 1.0 uses a continuous journal and chapters system that keeps track of all 22 chapters of your journey:

Baldur's Gate – chapters from 0 (prologue) to 7.
Siege of Dragonspear expansion – chapters from 7 to 13
Baldur's Gate II: Shadows of Amn – chapters from 13 to 19 (instead of 1-7).
Throne of Bhaal expansion – chapters from 20 to 22 (instead of 8-10).

This system is an attempt at making the whole saga feel like a single, continuous game, with old areas still visitable regardless of the story progress. The aim here is to turn the end of the campaign not much different than the end of any other chapter, so the game world is preserved, journal are not cleaned etc. In order to achieve this mods affecting later parts of the story (BG2, ToB) need to use continuous chapter/journal system.

The easiest way to implement it without breaking compatibility with other platforms is using cross-platform variables that should replace the actual chapter numbers in dialogues and scripts. Here is example implementation:

1. ALWAYS section becomes expanded with variable declaration code:

ACTION_IF (GAME_IS ~eet~) BEGIN
  OUTER_SET bg2_chapter = 12
END ELSE BEGIN
  OUTER_SET bg2_chapter = 0
END
OUTER_FOR (i=1; i<=10; i=i+1) BEGIN
  OUTER_SET bg2_chapter = bg2_chapter + 1
  OUTER_SPRINT name_source ~bg2_chapter_%i%~
  OUTER_SET EVAL ~%name_source%~ = bg2_chapter
END

Or this if the above code is not easy enough to read (it does the exact same thing)

ACTION_IF (GAME_IS ~eet~) BEGIN
  OUTER_SET bg2_chapter_1 = 13
  OUTER_SET bg2_chapter_2 = 14
  OUTER_SET bg2_chapter_3 = 15
  OUTER_SET bg2_chapter_4 = 16
  OUTER_SET bg2_chapter_5 = 17
  OUTER_SET bg2_chapter_6 = 18
  OUTER_SET bg2_chapter_7 = 19
  OUTER_SET bg2_chapter_8 = 20
  OUTER_SET bg2_chapter_9 = 21
  OUTER_SET bg2_chapter_10 = 22
END ELSE BEGIN //any other platform
  OUTER_SET bg2_chapter_1 = 1
  OUTER_SET bg2_chapter_2 = 2
  OUTER_SET bg2_chapter_3 = 3
  OUTER_SET bg2_chapter_4 = 4
  OUTER_SET bg2_chapter_5 = 5
  OUTER_SET bg2_chapter_6 = 6
  OUTER_SET bg2_chapter_7 = 7
  OUTER_SET bg2_chapter_8 = 8
  OUTER_SET bg2_chapter_9 = 9
  OUTER_SET bg2_chapter_10 = 10
END

2. And than we can use these variables normally in code:

GlobalLT("chapter","GLOBAL",6) //old style of chapter coding
GlobalLT("chapter","GLOBAL",%bg2_chapter_6%) //new style of chapter coding

3. What is left is adding EVALUATE_BUFFER to tp2 code whenever script or dialogue containing variables needs evaluation (COMPILE, EXTEND_TOP, EXTEND_BOTTOM, REPLACE_BCS_BLOCK)

 

Sounds like a nightmare thing to do manually? No worry, both GAME_IS patching and chapter variable implementation can be implemented automatically with EET_modConverter tool available within mod package.

 

3. BG:EE only mods

If the mod is compatible with BG:EE and only has BG1 content than adding compatibility can be achieved in two different ways. Either let the mod be installed on BG:EE previous to installing EET on BG2:EE (no problem if the mod doesn't conflict with BG2 content - this can be checked with another tool available in the package - let me know if you would like your mod to be supported by EET this way) or implement native compatibility.

 

When it comes to native compatibility you should be aware about EET naming conventions for conflicting BG1 resources and technical features used by EET platform. If your mod already takes advantage of cross-platform variable libraries popularized by BG1 NPC Project (cpmvars) than check out EET/other/cpmvars folder to get the library for EET.

 

You can also use EET_modConverter tool to convert naming conventions used in mod between BG:EE -> EET, BGT ->EET, any platform -> cpmvars. The conversion will also result in a detailed change-log, which will allow you to manually revert changes made to your files if needed.

 

4. BG:EE and BG2:EE NPC mods

Regardless of the portion of the story that the NPC mod has been designed for it's recommended to adopt NPC continuity system. To make this task easier for modders EET comes with pre-made weidu function that can be used to implement required code automatically (all you need to do is disable FATESP.DLG patching if GAME_IS ~eet~, INCLUDE most recent version of EET_functions.tph file and than use it in your tp2. Examples and detailed explanation of each option in this function can be found in the documentation.

 

5. Mods affecting both BG:EE and BG2:EE resources

These are the most tricky beasts because you can't just trust EET_modConvert to handle conversion automatically - in most cases that would result in modifying both BG1 and BG2 stuff which is not intended. However you can still use the output change-log in order to decide which changes are warranted, especially if you know the code well. Preferable way to deal with incompatibilities between platform in such mods is using cross-platform coding variables. Fortunately patches for most demanding mods in this category has been already made.

 

6. Mods adding areas to Worldmap

http://gibberlings3.net/forums/index.php?showtopic=27749

Edited by K4thos
Link to post

Not sure where to put this. Banter pack uses syntax like G("Chapter",6) for Global("Chapter","GLOBAL",6). Seeing that these instances are missed in the EET patches from Fixpack, could it be EET_modConverter doesn't consider these instances yet?

Same for GGT("Chapter",X) and GLT("Chapter",Y).

Link to post

Not sure where to put this. Banter pack uses syntax like G("Chapter",6) for Global("Chapter","GLOBAL",6). Seeing that these instances are missed in the EET patches from Fixpack, could it be EET_modConverter doesn't consider these instances yet?

Same for GGT("Chapter",X) and GLT("Chapter",Y).

In the EET mod converter, there is Chapter_patcher.tph

The commented code says this *this should take care of SetGlobal, Global, GlobalGT, GlobalLT, SG, G, GGT, GLT*.

 

I have to admit however that the code itself is something beyond my skills thus I cannot say if it actually does what it says, but I think this is the place to look at.

 

I used the function to convert the Chloe mod for EET and this mod uses the GGT or !GGT for chapters in a number of places. The references are correc in my resulting EET version.

 

Edited by Roxanne
Link to post

Not sure where to put this. Banter pack uses syntax like G("Chapter",6) for Global("Chapter","GLOBAL",6). Seeing that these instances are missed in the EET patches from Fixpack, could it be EET_modConverter doesn't consider these instances yet?

Same for GGT("Chapter",X) and GLT("Chapter",Y).

I've just used EET_modConverter on Banter Packs and it generated this report:

Patching banterpack/bantergoose/bantergoose.baf: GGT("Chapter",1) => GGT("Chapter",%bg2_chapter_1%)
Patching banterpack/dialogue/banter-soa.d: GGT("Chapter",1) => GGT("Chapter",%bg2_chapter_1%)
Patching banterpack/dialogue/banter-soa.d: GGT("Chapter",1) => GGT("Chapter",%bg2_chapter_1%)
Patching banterpack/scripts/aerie.baf: G("Chapter",6) => G("Chapter",%bg2_chapter_6%)
Patching banterpack/scripts/aerie.baf: G("Chapter",6) => G("Chapter",%bg2_chapter_6%)
Patching banterpack/scripts/keldorn.baf: Global("Chapter","GLOBAL",6) => Global("Chapter","GLOBAL",%bg2_chapter_6%)
Patching banterpack/scripts/keldorn.baf: Global("Chapter","GLOBAL",6) => Global("Chapter","GLOBAL",%bg2_chapter_6%)
Patching Setup-banterpack.tp2: ALWAYS command expanded
ALWAYS
  ACTION_IF (GAME_IS ~eet~) BEGIN
    OUTER_SET bg2_chapter = 12
  END ELSE BEGIN
    OUTER_SET bg2_chapter = 0
  END
  OUTER_FOR (i=1; i<=10; i=i+1) BEGIN
    OUTER_SET bg2_chapter = bg2_chapter + 1
    OUTER_SPRINT name_source ~bg2_chapter_%i%~
    OUTER_SET EVAL ~%name_source%~ = bg2_chapter
  END

so it seems to be working fine (unless it missed something?). Maybe the patch for Big World Fixpack was created before this issue has been fixed (if I remember correctly there was a point in time when the tool couldn't recognize this syntax). Not sure who is currently maintaining Big World Fixpack though to include these changes.

Link to post
Is this necessary for kit mods?

no, if the kit mod uses fl#add_kit_ee.tpa v1.1.3 (2016-04-17) - earlier versions didn't have support for IWD:EE and EET.

 

Also if the mod uses GAME_IS weidu command then ~eet~ should be included in such check (since weidu doesn't recognize EET installation as BG2:EE game).

Edited by K4thos
Link to post

A thousand thanks for the instruction! One question though: let's say I converted some NPC mod. How would I know the installation order considering other NPC mods already converted for EET? Would it be the same order as in BWS installation list for BGEE alone?

Link to post

A thousand thanks for the instruction! One question though: let's say I converted some NPC mod. How would I know the installation order considering other NPC mods already converted for EET? Would it be the same order as in BWS installation list for BGEE alone?

Exactly.

BWS uses the same install order file for BG2EE and EET, just skips those that are not in one game or the other.

If you look at your BWS/Config/BG2EE/select.txt you find the detailed sequence.

So, if you want to install a mod you have converted for your own use, you can identify the next one after your mod in the list and in your BWS selection menu mark this one for *pause before install*. When BWS reaches this point it will pause, you can install your mod and then continue. Or you follow the whole sequence manually anyway.

Link to post

Hi!

 

Does EET make any changes to the name of ITM and BAM files?

 

I'm asking 'cause the mod I'm working on has a component that changes icons, illustrations, and color offsets for most items in BG:EE and BGII:EE, as well as some from SoD. If EET doesn't change any of the file names, then my component is probably already compatible off the bat; if it does, I will write an alternative tph for EET specifically (in that case, it would help if a mapping table existed, showing which names were changed to what.)

Link to post

Hi!

 

Does EET make any changes to the name of ITM and BAM files?

 

I'm asking 'cause the mod I'm working on has a component that changes icons, illustrations, and color offsets for most items in BG:EE and BGII:EE, as well as some from SoD. If EET doesn't change any of the file names, then my component is probably already compatible off the bat; if it does, I will write an alternative tph for EET specifically (in that case, it would help if a mapping table existed, showing which names were changed to what.)

In the EET download, you find a folder EET/docs which contains the information you might seek. If I remember correctly there are a few selected items from BG1 and/or SoD that are modified by EET in order to avoid conflicts or duplication with BG2 items and create a consistent game.

Apart from those few exceptions, EET does not change resources

Edited by Roxanne
Link to post
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...