Commit graph

1650 commits

Author SHA1 Message Date
MontyTRC89
dc9b86a375 Added Strings.lua 2021-06-20 06:34:52 +02:00
MontyTRC89
907fce42e7 Added translations support and fixed some bugs with strings 2021-06-20 06:33:44 +02:00
MontyTRC89
a03f30952c Merge branch 'master' into NewLuaScripting
# Conflicts:
#	TR5Main/Scripting/GameFlowScript.cpp
#	TR5Main/Scripting/GameFlowScript.h
2021-06-19 07:20:04 +02:00
MontyTRC89
dfa4740519 Merge conflicts 2021-06-19 07:14:38 +02:00
MontyTRC89
1bb5965157 Moving to stringed keys for game strings 2021-06-19 07:11:22 +02:00
Brad Ellis
3169f0986d Add some missing strings so I can remap controls. These will very likely be replaced when the new strings system is finished. 2021-06-18 02:16:08 +01:00
asasas9500
d5be155d4b Improve expanding platform 2021-06-17 20:13:28 -03:00
wolfcheese
d878cd1c9e Added bridge collision to FALLING_BLOCK 2021-06-16 10:19:46 -04:00
Brad Ellis
eb72b81dcc Add new source files to VS project. 2021-06-16 15:10:25 +01:00
Brad Ellis
fb732fa0d0 Load script data from Lua. 2021-06-16 15:10:05 +01:00
Brad Ellis
b6be46992b GameFlowScript changes:
Remove all code related to reading SCRIPT.DAT.

Include AudioTracks.h, which, I emphasise, is temporary until we start listing audio tracks in Lua.

Hardcode language to English for now.

Add WeatherType and LaraType usertypes. These were in the Lua scripts but weren't connected with their related C++ types.

Name -> NameStringIndex; the latter is what the engine reads, and as far as I can tell, that is what GameFlow.lua is passing.

Add _GameFlow usertype to correspond to the GameFlow class. I don't think this is the perfect way to expose this functionality to Lua, but it will do the job for now.

GameFlow's destructor now deletes its dynamically allocated memory. Note that I haven't fully looked into whether said memory needs to be dynamically allocated; I just new'd GameScriptLevels and LanguageScripts because they were being new'd in the original implementation.
2021-06-16 15:05:10 +01:00
Brad Ellis
9aea1c9ba8 Change string back; I was using this for debugging. 2021-06-16 14:52:30 +01:00
Brad Ellis
8f3f973c5e GameFlowScript changes:
Inherit from LuaHandler.

Remove the SCRIPT.DAT-related code.

Add m_translationsMap which stores strings by key and holds a vector with their translations. The index of a translation corresponds with the index of the language in m_languageNames; e.g. if Italian is at index 2 in m_languageNames, then the Italian translation of a string will be at index 2 in the vector. See GameFlow:SetStrings in English.lua.

Add m_languageNames which stores a vector of language names. See GameFlow:SetLanguageNames in English.lua.

Add WriteDefaults and AddTracks, which is there for data which isn't in Lua scripts yet. It will be removed in the future.

Add AddLevel, which corresponds with GameFlow:AddLevel in Gameflow.lua.

Add LoadGameFlowScript, which loads (for now) Gameflow.lua and English.lua.

Add GetLang, which is to load the old-style strings and which will be removed when the switch to new strings is complete.
2021-06-16 14:51:58 +01:00
Brad Ellis
514a691836 GameLogicScript inherits from LuaHandler now. 2021-06-16 14:39:43 +01:00
Brad Ellis
a435b889a2 Call WriteDefaults and AddTracks. These are temporary things to add the settings which were in SCRIPT.DAT but which have no Lua counterpart yet.
The bool "rain" is now the WeatherType "Weather" to reflect what's in the C++ implementation.

