From f4763bd4a228dd8e69de89d3d90f1d33350fc93f Mon Sep 17 00:00:00 2001 From: Lwmte <3331699+Lwmte@users.noreply.github.com> Date: Sun, 15 Dec 2024 19:24:49 +0300 Subject: [PATCH] Customize global hardcoded parameters (#1495) * Initial commit * Update CHANGELOG.md * Tint flare smoke * Expose GetCustomizations * Added lensflare and flicker customization options for flare * Update LensFlare.cpp * Remove unnecessary code * Update lara_flare.cpp * Massive refactor to merge animations, settings and customizations * Add HUD customization options * Customize weapons * Fixed flare, renamed recoil to interval, fixed lensflare default * Occlude flare lensflares * Update Settings.cpp * Use alternate damage for lasersight mode * Added hair cust * Fix comment * Fix another comment * Fix link * Fix placeholder table names * Reorganize types * Add missing initializers for hair settings * Added physics cust * Clarify description * Update settings.lua * Update CHANGELOG.md * Add gun smoke, gun shells and ammo pickup counts * Fix naming ambiguity * Remove missing features from documentation * Fix comment * Fix parameter name, change default settings file * Fixed pitch black * Rollback DoDistanceFogForVertex * Add camera cust * Change binocular/lasersight toggle to color * Update lara_basic.cpp * Add time and statistics classes and script API for it * Fix comment * Use DoDamage on Lara helpers to register with statistics * Update Time.cpp * Fix documentation * Fix default flare timeout * Update Settings.lua * Add flare muzzle offset customization * Remove young Lara limitations * Fix lasersight color * Push full settings.lua * Update RendererCompatibility.cpp * Allow to customize root meshes, decopypaste hair and joint init code * Added sol Time operator overloads * Some changes to docs, add meaningful error for unknown fields * Use existing new index template, add gunflash color settings, add shotgun muzzle * Remove excessive usage of GetSettings() * Cleanups * Update Settings.lua * Clarify parameter name * Fix InitializeWeaponInfo * PR review code tidying * Fix bad merge * Update FlowHandler.cpp * Remove tabs for LDoc comments * Use different comment style to preserve formatting * Update lara_fire.cpp * Some cleanups * Fixed GetTimeUnits * Fix typo * Update Time.cpp --------- Co-authored-by: Sezz --- CHANGELOG.md | 4 +- Documentation/config.ld | 2 +- Documentation/doc/1 modules/Effects.html | 21 +- Documentation/doc/1 modules/Flow.html | 129 +- Documentation/doc/1 modules/Input.html | 21 +- Documentation/doc/1 modules/Inventory.html | 21 +- Documentation/doc/1 modules/Logic.html | 21 +- Documentation/doc/1 modules/Objects.html | 21 +- Documentation/doc/1 modules/Sound.html | 21 +- Documentation/doc/1 modules/Strings.html | 21 +- Documentation/doc/1 modules/Util.html | 21 +- Documentation/doc/1 modules/View.html | 21 +- Documentation/doc/2 classes/Flow.Level.html | 49 +- .../doc/2 classes/Flow.Settings.html | 1162 ++++++++++++++++- .../doc/2 classes/Objects.AIObject.html | 21 +- .../doc/2 classes/Objects.Camera.html | 21 +- .../doc/2 classes/Objects.LaraObject.html | 43 +- .../doc/2 classes/Objects.Moveable.html | 21 +- Documentation/doc/2 classes/Objects.Room.html | 21 +- Documentation/doc/2 classes/Objects.Sink.html | 21 +- .../doc/2 classes/Objects.SoundSource.html | 21 +- .../doc/2 classes/Objects.Static.html | 21 +- .../doc/2 classes/Objects.Volume.html | 21 +- .../doc/2 classes/Strings.DisplayString.html | 21 +- .../doc/2 classes/View.DisplaySprite.html | 21 +- .../doc/3 primitive classes/Color.html | 21 +- .../Flow.Fog.html | 25 +- .../Flow.InventoryItem.html | 25 +- .../Flow.LensFlare.html | 27 +- .../Flow.Mirror.html | 23 +- .../Flow.SkyLayer.html | 25 +- .../Flow.Starfield.html | 27 +- .../3 primitive classes/Flow.Statistics.html | 335 +++++ .../doc/3 primitive classes/Rotation.html | 21 +- .../doc/3 primitive classes/Time.html | 423 ++++++ .../doc/3 primitive classes/Vec2.html | 39 +- .../doc/3 primitive classes/Vec3.html | 39 +- .../doc/4 enums/Effects.BlendID.html | 27 +- .../doc/4 enums/Effects.EffectID.html | 27 +- Documentation/doc/4 enums/Flow.ErrorMode.html | 174 +++ .../doc/4 enums/Flow.FreezeMode.html | 43 +- .../doc/4 enums/Flow.GameStatus.html | 35 +- .../Flow.WeaponType.html} | 71 +- Documentation/doc/4 enums/Input.ActionID.html | 27 +- .../doc/4 enums/Objects.AmmoType.html | 27 +- .../doc/4 enums/Objects.MoveableStatus.html | 27 +- Documentation/doc/4 enums/Objects.ObjID.html | 21 +- .../doc/4 enums/Objects.RoomFlagID.html | 27 +- .../doc/4 enums/Objects.RoomReverb.html | 27 +- .../doc/4 enums/Sound.SoundTrackType.html | 27 +- .../4 enums/Strings.DisplayStringOption.html | 21 +- Documentation/doc/4 enums/Util.LogLevel.html | 27 +- Documentation/doc/4 enums/View.AlignMode.html | 37 +- .../doc/4 enums/View.CameraType.html | 27 +- .../doc/4 enums/View.PostProcessMode.html | 27 +- Documentation/doc/4 enums/View.ScaleMode.html | 37 +- .../5 lua utility modules/EventSequence.html | 21 +- .../doc/5 lua utility modules/Timer.html | 21 +- Documentation/doc/index.html | 99 +- Scripts/Settings.lua | 154 ++- Scripts/SystemStrings.lua | 2 +- TombEngine/Game/Hud/PickupSummary.cpp | 4 + TombEngine/Game/Hud/Speedometer.cpp | 6 +- TombEngine/Game/Hud/StatusBars.cpp | 7 +- TombEngine/Game/Lara/PlayerContext.cpp | 14 +- TombEngine/Game/Lara/lara.cpp | 4 +- TombEngine/Game/Lara/lara.h | 11 +- TombEngine/Game/Lara/lara_basic.cpp | 4 +- TombEngine/Game/Lara/lara_cheat.cpp | 11 +- TombEngine/Game/Lara/lara_collide.cpp | 2 +- TombEngine/Game/Lara/lara_fire.cpp | 26 +- TombEngine/Game/Lara/lara_fire.h | 6 +- TombEngine/Game/Lara/lara_flare.cpp | 95 +- TombEngine/Game/Lara/lara_flare.h | 2 +- TombEngine/Game/Lara/lara_helpers.cpp | 31 +- TombEngine/Game/Lara/lara_jump.cpp | 4 +- TombEngine/Game/Lara/lara_one_gun.cpp | 57 +- TombEngine/Game/Lara/lara_one_gun.h | 2 +- TombEngine/Game/Lara/lara_overhang.cpp | 10 +- TombEngine/Game/Lara/lara_slide.cpp | 5 +- TombEngine/Game/Lara/lara_surface.cpp | 35 +- TombEngine/Game/Lara/lara_swim.cpp | 18 +- TombEngine/Game/Lara/lara_tests.cpp | 12 +- TombEngine/Game/Lara/lara_two_guns.cpp | 11 +- TombEngine/Game/Setup.h | 2 - TombEngine/Game/animation.cpp | 3 +- TombEngine/Game/camera.cpp | 5 +- TombEngine/Game/control/control.cpp | 5 +- TombEngine/Game/control/control.h | 1 - TombEngine/Game/control/los.cpp | 10 +- TombEngine/Game/control/trigger.cpp | 5 +- TombEngine/Game/control/volume.cpp | 10 +- TombEngine/Game/effects/chaffFX.cpp | 24 +- TombEngine/Game/effects/debris.cpp | 5 +- TombEngine/Game/effects/drip.cpp | 16 +- TombEngine/Game/effects/hair.cpp | 42 +- TombEngine/Game/effects/hair.h | 15 +- TombEngine/Game/effects/item_fx.cpp | 2 +- TombEngine/Game/effects/item_fx.h | 3 +- TombEngine/Game/effects/smoke.cpp | 6 +- TombEngine/Game/effects/tomb4fx.cpp | 87 +- TombEngine/Game/effects/tomb4fx.h | 6 - TombEngine/Game/gui.cpp | 333 ++--- TombEngine/Game/items.cpp | 27 +- TombEngine/Game/items.h | 2 +- TombEngine/Game/pickup/pickup.cpp | 2 +- TombEngine/Game/pickup/pickup_ammo.cpp | 58 +- TombEngine/Game/pickup/pickup_ammo.h | 3 + TombEngine/Game/pickup/pickup_consumable.cpp | 45 +- TombEngine/Game/pickup/pickup_consumable.h | 3 + TombEngine/Game/savegame.cpp | 29 +- TombEngine/Game/savegame.h | 22 +- TombEngine/Objects/Effects/LensFlare.cpp | 22 +- TombEngine/Objects/Effects/LensFlare.h | 3 + .../Object/Pushable/PushableEffects.cpp | 10 +- .../Objects/Generic/Object/burning_torch.cpp | 21 +- .../Objects/Generic/Object/burning_torch.h | 2 +- TombEngine/Objects/Generic/Object/rope.cpp | 3 +- TombEngine/Objects/TR1/Trap/DamoclesSword.cpp | 3 +- TombEngine/Objects/TR2/Vehicles/skidoo.cpp | 5 +- TombEngine/Objects/TR2/Vehicles/speedboat.cpp | 5 +- TombEngine/Objects/TR3/Entity/SophiaLeigh.cpp | 2 +- TombEngine/Objects/TR3/Object/corpse.cpp | 3 +- TombEngine/Objects/TR3/Vehicles/kayak.cpp | 3 +- TombEngine/Objects/TR3/Vehicles/quad_bike.cpp | 5 +- .../Objects/TR3/Vehicles/rubber_boat.cpp | 5 +- .../Objects/TR4/Entity/tr4_beetle_swarm.cpp | 5 +- TombEngine/Objects/TR4/Vehicles/jeep.cpp | 7 +- TombEngine/Objects/TR4/Vehicles/motorbike.cpp | 16 +- .../Objects/TR5/Emitter/tr5_rats_emitter.cpp | 3 +- .../TR5/Emitter/tr5_spider_emitter.cpp | 3 +- .../Objects/TR5/Entity/tr5_submarine.cpp | 5 +- .../Objects/TR5/Object/tr5_bodypart.cpp | 3 +- .../Objects/TR5/Object/tr5_rollingball.cpp | 3 +- TombEngine/Objects/TR5/Trap/tr5_explosion.cpp | 2 +- .../Objects/TR5/Trap/tr5_wreckingball.cpp | 3 +- TombEngine/Renderer/RendererCompatibility.cpp | 215 +-- TombEngine/Renderer/RendererDraw2D.cpp | 4 + TombEngine/Renderer/RendererDrawEffect.cpp | 24 +- TombEngine/Renderer/RendererDrawMenu.cpp | 6 +- TombEngine/Renderer/RendererLara.cpp | 2 +- .../Include/Flow/ScriptInterfaceFlowHandler.h | 9 - .../Scripting/Include/Strings/StringsCommon.h | 2 +- .../Scripting/Internal/ReservedScriptNames.h | 18 +- TombEngine/Scripting/Internal/ScriptAssert.h | 1 - TombEngine/Scripting/Internal/ScriptUtil.h | 3 + .../Scripting/Internal/TEN/Effects/BlendIDs.h | 2 +- .../Internal/TEN/Effects/EffectIDs.h | 2 +- .../Internal/TEN/Effects/EffectsFunctions.cpp | 6 +- .../TEN/Flow/Animations/Animations.cpp | 26 - .../Internal/TEN/Flow/Animations/Animations.h | 26 - .../Internal/TEN/Flow/Enums/ErrorModes.h | 42 + .../Internal/TEN/Flow/Enums/FreezeModes.h | 56 +- .../Internal/TEN/Flow/Enums/GameStatuses.h | 70 +- .../Internal/TEN/Flow/Enums/WeaponTypes.h | 53 + .../Internal/TEN/Flow/FlowHandler.cpp | 123 +- .../Scripting/Internal/TEN/Flow/FlowHandler.h | 29 +- .../Scripting/Internal/TEN/Flow/Fog/Fog.cpp | 2 +- .../Scripting/Internal/TEN/Flow/Fog/Fog.h | 2 +- .../TEN/Flow/InventoryItem/InventoryItem.cpp | 2 +- .../TEN/Flow/InventoryItem/InventoryItem.h | 7 +- .../Internal/TEN/Flow/LensFlare/LensFlare.cpp | 8 +- .../Internal/TEN/Flow/LensFlare/LensFlare.h | 4 +- .../Internal/TEN/Flow/Mirror/Mirror.cpp | 2 +- .../Internal/TEN/Flow/Settings/Settings.cpp | 358 ++++- .../Internal/TEN/Flow/Settings/Settings.h | 129 +- .../Internal/TEN/Flow/SkyLayer/SkyLayer.cpp | 2 +- .../Internal/TEN/Flow/SkyLayer/SkyLayer.h | 2 +- .../Internal/TEN/Flow/Starfield/Starfield.cpp | 2 +- .../TEN/Flow/Statistics/Statistics.cpp | 63 + .../Internal/TEN/Flow/Statistics/Statistics.h | 22 + .../Scripting/Internal/TEN/Input/ActionIDs.h | 2 +- .../Internal/TEN/Input/InputHandler.cpp | 2 +- .../Internal/TEN/Logic/LogicHandler.cpp | 10 +- .../TEN/Objects/AIObject/AIObject.cpp | 11 +- .../TEN/Objects/Camera/CameraObject.cpp | 2 +- .../Internal/TEN/Objects/Lara/AmmoTypes.h | 2 +- .../Internal/TEN/Objects/Lara/LaraObject.cpp | 21 +- .../TEN/Objects/Moveable/MoveableObject.cpp | 8 +- .../TEN/Objects/Moveable/MoveableObject.h | 6 +- .../TEN/Objects/Moveable/MoveableStatuses.h | 2 +- .../Internal/TEN/Objects/Room/RoomFlags.h | 2 +- .../Internal/TEN/Objects/Room/RoomObject.cpp | 4 +- .../TEN/Objects/Room/RoomReverbTypes.h | 2 +- .../Internal/TEN/Objects/Sink/SinkObject.cpp | 2 +- .../Objects/SoundSource/SoundSourceObject.cpp | 3 +- .../TEN/Objects/Static/StaticObject.cpp | 14 +- .../TEN/Objects/Static/StaticObject.h | 13 +- .../TEN/Objects/Volume/VolumeObject.cpp | 4 +- .../TEN/Objects/Volume/VolumeObject.h | 15 +- .../Internal/TEN/Rotation/Rotation.cpp | 110 -- .../Internal/TEN/Rotation/Rotation.h | 35 - .../Internal/TEN/Sound/SoundHandler.cpp | 2 +- .../Internal/TEN/Sound/SoundTrackTypes.h | 2 +- .../Strings/DisplayString/DisplayString.cpp | 6 +- .../TEN/Strings/DisplayString/DisplayString.h | 4 +- .../Internal/TEN/{ => Types}/Color/Color.cpp | 2 +- .../Internal/TEN/{ => Types}/Color/Color.h | 0 .../Internal/TEN/Types/Rotation/Rotation.cpp | 113 ++ .../Internal/TEN/Types/Rotation/Rotation.h | 40 + .../Internal/TEN/Types/Time/Time.cpp | 293 +++++ .../Scripting/Internal/TEN/Types/Time/Time.h | 76 ++ .../Internal/TEN/{ => Types}/Vec2/Vec2.cpp | 20 +- .../Internal/TEN/{ => Types}/Vec2/Vec2.h | 0 .../Internal/TEN/{ => Types}/Vec3/Vec3.cpp | 22 +- .../Internal/TEN/{ => Types}/Vec3/Vec3.h | 6 +- .../Scripting/Internal/TEN/Util/LevelLog.h | 2 +- .../Scripting/Internal/TEN/Util/Util.cpp | 4 +- .../Scripting/Internal/TEN/View/AlignModes.h | 44 +- .../Scripting/Internal/TEN/View/CameraTypes.h | 2 +- .../DisplaySprite/ScriptDisplaySprite.cpp | 6 +- .../DisplaySprite/ScriptDisplaySprite.h | 4 +- .../Internal/TEN/View/PostProcessEffects.h | 2 +- .../Scripting/Internal/TEN/View/ScaleModes.h | 31 +- .../Internal/TEN/View/ViewHandler.cpp | 6 +- TombEngine/Specific/clock.cpp | 12 - TombEngine/Specific/clock.h | 14 +- TombEngine/Specific/level.cpp | 3 +- .../flatbuffers/ten_savegame_generated.h | 174 +-- .../Specific/savegame/schema/ten_savegame.fbs | 3 +- TombEngine/TombEngine.vcxproj | 32 +- TombEngine/framework.h | 1 + TombEngine/version.h | 4 +- 223 files changed, 5585 insertions(+), 2080 deletions(-) rename Documentation/doc/{2 classes => 3 primitive classes}/Flow.Fog.html (88%) rename Documentation/doc/{2 classes => 3 primitive classes}/Flow.InventoryItem.html (89%) rename Documentation/doc/{2 classes => 3 primitive classes}/Flow.LensFlare.html (90%) rename Documentation/doc/{2 classes => 3 primitive classes}/Flow.Mirror.html (85%) rename Documentation/doc/{2 classes => 3 primitive classes}/Flow.SkyLayer.html (88%) rename Documentation/doc/{2 classes => 3 primitive classes}/Flow.Starfield.html (91%) create mode 100644 Documentation/doc/3 primitive classes/Flow.Statistics.html create mode 100644 Documentation/doc/3 primitive classes/Time.html create mode 100644 Documentation/doc/4 enums/Flow.ErrorMode.html rename Documentation/doc/{2 classes/Flow.Animations.html => 4 enums/Flow.WeaponType.html} (68%) delete mode 100644 TombEngine/Scripting/Internal/TEN/Flow/Animations/Animations.cpp delete mode 100644 TombEngine/Scripting/Internal/TEN/Flow/Animations/Animations.h create mode 100644 TombEngine/Scripting/Internal/TEN/Flow/Enums/ErrorModes.h create mode 100644 TombEngine/Scripting/Internal/TEN/Flow/Enums/WeaponTypes.h create mode 100644 TombEngine/Scripting/Internal/TEN/Flow/Statistics/Statistics.cpp create mode 100644 TombEngine/Scripting/Internal/TEN/Flow/Statistics/Statistics.h delete mode 100644 TombEngine/Scripting/Internal/TEN/Rotation/Rotation.cpp delete mode 100644 TombEngine/Scripting/Internal/TEN/Rotation/Rotation.h rename TombEngine/Scripting/Internal/TEN/{ => Types}/Color/Color.cpp (98%) rename TombEngine/Scripting/Internal/TEN/{ => Types}/Color/Color.h (100%) create mode 100644 TombEngine/Scripting/Internal/TEN/Types/Rotation/Rotation.cpp create mode 100644 TombEngine/Scripting/Internal/TEN/Types/Rotation/Rotation.h create mode 100644 TombEngine/Scripting/Internal/TEN/Types/Time/Time.cpp create mode 100644 TombEngine/Scripting/Internal/TEN/Types/Time/Time.h rename TombEngine/Scripting/Internal/TEN/{ => Types}/Vec2/Vec2.cpp (94%) rename TombEngine/Scripting/Internal/TEN/{ => Types}/Vec2/Vec2.h (100%) rename TombEngine/Scripting/Internal/TEN/{ => Types}/Vec3/Vec3.cpp (93%) rename TombEngine/Scripting/Internal/TEN/{ => Types}/Vec3/Vec3.h (94%) rename TombEngine/Scripting/Internal/TEN/{ => View}/DisplaySprite/ScriptDisplaySprite.cpp (97%) rename TombEngine/Scripting/Internal/TEN/{ => View}/DisplaySprite/ScriptDisplaySprite.h (93%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6be8161c8..e68c95faf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,7 @@ TombEngine releases are located in this repository (alongside with Tomb Editor): ### New Features * Added fast savegame reloading. +* Added ability to customize many hardcoded parameters, such as flare, weapon, and hair settings. * Added dynamic shadow casting on objects and static meshes. * Added ricochet sounds and make the effect more prominent. * Allow camera shake during flybys. @@ -48,12 +49,13 @@ TombEngine releases are located in this repository (alongside with Tomb Editor): * Allow more than 1000 static mesh slots in a level. ### Lua API changes -* Added Moveable:GetCollidable() and Moveable:SetCollidable() functions. +* Added Flow.Statistics class, Flow.GetStatistics() and Flow.SetStatistics() functions. * Added Flow.GetFreezeMode() and Flow.SetFreezeMode() functions. * Added Flow.GetNextLevel() function to get script entry for incoming level, if it's about to start. * Added Effects.EmitSpotLight() function for directional spotlights. * Added optional cast shadow and name parameters for Effects.EmitLight() function. * Added Effects.GetWind() function to get current wind speed vector. +* Added Moveable:GetCollidable() and Moveable:SetCollidable() functions. * Added Rotation:Direction() method to get directional vector. * Added support for transparency value in DisplayString class. * Added extra argument for SetAmbientTrack() function to specify if new ambient track should play from the beginning. diff --git a/Documentation/config.ld b/Documentation/config.ld index 654c3df26..827cf2d1e 100644 --- a/Documentation/config.ld +++ b/Documentation/config.ld @@ -13,7 +13,7 @@ new_type("luautil", "5 Lua utility modules", true) not_luadoc = true local version = "1.6" -project = "TombEngine" +project = " TombEngine" title = "TombEngine " .. version .. " Lua API" description = "TombEngine " .. version .. " scripting interface" full_description = [[Welcome to the TombEngine scripting API. This is a work in progress and some information might be wrong or outdated. Please also note that this is primarily a reference document, not a tutorial, so expect descriptions to be fairly sparse. diff --git a/Documentation/doc/1 modules/Effects.html b/Documentation/doc/1 modules/Effects.html index e1c3b28bb..2602a7f62 100644 --- a/Documentation/doc/1 modules/Effects.html +++ b/Documentation/doc/1 modules/Effects.html @@ -24,7 +24,7 @@