diff --git a/cdtweaks/languages/english/weidu.tra b/cdtweaks/languages/english/weidu.tra index 06daf4ee..4046f4c7 100644 --- a/cdtweaks/languages/english/weidu.tra +++ b/cdtweaks/languages/english/weidu.tra @@ -719,6 +719,8 @@ Use Baldur.lua options: a7_interval_ini @341100 = ~Mage, priest, and innate spells only~ @341200 = ~All spells (check readme)~ +@344000 = ~Dynamic FPS Change [Luke (EEex)]~ + /////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\ /////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\ ///// \\\\\ diff --git a/cdtweaks/languages/italian/weidu.tra b/cdtweaks/languages/italian/weidu.tra index 738ea95a..bb4aad29 100644 --- a/cdtweaks/languages/italian/weidu.tra +++ b/cdtweaks/languages/italian/weidu.tra @@ -649,6 +649,8 @@ Usa opzioni di Baldur.lua: a7_interval_ini @336000 = ~Ripristina la nebbia di guerra nei sotterranei di Sigil~ +@344000 = ~Regola in modo automatico gli FPS [Luke (EEex)]~ + /////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\ /////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\ ///// \\\\\ diff --git a/cdtweaks/lib/comp_3440.tpa b/cdtweaks/lib/comp_3440.tpa new file mode 100644 index 00000000..e5c9956e --- /dev/null +++ b/cdtweaks/lib/comp_3440.tpa @@ -0,0 +1,14 @@ +/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\////\\\\//// +/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\////\\\\//// +///// \\\\\////\\\\//// +///// Dynamic FPS change \\\\\ +///// \\\\\////\\\\//// +/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\////\\\\//// +/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\////\\\\//// + +WITH_SCOPE BEGIN + INCLUDE "cdtweaks\luke\misc.tph" + // + INCLUDE "cdtweaks\lib\dynamic_fps_change.tph" + LAF "DYNAMIC_FPS_CHANGE" END +END \ No newline at end of file diff --git a/cdtweaks/lib/dynamic_fps_change.tph b/cdtweaks/lib/dynamic_fps_change.tph new file mode 100644 index 00000000..1391d5e8 --- /dev/null +++ b/cdtweaks/lib/dynamic_fps_change.tph @@ -0,0 +1,20 @@ +DEFINE_ACTION_FUNCTION "DYNAMIC_FPS_CHANGE" +BEGIN + LAF "APPEND_LUA_FUNCTION" STR_VAR "description" = "Misc Tweaks" "sourceFileSpec" = "cdtweaks\luke\lua\tweaks\dynamic_fps_change.lua" "destRes" = "m_gttwks" END + // + <<<<<<<< .../cdtweaks-inlined/dynamic_fps_change.baf + IF + True() + THEN + RESPONSE #100 + EEex_LuaAction("cdtweaks_DynamicFPSChange()") + Continue() + END + >>>>>>>> + // + ACTION_FOR_EACH "world_script" IN "baldur" "baldur25" "bdbaldur" BEGIN + ACTION_IF (FILE_EXISTS_IN_GAME "%world_script%.bcs") BEGIN + EXTEND_TOP "%world_script%.bcs" ".../cdtweaks-inlined/dynamic_fps_change.baf" + END + END +END \ No newline at end of file diff --git a/cdtweaks/luke/lua/tweaks/dynamic_fps_change.lua b/cdtweaks/luke/lua/tweaks/dynamic_fps_change.lua new file mode 100644 index 00000000..d60ef2ca --- /dev/null +++ b/cdtweaks/luke/lua/tweaks/dynamic_fps_change.lua @@ -0,0 +1,41 @@ +--[[ ++-------------------------------------------------------+ +| cdtweaks: automatically change FPS during playthrough | ++-------------------------------------------------------+ +--]] + +-- When in cutscene, lock FPS to 30 -- + +EEex_Opcode_AddListsResolvedListener(function(sprite) + -- Sanity check + if not EEex_GameObject_IsSprite(sprite) then + return + end + -- + if sprite.m_inCutScene == 1 then + if EEex_CChitin.TIMER_UPDATES_PER_SECOND ~= 30 then + EEex_CChitin.TIMER_UPDATES_PER_SECOND = 30 + end + end +end) + +-- When in combat, lock FPS to 30. Otherwise, set to 60 -- + +function cdtweaks_DynamicFPSChange() + -- [Bubb] Each area has its own combat counter. You can check the global script runner's area in this way... + local globalScriptRunnerId = EngineGlobals.g_pBaldurChitin.m_pObjectGame.m_nAIIndex + local globalScriptRunner = EEex_GameObject_Get(globalScriptRunnerId) + local globalScriptRunnerArea = globalScriptRunner.m_pArea + --local globalScriptRunnerAreaResref = globalScriptRunnerArea and globalScriptRunnerArea.m_resref:get() or "nil" + --Infinity_DisplayString(string.format("Global script runner area resref: \"%s\"", globalScriptRunnerAreaResref)) + -- + if globalScriptRunnerArea.m_nBattleSongCounter > 0 then + if EEex_CChitin.TIMER_UPDATES_PER_SECOND ~= 30 then + EEex_CChitin.TIMER_UPDATES_PER_SECOND = 30 + end + else + if EEex_CChitin.TIMER_UPDATES_PER_SECOND ~= 60 then + EEex_CChitin.TIMER_UPDATES_PER_SECOND = 60 + end + end +end diff --git a/cdtweaks/readme-cdtweaks.html b/cdtweaks/readme-cdtweaks.html index 84c933fc..aeece752 100644 --- a/cdtweaks/readme-cdtweaks.html +++ b/cdtweaks/readme-cdtweaks.html @@ -1361,6 +1361,14 @@

Convenience Tw
  • Mage, priest, and innate spells - as above, but adds spells traditionally in the innate and kit ability space such as Lay on Hands or Boon of Lathander
  • All spells - because the game uses spells to perform a lot of different functions, such as traps or cutscene effects,this option may provide more feedback than desired or expose purely internal spell names such as "just 10 damage". It is, however, the best way to guarantee that all spells from mods are caught
  • + +

    Dynamic FPS Change
    + EEex

    +

    + This component will automatically adjust FPS during playthrough.
    + When in combat or cutscene, will lock FPS to 30. Otherwise, will set them to 60. +

    +

    Joinable NPC Tweaks

    diff --git a/cdtweaks/setup-cdtweaks.tp2 b/cdtweaks/setup-cdtweaks.tp2 index 5e97fb6f..6c027781 100644 --- a/cdtweaks/setup-cdtweaks.tp2 +++ b/cdtweaks/setup-cdtweaks.tp2 @@ -4420,6 +4420,20 @@ GROUP @4 SUBCOMPONENT @341000 LABEL ~cd_tweaks_casting_warnings_all~ +/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\ +/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\ +///// \\\\\ +///// Dynamic FPS Change \\\\\ +///// \\\\\ +/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\ +/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\ + +BEGIN @344000 DESIGNATED 3440 +GROUP @4 +REQUIRE_PREDICATE GAME_IS ~bgee bg2ee eet iwdee~ @25 +REQUIRE_PREDICATE MOD_IS_INSTALLED "EEex.tp2" 0 @29 +LABEL ~cd_tweaks_dynamic_fps_change~ + /////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\ /////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\/////\\\\\ ///// \\\\\