TombEngine/Scripts/Gameflow.lua

135 lines
2.7 KiB
Lua
Raw Permalink Normal View History

-- Place in this Lua script all the levels of your game
-- Title is mandatory and must be the first level.
2022-08-16 13:21:57 +03:00
-- Intro image is a splash screen which appears before actual loading screen.
-- If you don't want it to appear, just remove this line.
2022-08-06 17:38:35 +03:00
Flow.SetIntroImagePath("Screens\\main.jpg")
2022-08-16 13:21:57 +03:00
Video playback (#1625) * Work * Work * Update Video.cpp * Update Video.cpp * Update Video.cpp * Update Video.cpp * Update Video.cpp * Working playback * Update Video.cpp * Cleanups * Additions * Update Video.cpp * Formatting * Correct pausing/resuming * Remove .mov extension, as it's not supported * Use vector instead of array * Implement SetIntroVideoPath * Swap intro image and intro video to better reflect original legal sequence * Update Gameflow.lua * Simplify synchronization with VLC thread * Use Vector2i for sizes, only fetch video dimensions once * Rename callbacks, move logging callback to a class * Update Video.cpp * Update CHANGELOG.md * Removed empty OnDisplayFrame event * Rename * Stop video player if user pressed Alt+F4 * Allow background video playback * Update Video.cpp * Update Video.cpp * Fixed init errors * Restore .mov default extension for video playback * Update RendererDraw2D.cpp * Add video streaming for rectangular faces of room geometry * Remove magic and use normalized UVs instead * Use VIDEO_SPRITE_ID instead of NO_VALUE * Added more scripting API functions for video playback * Correct variable names * Shorten notification * Add GetVideoDominantColor * Do proper cleanup when alt+F4ing during video playback * Change game loop deinit to avoid several issues with cleaning up * Organise `VideoHandler` class * Randomize glow angle * Update comment * Update Video.cpp * Update Video.cpp * Fix issues with frame drops in exclusive mode * Optimize CPU usage in exclusive mode --------- Co-authored-by: Sezz <sezzary@outlook.com>
2025-04-20 22:06:07 +03:00
-- Intro video plays right after or instead of intro image, if specified.
-- If you don't want it to appear, just remove this line.
--Flow.SetIntroVideoPath("FMV\\core.mp4")
2022-11-03 07:43:04 +02:00
-- Set overall amount of secrets in game.
-- If set to 0, secrets won't be displayed in statistics.
Flow.SetTotalSecretCount(5)
2022-11-03 07:43:04 +02:00
2023-11-06 03:59:31 +01:00
-- Enable/Disable Point Filter (square, unsmoothed pixels).
2023-09-06 12:16:59 +01:00
Flow.EnablePointFilter(false)
2023-09-25 11:10:06 +01:00
-- Enable/Disable saving and loading of savegames.
Flow.EnableLoadSave(true)
-- Disable/enable flycheat globally
Flow.EnableFlyCheat(true)
2022-08-04 05:23:56 +03:00
-- Disable/enable Lara drawing in title level
Flow.EnableLaraInTitle(false)
-- Disable/enable level selection in title level
2023-01-28 22:02:29 +02:00
Flow.EnableLevelSelect(true)
-- Disable/enable mass pickup (collect all pickups at once)
Flow.EnableMassPickup(true)
--------------------------------------------------
2022-08-04 05:23:56 +03:00
-- Title level
2021-12-01 15:31:39 +03:00
2022-08-04 05:23:56 +03:00
title = Level.new()
2021-12-01 15:31:39 +03:00
2022-08-04 20:06:28 +03:00
title.ambientTrack = "108"
2022-08-04 05:23:56 +03:00
title.levelFile = "Data\\title.ten"
2024-01-06 13:36:18 +01:00
title.scriptFile = "Scripts\\Levels\\title.lua"
2022-08-04 05:23:56 +03:00
title.loadScreenFile = "Screens\\Main.png"
2021-12-01 15:31:39 +03:00
2022-08-04 05:23:56 +03:00
Flow.AddLevel(title)
2021-12-01 15:31:39 +03:00
--------------------------------------------------
2022-08-04 05:23:56 +03:00
-- First test level
2022-08-04 05:23:56 +03:00
test = Level.new()
2021-12-01 15:31:39 +03:00
2022-08-04 20:06:28 +03:00
test.nameKey = "level_test"
2024-01-06 13:36:18 +01:00
test.scriptFile = "Scripts\\Levels\\New_Level.lua"
2022-08-04 20:06:28 +03:00
test.ambientTrack = "108"
Mirrors (#1519) * WIP TR4 style mirrors * Fixed broken previous commit * Added debris and effects drawing in mirrored rooms; Some optimizations for early skip non mirrored items; * Implemented mirrors in file format * Use default argument value for ReadCount * Use emplace_back and camera room number * Fixed items culling in mirror rooms; Changed file format for having also virtual room; * Cached reflection matrix of mirrors at load time; Fixed lighting in mirrored items; Added bad cull mode after mirrore debrises drawing; Added mirroring of dynamic lights; * Fixed ambient occlusion in mirrored rooms * Fixed random statics positions while shooting * Added logic for hiding selectively reflecting moveables and statics; Added enabled flag for disabling mirrros in the future with LUA; * Simplify renderer code, remove excessive if statements * Update level.cpp * Decopypaste more mirror-related code * More decopypasting, rename inline function, remove unneeded arg * Remove unnecessary inline, dont reflect room lights * Fixed billboards, reintroduce ReflectVectorOptionally * Fixed dynamic lights * Update RendererDraw.cpp * Fixed 3D sprites mirroring * Draw reflections also when Lara is in any of mirrored rooms, not only camera * Remove unrelated changes * Remove lambdas * Rename fields for consistency * Reorganize renderer code a little * Rename * Spawn mirrored dynamic lights in Lara rooms too * Update RendererDraw.cpp * Add option to reflect sprites * Update CHANGELOG.md * Fixed mirrors on savegame reloading * Fix Lara not mirroring when using binoculars * Continuation of previous fix * Fixed 3D non-sorted sprites mirroring * Fixed various binocular / lasersight issues * Fix meshswap, if object is not present * Don't perform binocular animations if binocular meshswap is not present * Rename CamOldPos and use more consistent type for it * Update title.bin * Fixed #1521 * Fixed #1522 * Interpolate Lara flare light, hide target highlighters in binos * Fix #1525 * Fixed postprocessing order and precompile shaders to speed-up loading * Fixed #1524 * Fixed silent crash if several Lara objects are present in level near dynamic light with shadow * Implement proper soft shadows * Disable self-shadowing for now, as it's causing visual glitches * Update RendererInit.cpp * Update CHANGELOG.md * Update CHANGELOG.md * Formatting pass * Revert "Formatting pass" This reverts commit 88a8ba24dea9cf7006920c8d7a52b6d047f6d749. * Reapply "Formatting pass" This reverts commit becd24da93a2eb33bf78b9be97f6dc6b25d6e744. * Update RendererFrame.cpp * Final formatting pass --------- Co-authored-by: MontyTRC89 <montyhammet@hotmail.it> Co-authored-by: Jakub <80340234+Jakub768@users.noreply.github.com> Co-authored-by: Sezz <sezzary@outlook.com>
2024-12-25 11:21:07 +03:00
test.levelFile = "Data\\Tut1_water.ten"
2022-08-04 05:23:56 +03:00
test.loadScreenFile = "Screens\\rome.jpg"
-- 0 is no weather, 1 is rain, 2 is snow.
-- Strength varies from 0 to 1 (floating-point value, e.g. 0.5 means half-strength).
2022-08-04 05:23:56 +03:00
test.weather = 0
test.weatherStrength = 1
2021-12-01 15:31:39 +03:00
test.horizon = true
2022-08-04 20:06:28 +03:00
test.farView = 20
test.layer1 = Flow.SkyLayer.new(Color.new(255, 0, 0), 15)
2022-08-04 20:06:28 +03:00
test.fog = Flow.Fog.new(Color.new(0, 0, 0), 12, 20)
2021-12-01 15:31:39 +03:00
-- Presets for inventory item placement.
2021-12-01 15:31:39 +03:00
test.objects = {
InventoryItem.new(
2021-12-01 15:31:39 +03:00
"tut1_ba_cartouche1",
ObjID.PUZZLE_ITEM3_COMBO1,
2021-12-01 15:31:39 +03:00
0,
0.5,
Rotation.new(0, 0, 0),
RotationAxis.Y,
-1,
ItemAction.USE
),
InventoryItem.new(
2021-12-01 15:31:39 +03:00
"tut1_ba_cartouche2",
ObjID.PUZZLE_ITEM3_COMBO2,
2021-12-01 15:31:39 +03:00
0,
0.5,
Rotation.new(0, 0, 0),
RotationAxis.Y,
-1,
ItemAction.USE
),
InventoryItem.new(
2021-12-01 15:31:39 +03:00
"tut1_ba_cartouche",
ObjID.PUZZLE_ITEM3,
2021-12-01 15:31:39 +03:00
0,
0.5,
Rotation.new(0, 0, 0),
RotationAxis.Y,
-1,
ItemAction.USE
),
InventoryItem.new(
2021-12-01 15:31:39 +03:00
"tut1_hand_orion",
ObjID.PUZZLE_ITEM6,
2021-12-01 15:31:39 +03:00
0,
0.5,
Rotation.new(270, 180, 0),
RotationAxis.Y,
-1,
ItemAction.USE
),
InventoryItem.new(
2021-12-01 15:31:39 +03:00
"tut1_hand_sirius",
ObjID.PUZZLE_ITEM8,
2021-12-01 15:31:39 +03:00
0,
0.5,
Rotation.new(270, 180, 0),
RotationAxis.X,
-1,
ItemAction.USE
)
2022-08-04 05:23:56 +03:00
}
2021-12-01 15:31:39 +03:00
Flow.AddLevel(test)