Commit graph

59 commits

Author SHA1 Message Date
hispidence
16ea0f1aa2 Add documentation and constructor member initialisers for GameScript. 2021-07-21 18:19:57 +01:00
hispidence
da5af327e9 Link up MeshInfo with GameLogicScript, adding a m_meshesMapName and implementing AddLuaNameMesh and RemoveLuaNameMesh.
Add GetMeshByName and make GetItemByName take a constant reference.

Remove no-longer-used headers.
2021-07-21 18:12:17 +01:00
hispidence
12dada0145 Make the "Lara" global non-owning. Will look into this and see if we actually need it. 2021-07-21 18:09:53 +01:00
hispidence
df11377a51 Make GetItemByName take a const ref, and make its error print the name of the item that could not be found.
Register GetItemByName in GameLogicScript instead of winmain. Register GameScriptColor too.

Define the lambdas passed to GameScriptItemInfo in terms of the actual functions we define. Functions that make a GameScriptItemInfo should pass false to make_unique (so the Lua object made does not control the lifetime of the ITEM_INFO).
2021-07-20 17:58:11 +01:00
hispidence
e9b2026404 Make the contents of ObjectIDs.h part of the Lua interface. 2021-07-20 00:16:15 +01:00
hispidence
011e1a9bf4 Uncomment ExecuteFunction and make it take a const ref.
Make «Add/Remove»LuaName return a bool for future error checking, and pass them via lambdas to GameScriptItemInfo, allowing it to call them whenever an object is added or removed (they would not have access to the m_itemsMapName otherwise).
2021-07-17 22:26:07 +01:00
MontyTRC89
f0698a3c80 Added code (to finish) for executing LUA triggers 2021-07-17 05:56:40 +02:00
MontyTRC89
8294e73199 Merge remote-tracking branch 'origin/lara_info'
# Conflicts:
#	TR5Main/Game/Lara/lara_flare.h
#	TR5Main/Scripting/GameLogicScript.cpp
2021-07-14 05:48:42 +02:00
Troye
7b0025a1c9 FLARE_AGE constant; fix dynamic light intensity; fix release builds 2021-07-13 22:29:47 -05:00
hispidence
a0ced5c34e Make GameLogicScript use kInventorySlots. Make InvItem a read-only table. This means we do not need to write an enum directly in the Lua source. 2021-07-13 13:21:13 +01:00
hispidence
a00f3a23fb Implement GiveInvItem, TakeInvItem, GetInvItemCount and SetInvItemCount (names to be finalized). 2021-07-10 14:05:01 +01:00
MontyTRC89
99f476f3b9 Made LUA script optional; Deleted my bugged test code for volumes; 2021-07-06 11:54:34 +02:00
hispidence
34859c154f Make InventoryAdd and InventoryRemove static. Add them as Lua functions. 2021-07-05 18:18:20 +01:00
hispidence
33dcd85a06 Register SetAmbientTrack and PlayAudioTrack. Make PlayAudioTrack static, pass its string arg by reference-to-const, and let it use the loop bool passed in instead of the one stored in global state.
Improve some text formatting in the header.
2021-07-04 14:33:57 +01:00
hispidence
9386993bcd Make SetAmbientTrack take a string by const ref. Change functions to access GameScript[Position/Rotation] members directly instead of via getters/setters. 2021-07-03 23:18:10 +01:00
hispidence
474cf41a7d Add doCallback function to throw an exception if one of the callback encounters an error (and if WarningsAsErrors is on). 2021-07-03 23:16:28 +01:00
hispidence
4c02d6a222 Add implementation of GameScript::InitCallbacks and the C++ holders of the callbacks. This might well be a needless layer of indirection, but it prevents the callbacks being reassigned outside of the class. 2021-07-01 19:33:48 +01:00
hispidence
f22551ab32 Register GameScriptRotation and GameScriptPosition in GameScript constructor. Remove GameScriptItem class, which has been merged into GameScriptItemInfo. 2021-07-01 19:29:58 +01:00
MontyTRC89
d25cfb6c92 Moved GameScriptPosition, GameScriptRotation and GameScriptColor classes in separate files 2021-06-29 05:28:17 +02:00
MontyTRC89
b6e74eb4e6 Merge branch 'NewLuaScripting' of https://github.com/MontyTRC89/TR5Main into NewLuaScripting
# Conflicts:
#	TR5Main/Scripting/GameLogicScript.cpp
2021-06-29 05:03:57 +02:00
MontyTRC89
f81d8e439f Added FROM_DEGREES function; Added quantity param to PickedUpObject(); LUA scripting refactoring WIP; 2021-06-29 05:00:15 +02:00
hispidence
5344e0a211 Include and register GameScriptItemInfo. 2021-06-28 18:35:16 +01:00
MontyTRC89
4c7110558f Switched audio tracks from int index to string; Added Tracks.lua loading support; 2021-06-26 07:36:54 +02:00
MontyTRC89
628358f242 Merge branch 'NewLuaScripting' of https://github.com/MontyTRC89/TR5Main into NewLuaScripting
# Conflicts:
#	TR5Main/Scripting/GameLogicScript.cpp
2021-06-23 05:59:25 +02:00
MontyTRC89
3bd65d3629 Removed test code; Removed scripts from project (they will be created by LD); Added some missing strings for inventory; Added scripting for puzzles; Removed some old code for scripting; 2021-06-23 05:58:24 +02:00
Brad Ellis
bc576d8711 Remove test code. 2021-06-21 16:23:18 +01:00
Brad Ellis
514a691836 GameLogicScript inherits from LuaHandler now. 2021-06-16 14:39:43 +01:00
asasas9500
d4c6cc4a97 Fix line endings 2020-12-21 13:16:29 -03:00
asasas9500
912b0abbae Fix bridges; Fix script IDs 2020-09-28 10:04:44 -03:00
asasas9500
44c988716a Remove ControlXRayMachine(); Move bridges to generic objects folder; Merge bridges 2020-09-27 20:44:17 -03:00
Woops
4c3a3cbbd1 implement 2020-08-28 12:05:25 -05:00
Montagna Marco
18994dd59e Moving all globals of level under LEVEL struct; Fixed severe performance issue; 2020-07-21 09:56:47 +02:00
Montagna Marco
d6f45db5ec Merge branch 'master' of https://github.com/MontyTRC89/TR5Main 2020-06-26 07:06:51 +02:00
Montagna Marco
235dab2f13 New FLOOR_INFO struct; Refactoring rooms part I 2020-06-26 07:06:18 +02:00
Nils Gaitzsch
c860919616 Fixed std namespace collisions
Refactored ChunkID/ChunkReader/Writer
2020-06-20 23:39:08 +02:00
TokyoSU
3699a78e34 Implemented Mutant and Locusts
- Added ItemNearTarget().
2020-06-10 21:38:25 +02:00
asasas9500
1732048a00
Scripting (#211)
* Create template for variables; Rename properties; Improve console input

* Improve console input again
2020-06-09 09:16:51 +02:00
TokyoSU
488dfd102d Implemented Big Rat (TR1) Template
- Fixed old object (added by me) missing from the lua script.
2020-06-08 13:51:44 +02:00
TokyoSU
8f11417654 Implemented Baboon
- Fixed AIObject not being initialized !
- Fixed ITEM_DEACTIVATED (cause im french and ITEM_DESACTIVATED is more appropriate)
2020-06-04 12:49:08 +02:00
TokyoSU
ee59d27517 (Broken) Deleted Global Folder
- No more enums.h, constants.h, macro.h, etc...
- moved all structure in types.h to there respective file.
2020-05-30 15:55:23 +02:00
TokyoSU
2c5a621cb3 Refactor include and moving some structure to right file
- started moving structure out of types.h.
- fixed ExtraAnim using 0 instead of -1.
- changed void(*)(); to function<> for lara routines.
- changed short(*)() effect to function<> for CreatureEffect/CreatureEffect2.
- renamed guardian to laserhead.
- moved some structure to their right place.
- renamed TYPE_ZONE to ZoneTypeEnum.
- fixed zoneType not using ZoneTypeEnum as variable.
- fixed LOT.zone not using ZoneEnumType.
- changed "variable : 1" to bool in some structure.
- implemented @krys new collision structure and improved it a bit (but commented for "later")
- level need #pragma pack(push, 1) #pragma pack(pop) to work (for structure), else it crash at LoadTexturesInfos().

Co-Authored-By: krys <krys@users.noreply.github.com>
2020-05-28 15:17:34 +02:00
TokyoSU
9045a2206d Partially finished Entity Folder Refactoring
- Less Compile Time
- ObjectInfo now use std::function.
- added isPickup and isPuzzleHole in ObjectInfo.
- Renamed EVIL_LARA to LARA_DOPPELGANGER (DOPPELGANGER in xml)
- Removed TR1 Larson/Pierre and TR1 Raptor.
2020-05-27 19:07:34 +02:00
TokyoSU
9c1c4517d7
New project format (#206)
* Starting Reformat the project

- New Import Method, no more "../../" in import,
- New Entity Folder Structure, less compile time

* Refactoring the Project

- added precompiled header with default import like microsoft or directx.
- fix many double import.
- fix math.h confliting math.h from
microsoft.
- fix effects.h confliting Effects.h from DirectX.
- refactored TR4 entity folder and how it's loaded.

* Update Some Code Before Switching to Master

* Finished the NewProjectFormat Template

- need to finish entity in the master later.

* Added Monty NewFileFormat

* Fixed Monty NewFileFormat Include

* Revert "Fixed Monty NewFileFormat Include"

This reverts commit ebf0afca10.

* Trying to fix conflits for NewFileFormat

* Fixed .filters

* Last Commit in NewProjectFormat
2020-05-27 09:21:20 +02:00
Nils Gaitzsch
ca12b10ec3 Added Debug Console Window
Added Script function that handles standalone script commands
2020-05-01 20:42:17 +02:00
Montagna Marco
1bb0546753 Fixed math function names; Fixed effects rendering; Fixed Lara matrices; 2020-05-01 06:33:43 +02:00
MontyTRC
6b16828381
Merge branch 'master' into scripting 2020-04-30 21:52:16 +02:00
asasas9500
960110196e Improve Lua scripting 2020-04-28 12:24:10 -03:00
Montagna Marco
85e462f6a2 First EXE build successfully 2020-04-24 19:15:05 +02:00
Montagna Marco
4cc46789e9 Decompiled input 2020-04-23 19:22:01 +02:00
Montagna Marco
9f05715977 Decompiled level loading functions; Moved lot of vars in DLL; Added Zlib; 2020-04-22 14:12:10 +02:00