Skip to content

Commit

Permalink
BG:EE Rough World mod support
Browse files Browse the repository at this point in the history
  • Loading branch information
K4thos committed Jan 29, 2017
1 parent e07b90d commit 0273997
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 1 deletion.
25 changes: 25 additions & 0 deletions EET/docs/Modder's Notes.html
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ <h2>Tutorials</h2>
<li><a href="#Adding support for EET chapters/journal system">Adding support for EET chapters/journal system</a></li>
<li><a href="#Working with files that are merged during installation">Working with files that are merged during installation</a></li>
<li><a href="#Detecting EET within WeiDU code">Detecting EET within WeiDU code</a></li>
<li><a href="#Detecting EET within UI.MENU (GUI) code">Detecting EET within UI.MENU (GUI) code</a></li>
<li><a href="#Trigger filtering across BG1, SoD, BG2:SoA, BG2:ToB">Trigger filtering across BG1, SoD, BG2:SoA, BG2:ToB</a></li>
<li><a href="#Adding AreaType to BG1 ARE files">Adding AreaType to BG1 ARE files</a></li>
<li><a href="#Detecting mods installed on BG:EE">Detecting mods installed on BG:EE</a></li>
Expand Down Expand Up @@ -419,6 +420,30 @@ <h3>Detecting EET within WeiDU code</h3>

<p>Once again <a href="../other/EET_modConverter">EET_modConverter</a> may be handy if you need to replace many instances of GAME_IS command in your code - the tool has an option to do it automatically.</p>

<a id="Detecting EET within UI.MENU (GUI) code" name="Detecting EET within UI.MENU (GUI) code"></a>
<h3>Detecting EET within UI.MENU (GUI) code</h3>

<p>In order to detect EET presence from within UI.MENU LUA code (for example to enable some features in cross platform compatible GUI mods) you can use following code:</p>
<div class="code">
<pre>
eetState = Infinity_GetINIValue('Program Options','EET Installation State')
</pre>
</div>
<p>In this example code 'eetState' variable will return 0 on non EET games and 2 when it's EET installation (or 1 if setup-EET_end component has not been installed yet). Example usage:</p>
<div class="code">
<pre>
enabled "eetState ~= 0" --enabled if game is EET

enabled "eetState == 0" --enabled if game is not EET

if eetState > 0 then --EET installation
--some code
else --not EET installation
--some code
end
</pre>
</div>

<a id="Trigger filtering across BG1, SoD, BG2:SoA, BG2:ToB" name="Trigger filtering across BG1, SoD, BG2:SoA, BG2:ToB"></a>
<h3>Trigger filtering across BG1, SoD, BG2:SoA, BG2:ToB</h3>
<p>EET uses following GLOBAL in-game variable filters for vanilla campaigns to shut off content that no longer should show up after certain point of the story.</p>
Expand Down
3 changes: 2 additions & 1 deletion EET/lib/EET_core.tp2
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@ SetPrivateProfileString('%row%','%option%','%option_1%')
"Text" , "%LANGUAGE_BG2%" => "Language"
"EET Installation State" , 1 => "Program Options"
"Active Campaign" , 1 => "Program Options"
//"Never Show Nuisance SOD" , 0 => "Program Options"
"Never Show Nuisance SOD" , 1 => "Program Options"
"Debug Mode" , 1 => "Program Options"
"Cheats" , 1 => "Game Options"
"BG4LOGO" , 1 => "MOVIES"
Expand Down Expand Up @@ -1006,6 +1006,7 @@ END ELSE BEGIN
SetPrivateProfileString('Language','Text','%LANGUAGE_BG2%')
SetPrivateProfileString('Program Options','EET Installation State','1')
SetPrivateProfileString('Program Options','Active Campaign','1')
SetPrivateProfileString('Program Options','Never Show Nuisance SOD','1')
SetPrivateProfileString('Program Options','Debug Mode','1')
SetPrivateProfileString('Game Options','Cheats','1')
SetPrivateProfileString('MOVIES','BG4LOGO','1')
Expand Down
12 changes: 12 additions & 0 deletions EET/lib/EET_end.tp2
Original file line number Diff line number Diff line change
Expand Up @@ -730,3 +730,15 @@ COPY ~chitin.key~ ~chitin.key~
END
END
BUT_ONLY

//Compatibility with Rough World (installed on BG:EE)
ACTION_IF (FILE_CONTAINS ~WeiDU-BGEE.log~ ~K9ROUGHWORLD\.TP2. #[0-9]+ #7 ~) BEGIN //Fixed Insane Difficulty
COPY_EXISTING_REGEXP GLOB ~.*\.cre~ ~override~
WRITE_LONG 0x10 (THIS | BIT22)
BUT_ONLY
END
ACTION_IF (FILE_CONTAINS ~WeiDU-BGEE.log~ ~K9ROUGHWORLD\.TP2. #[0-9]+ #8 ~) BEGIN //Only Autosaves
COPY_EXISTING_REGEXP GLOB ~.*\.are~ ~override~
WRITE_SHORT 0x0014 (THIS | BIT0)
BUT_ONLY
END
17 changes: 17 additions & 0 deletions EET/lib/prep_2DA.tph
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
//Compatibility with Rough World
ACTION_IF (FILE_CONTAINS ~WeiDU-BGEE.log~ ~K9ROUGHWORLD\.TP2. #[0-9]+ #5 ~) BEGIN //Reputation Rebalanced Component
ACTION_FOR_EACH file IN REPMODST REPSTART REPTXT REPUTATI RMODREP BEGIN
COPY ~EET/temp/2da/%file%.2DA~ ~override~
END
END
ACTION_IF (FILE_CONTAINS ~WeiDU-BGEE.log~ ~K9ROUGHWORLD\.TP2. #[0-9]+ #4 ~) BEGIN //New Reputation Names Component
COPY_EXISTING ~REPTXT.2DA~ ~override~
COUNT_2DA_ROWS 2 "cntrow"
FOR (cnt = 1; cnt < cntrow; cnt = cnt + 1) BEGIN
READ_2DA_ENTRY cnt 1 2 "strref"
LPF ~EET_strref~ INT_VAR str = strref RET str END
SET_2DA_ENTRY cnt 1 2 ~%str%~
END
BUT_ONLY
END

//read during installation
ACTION_FOR_EACH file IN
ABCLASRQ
Expand Down
1 change: 1 addition & 0 deletions EET/tbl/compatibility.tbl
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ DRAKE 0 //Drake NPC Mod for BG:EE
NEERA 0 //Neera Expansion
NEERABANTERS 0 //Neera Banters
BG1UB 1 //BG1 Unfinished Business
K9ROUGHWORLD 0 //Rough World

0 comments on commit 0273997

Please sign in to comment.