Gameflow -> GameFlow to be consistent with C++.
2021-06-16 14:38:59 +01:00
Brad Ellis
731b7b6f6b Add working demo of new strings system. I believe the plan is that in the future, this will be automatically generated in TombIDE - right now it's only for demonstration purposes.
Gameflow -> GameFlow for consistency with the C++ source.
2021-06-16 14:35:27 +01:00
Brad Ellis
a66ecb7b34 Change Strings to std::unordered_map. This is a temporary thing to work nicely with the current English.lua, and will be removed/replaced/reworked when the new strings system is fully in place. 2021-06-16 14:33:43 +01:00
Brad Ellis
cf0b4d5e7a Add LuaHandler class to hold some repeated functionality between GameFlowScript and GameLogicScript. 2021-06-16 14:32:42 +01:00
Brad Ellis
52fe1655e5 Make hardcoded array of audio names, as they would normally be loaded from SCRIPT.DAT which is being removed - this is only present until a new system is in-place for them. 2021-06-16 14:29:50 +01:00
Brad Ellis
fd7c8362e9 Make const to allow for (temporarily) hardcoded names. 2021-06-16 14:28:08 +01:00
wolfcheese
b87c296986 Missed these from the previous commit 2021-06-15 19:52:39 -04:00
wolfcheese
12c19e01c3 Merge branch 'master' of https://github.com/MontyTRC89/TombEngine 2021-06-15 19:48:53 -04:00
wolfcheese
422ac5dad2 Added checks to raising block, pushable block, floor and ceiling trapdoors to prevent crashing upon load 2021-06-15 19:48:30 -04:00
Trxye
77bc377977 Merge branch 'master' of https://github.com/MontyTRC89/TR5Main 2021-06-15 14:09:56 -05:00
Trxye
6cb971715e diary bs 2021-06-15 14:09:49 -05:00
wolfcheese
d07e134c6a Updates to expanding platform 2021-06-15 10:43:13 -04:00
wolfcheese
f8c28f0836 Added height check to expanding_platform based on its animation 2021-06-13 11:34:46 -04:00
wolfcheese
e97b93e471 Cleaned up code for generic trapdoors 2021-06-12 16:39:13 -04:00
wolfcheese
62643f4c64 Added rudimentary implementation of EXPANDING_PLATFORM 2021-06-11 22:57:58 -04:00
wolfcheese
5324f1629c Merge branch 'master' of https://github.com/montytrc89/tombengine 2021-06-11 12:07:46 -04:00
wolfcheese
2f485c7ef2 Added bridge collision to trapdoor 2021-06-11 12:07:09 -04:00
Trxye
c8a07deedd fix kayak bug again 2021-06-11 11:03:42 -05:00
Trxye
c31a98c9bc move options_table to the inventory list; implement rotation flags 2021-06-11 02:47:23 -05:00
Trxye
0bfedd8466 implement extra pickup items & examines 2021-06-11 01:06:43 -05:00
Trxye
8813790f9a fix pickup display; fix ring inv compile; implement extra puzzle/key items in inventory; 2021-06-10 14:40:28 -05:00
Trxye
add1a9b35b fix compile 2021-06-10 11:36:34 -05:00
Trxye
b3246540e1 Merge branch 'master' of https://github.com/MontyTRC89/TR5Main 2021-06-09 22:48:27 -05:00
Trxye
b35b585cf4 InitialiseObelisk(); some of ObeliskControl() 2021-06-09 22:48:18 -05:00
wolfcheese
015f9d7cc1 Prevent crouching from overriding lasersight 2021-06-09 18:28:25 -04:00
wolfcheese
772568366f Fixed skeleton OCB 3 2021-06-09 12:37:40 -04:00
wolfcheese
0122d57f1d Removed invalid camera from final spline (if snap to lara is not enabled) 2021-06-09 09:15:58 -04:00
wolfcheese
f119f7d836 Beetle's room number was not updating due to low height; added small adjustment to its GetFloor() 2021-06-08 16:04:43 -04:00
MontyTRC89
76c6fa0207 Merge branch 'master' of https://github.com/MontyTRC89/TR5Main 2021-06-08 06:33:00 +02:00
MontyTRC89
06e0742286 Potentially fixed ID_PULLEY 2021-06-08 06:32:51 +02:00
wolfcheese
b7ffc9dcf6 Merge branch 'master' of https://github.com/montytrc89/tombengine 2021-06-07 12:03:59 -04:00
wolfcheese
8413b1980c Twoblockplatform ceiling adjusted to allow tall blocks to enter underneath. GetCollidingObjects no longer finds objects under the colliding item's floor 2021-06-07 12:03:53 -04:00
MontyTRC89
88a0c067aa Merge branch 'master' of https://github.com/MontyTRC89/TR5Main 2021-06-07 16:10:51 +02:00
MontyTRC89
d09b6fe422 Fixed ID_SKELETON immortality 2021-06-07 16:10:43 +02:00
Trxye
307d4ba47a implement inv obj rotations 2021-06-07 04:23:30 -05:00
Trxye
a743bdbba3 Merge branch 'master' of https://github.com/MontyTRC89/TR5Main 2021-06-07 01:24:23 -05:00