Commit graph

1650 commits

Author SHA1 Message Date
hispidence
ead31e63f2 Replace WarningsAsErrors usage with ScriptAssert usage.
For recoverable errors, add some recovery behaviour and logging so a level designer can see in the log what was done as a result of the error.

Warn about default behaviour if no callbacks are added.
2021-08-04 16:51:28 +01:00
hispidence
052b03ec96 Remove AddLuaId and GetItemById. 2021-08-04 16:21:00 +01:00
hispidence
895a7ae025 Add ScriptAssert.
This is to be used when an error is discovered in a Lua Script.

The var ScriptErrorMode refers to the error mode the user has chosen (silent, warn, terminate). At the moment this is hardcoded but will soon become editable to a LD via settings.

ScriptAssert will read this variable and take the appropriate action when an assert is failed.

IGNORE will do nothing (we should make a note in the documentation that this should almost certainly not be used by the LD if they can avoid it).
WARN will call TENLog with LogLevel::Warn.
TERMINATE will throw a TENScriptException, where it will be caught at GameMain, where TENLog will be called.

There are circumstances where we will HAVE to terminate, even if the user has opted not to (i.e. errors where there is nothing sensible that can be done, such as syntax errors that would terminate Lua anyway). For these, we can pass in ERROR_MODE::TERMINATE as the last variable.
2021-08-04 16:18:52 +01:00
Nils
ca583d15ff Added new Sprite Slots for Bars, Binoculars,(Lasersight) and Caustics 2021-08-04 10:21:45 +02:00
Troye
5a4bf3ab2d fix flare cancels (again); use LM_LHAND for torch NodeOffset; remove unused TES_extra_tab; 2021-08-04 01:17:04 -05:00
hispidence
529e8f9a69 Fix indentation. 2021-08-03 15:16:55 +01:00
hispidence
3cd4f02654 Add debug.cpp to the project. 2021-08-03 15:16:23 +01:00
hispidence
2e3a845aa4 Rename GameScriptSettings to Settings on the Lua side. 2021-08-03 15:16:06 +01:00
hispidence
fde79b4704 Replace std::runtime_exception with TENScriptException. 2021-08-03 15:15:42 +01:00
hispidence
19c776588f Wrap GameMain in a try-catch that catches TENScriptException. Any unhandled exception should be caught here and logged. 2021-08-03 15:14:24 +01:00
hispidence
58a424e52f Change ExecuteScript and ExecuteString to return void and throw a TENScriptException on error. Remove my old comments which didn't really add info. Implement SetSettings. 2021-08-03 15:12:24 +01:00
hispidence
efc91a8e34 Add TENLog and TENScriptException. 2021-08-03 15:08:43 +01:00
Lwmte
49833a7fab Fix GetSpheres again, but currently still broken in some cases (eg lever switch) 2021-08-03 14:14:37 +03:00
Lwmte
ac17da7336 Fix GetSpheres some more, fix cameras/sinks/AI objects/sound sources not cleaning on reload 2021-08-03 13:23:51 +03:00
Lwmte
a7f4244307 Fix GetSpheres and probably a lot of collision issues 2021-08-03 12:32:23 +03:00
Lwmte
b73776494d Move all textures to /Textures folder 2021-08-03 10:34:01 +03:00
Lwmte
a355812942 Fix window stuff, move caustics to subfolder 2021-08-03 10:17:24 +03:00
Lwmte
7938a1f9c9 Fix icon size 2021-08-03 09:42:15 +03:00
Troye
e80f3fc8ce Fix Spline 2021-08-03 01:11:42 -05:00
Nils
841e61073e Fixed Debris Functions 2021-08-03 06:54:36 +02:00
Nils
08cf7e3c5e Fixed Climb Out Of Water towards -X 2021-08-03 06:54:26 +02:00
Nils
0dd7ea0fb2 Fixed UpdateDebris 2021-08-03 06:07:51 +02:00
MontyTRC89
0204970a8d Fixed compilation error in UpdateDebris() 2021-08-03 05:40:25 +02:00
Lwmte
861f147390 Assign remaining hit effect flags for TR4 2021-08-03 01:43:34 +03:00
Lwmte
5b9bcc2715 Fix several silly mistakes with std::vector 2021-08-03 01:30:44 +03:00
Lwmte
950899a7b0 Update TR5Main.vcxproj.user 2021-08-02 19:43:15 +03:00
Lwmte
07dcf6da5b Fix #273 2021-08-02 19:42:07 +03:00
Lwmte
256d4efe6e Fix crash if meshswap is not present 2021-08-02 19:20:58 +03:00
Lwmte
cbdbca527b Also rename solution 2021-08-02 18:38:51 +03:00
Lwmte
d48f90bb93 Rename project to TEN, add icon 2021-08-02 17:53:44 +03:00
Lwmte
71dd879ee8 Fix #236 2021-08-02 17:16:23 +03:00
Nils
48f18a54b0 Putting Light of Lara's burning to Lara's hips 2021-08-02 16:12:15 +02:00
Lwmte
3291010b6b Fix demigod fireballs and binoculars zoom 2021-08-02 16:51:36 +03:00
Lwmte
393b9fd52e Merge branch 'master' of https://github.com/MontyTRC89/TombEngine 2021-08-02 15:54:18 +03:00
Lwmte
8d717c86ad Fix Lara fire 2021-08-02 15:40:51 +03:00
Nils
f785b1fd08 Fixed Debris collision 2021-08-02 14:18:28 +02:00
hispidence
35712bd6d1 Merge branch 'master' of https://github.com/MontyTRC89/TombEngine 2021-08-02 13:10:34 +01:00
Lwmte
2db7e4dd05 Fix some sentry gun bugs 2021-08-02 15:01:28 +03:00
hispidence
6cbf19fe8d Merge branch 'master' of https://github.com/MontyTRC89/TombEngine 2021-08-02 12:49:32 +01:00
hispidence
0da5f86f90 Remove HandleScriptMessage and associated globals - apparently this is no longer supposed to be here. 2021-08-02 12:49:17 +01:00
Lwmte
fd844d5d6b Remove poisoning by medkits 2021-08-02 14:44:28 +03:00
Lwmte
041b03c91d Assign hitEffect for most objects 2021-08-02 14:21:41 +03:00
Nils
95bec0e3b0 Reduced Vertex Count for Bars from 9 to 5
Added define for PI for shaders
Added Primes to Vertex Hash generation
Fixed Debris
2021-08-02 13:16:51 +02:00
Lwmte
4da3b6b624 Fix binoculars mode engaging other states 2021-08-02 12:35:17 +03:00
Lwmte
1a43e0efb0 Fix small scorpion poisoning ratio 2021-08-02 12:07:54 +03:00
Lwmte
90f595b55c Remove gnFrameCounter which is seemingly the same as GlobalCounter 2021-08-02 11:25:53 +03:00
Lwmte
b6e9b30293 Fix poisoning 2021-08-01 23:28:54 +03:00
hispidence
f5439d518f Restore original line now that the stack overflow is fixed. 2021-08-01 20:50:41 +01:00
hispidence
0d5c49e6c3 Fix assignment-addition operator of GAME_OBJECT_ID, thus fixing a stack overflow. The operator was calling itself... Silly me D: 2021-08-01 20:49:28 +01:00
Lwmte
d80aa61527 Simplify Lara renderer a bit 2021-08-01 22:24:20 +03:00