Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ECS #2260

Merged
merged 376 commits into from
Dec 11, 2024
Merged

ECS #2260

Changes from 1 commit
Commits
Show all changes
376 commits
Select commit Hold shift + click to select a range
e862e40
FIx
daid Oct 4, 2023
0f118b2
More ECS work.
daid Oct 6, 2023
bba6832
Large update.
daid Oct 16, 2023
29c9258
Merge branch 'master' into ECS
daid Oct 16, 2023
982d72d
Merge branch 'master' into ECS
daid Oct 16, 2023
d970897
Large update, radar rendering now goes trough systems, which clean up…
daid Oct 19, 2023
f39923a
Few small fixes and additions
daid Oct 21, 2023
c9d7ea7
Fix internal view offset
daid Oct 21, 2023
2b10a31
Work towards working repair crew again.
daid Oct 21, 2023
826fb47
Fix internal crew door walking routing.
daid Oct 21, 2023
cf0292b
Start fixing things that are broken... so much broken things...
daid Nov 21, 2023
b3af1ec
Fix scan probes, shields not being the right count, beam weapon damag…
daid Nov 21, 2023
92f4073
Fix docking.
daid Nov 21, 2023
73285dc
Start working on fixing comms
daid Nov 21, 2023
2caa365
Partially working comms scripting.
daid Nov 21, 2023
5c37599
Setup member binds for comms
daid Nov 21, 2023
1613521
Fix player ship spawning from UI
daid Nov 22, 2023
0bd90ae
Fill in some more API endpoints.
daid Nov 22, 2023
1209a99
Set comms globals.
daid Nov 22, 2023
b5e13f7
Do not include templates and database and factions multiple times.
daid Nov 22, 2023
4024531
Do not include templates and database and factions multiple times.
daid Nov 22, 2023
2c0e18a
.
daid Nov 22, 2023
e6dddae
Add some more global script functions.
daid Nov 22, 2023
f2b67de
Implement a few more apis
daid Dec 5, 2023
318f074
Move "allow new player ships" to lua code
daid Jan 18, 2024
0bcac08
Add shield radar rendering, fix beamweapons not cooling down when the…
daid Jan 18, 2024
57e1ddc
Merge branch 'master' into ECS
daid Jan 18, 2024
4cd5c33
Fix ships not rendering in 3D.
daid Jan 18, 2024
d48e797
Fix 3D rendering explosions
daid Jan 18, 2024
951e161
Add engine emitters
daid Jan 18, 2024
524e032
Few small things.
daid Jan 18, 2024
9f6f491
Remove a lot of TODO of the lua scripting spaceship interfacing.
daid Jan 18, 2024
c1f3ed4
Warp drive functions.
daid Jan 18, 2024
195cf31
Implement a few more script APIs
daid Jan 24, 2024
d07d589
Few more apis
daid Jan 25, 2024
8d11eb9
More apis
daid Jan 25, 2024
4616ec5
Many small fixes and additions
daid Mar 15, 2024
2f3ce29
Improve handling of errors in require() so we do not corrupt the stac…
daid Mar 15, 2024
7985a13
Allow comms message from script
daid Mar 15, 2024
c85cc9f
Fix ships not having a default AI
daid Mar 15, 2024
c476528
Clamp shields to max, prevent constant script error flood, fix FoF issue
daid Mar 16, 2024
8e54569
Add supplydrop API (WIP)
daid Mar 16, 2024
363ee84
Various fixes
daid Mar 17, 2024
0ec0473
Merge branch 'master' into ECS
daid Mar 17, 2024
e7943a5
Add radar trace for warpjammers
daid Mar 17, 2024
753477a
Move some apple specific bundle initialization to SP engine instead o…
daid Mar 18, 2024
f32eac1
Clean up main.cpp a bit.
daid Mar 18, 2024
5d0d234
pickup improvements.
daid Mar 19, 2024
39636b9
Merge branch 'ECS' of github.com:daid/EmptyEpsilon into ECS
daid Mar 19, 2024
7f15e8f
Merge branch 'master' into ECS
daid Apr 1, 2024
2033257
Init keybindings locale after loading locale.
daid Apr 3, 2024
aae9078
Color config needs to be loaded after resource paths are setup
daid Apr 3, 2024
46aee99
Render warp jammer range.
daid Apr 3, 2024
5aba473
Merge remote-tracking branch 'origin/master' into ECS
daid Apr 4, 2024
e80734f
Merge branch 'master' into ECS
daid Apr 4, 2024
9a71d50
Merge branch 'master' into ECS
daid Apr 4, 2024
4278fcd
Merge branch 'master' into ECS
daid Apr 5, 2024
df93983
Remove the shiptemplate code from the C++ side. Make the objects that…
daid Apr 5, 2024
101b8a7
add missing gm.lua
daid Apr 5, 2024
5a7de43
Change how ECS multiplayer registration happens, so we do not walk th…
daid Apr 5, 2024
7a65bb5
Make the list of all things that still need network replication and s…
daid Apr 5, 2024
675bf65
Compile fix
daid Apr 5, 2024
40dca85
Merge remote-tracking branch 'origin/master' into ECS
daid Apr 8, 2024
b96ace8
Allow single click to select things in the GM screen.
daid Apr 26, 2024
de7b850
Merge branch 'master' into ECS
daid Apr 29, 2024
71bcee8
Start working on basic replication implementation, which should work …
daid May 1, 2024
ea9e5c6
Add log() function to lua
daid May 3, 2024
8d4b7ec
Merge branch 'master' into ECS
daid May 3, 2024
6630d8f
Merge branch 'master' into ECS
daid May 6, 2024
62736ee
Add basic replication for vectors that do not change often, by using …
daid May 6, 2024
8471d41
Replicate comms
daid May 6, 2024
c74535f
comms replication
daid May 10, 2024
b6696dc
Merge branch 'master' into ECS
daid May 16, 2024
78be6c0
WIP
daid May 16, 2024
b12ec89
Working on multiplayer code
daid May 17, 2024
bca5f0b
Remove legacy factioninfo
daid May 21, 2024
87e9a4c
More replication.
daid May 21, 2024
3d7d997
Add docking replication.
daid May 21, 2024
cfd292f
More replication.
daid May 22, 2024
69a14be
More replication.
daid May 22, 2024
707f725
Merge branch 'master' into ECS
daid May 22, 2024
b5711fc
update
daid May 22, 2024
fb831b0
Merge branch 'master' into ECS
daid May 22, 2024
ee84f80
oops
daid May 22, 2024
e2b9989
Start adding custom ship functions again
daid May 23, 2024
1cfa585
Various
daid May 23, 2024
65c5e1f
Start cleaning up TODOs
daid May 24, 2024
1580c2d
Implement various things related to scripting
daid May 24, 2024
874b012
Datastorage to new scripting.
daid May 24, 2024
2c64465
Datastorage to new scripting.
daid May 24, 2024
8bc6c17
Merge branch 'master' into ECS
daid May 26, 2024
afda3bc
more replication.
daid May 28, 2024
642cf17
Mine trigger range rendering.
daid May 29, 2024
6d8ca57
Nebula GM screen rendering.
daid May 29, 2024
256af56
Planet ECS partial implementation.
daid May 29, 2024
0752e53
More planet api
daid May 30, 2024
3614720
more replication.
daid May 31, 2024
1463966
Update to new component script binding
daid Jun 4, 2024
f419b4f
Bit of GM tweak work.
daid Jun 4, 2024
13fcef1
more tweak
daid Jun 4, 2024
f6473d4
More tweak
daid Jun 4, 2024
63cad9a
Add tweak of arrays on components
daid Jun 4, 2024
9170164
Add a method for getting all entities with a specific component from lua
daid Jun 7, 2024
b755c8c
More replication.
daid Jun 7, 2024
a7cd563
Add missiletube replication.
daid Jun 8, 2024
e9b9c19
Log to stdout in windows headless mode
daid Jun 10, 2024
73f4b82
Add ScanProbeLauncherReplication
daid Jun 11, 2024
d8972e3
Add stdin lua console when running headless
daid Jun 12, 2024
b8fa42d
Add shields replication.
daid Jun 12, 2024
aa8f988
Add target replication.
daid Jun 13, 2024
6cdd8a7
Fix
daid Jun 13, 2024
efb3175
Add selfdestruct replication
daid Jun 13, 2024
97b0765
Merge branch 'master' into ECS
daid Jun 13, 2024
2528736
Update
daid Jun 13, 2024
4f2c6ac
Merge branch 'ECS' of github.com:daid/EmptyEpsilon into ECS
daid Jun 13, 2024
c466159
Fix vector replication
daid Jun 13, 2024
2fa8563
Get enemies in radius function
daid Jun 14, 2024
26173de
More network replication
daid Jun 14, 2024
72ee3c9
Replication for rendering.
daid Jun 14, 2024
1942d36
Rebuild less code if the version number changes.
daid Jun 14, 2024
5ae53ad
Add random basic callsigns
daid Jun 14, 2024
3023ace
Repair crew counts from lua
daid Jun 14, 2024
478daf1
Add zone rendering.
daid Jun 14, 2024
38f154d
Add Zone script binding
daid Jun 14, 2024
514c419
Remove legacy zone files, as those are no longer needed and we need t…
daid Jun 14, 2024
cff3460
Remove empty files
daid Jun 14, 2024
a08a8a9
Fix GM object creation screen, set faction, allow ship creation
daid Jun 14, 2024
3abc05d
Add shield hit effect rendering.
daid Jun 15, 2024
16f7bf9
Remove some no longer used files, still need more cleanup
daid Jun 15, 2024
86f985f
Remove more unused code
daid Jun 15, 2024
d826d2e
Quick hack to checkout SP in correct branch
daid Jun 15, 2024
d5bb346
Merge branch 'master' into ECS
daid Jun 15, 2024
615b831
also pull latest SP
daid Jun 16, 2024
af0ed3d
Fix warnings
daid Jun 16, 2024
7094346
Try to fix glm for android being annoying.
daid Jun 16, 2024
d13fd35
Lower zone render order
daid Jun 16, 2024
0ea29a3
Re-add the shields up and self destruct sounds on main screen.
daid Jun 16, 2024
9443388
Add zone replication.
daid Jun 17, 2024
b0eb1a8
Start to get rid of a lot of old code
daid Jun 17, 2024
9ab74e3
Clean up some TODOs
daid Jun 17, 2024
b70392d
Merge branch 'master' into ECS
daid Jun 17, 2024
20c615d
Add GM related lua functions
daid Jun 17, 2024
b9cc7ed
Handle that certain components do not exist on player control entities
daid Jun 17, 2024
5e70091
Implement the first lua http api call
daid Jun 18, 2024
0a636a0
Start fixing the tutorial.
daid Jun 18, 2024
34472a1
Fixes to get further into the tutorial
daid Jun 18, 2024
154d2ec
Start implementing the command* lua apis
daid Jun 18, 2024
b3e0f93
More command functions
daid Jun 18, 2024
ce25ead
Workaround script() objects not being isolated enough and causing pro…
daid Jun 18, 2024
1f336d0
Fix setShieldsMax
daid Jun 18, 2024
65bcca3
Fix warpdrive not setting right speed from UI
daid Jun 18, 2024
e9b857d
Fix few more bugs
daid Jun 18, 2024
23aae9a
Fixes
daid Jun 18, 2024
5041a9b
Call init() on Script() objects
daid Jun 19, 2024
56f0db5
Implement more things
daid Jun 19, 2024
ab95f59
Support different max warp levels on the warpdrive
daid Jun 19, 2024
84efa87
Merge branch 'master' into ECS
daid Jun 19, 2024
5472fd9
compile fix
daid Jun 19, 2024
1a0b1fb
compile fix 2
daid Jun 19, 2024
47fb3ae
Fix raw scanner distance, fix some TODOs
daid Jun 20, 2024
82a5d2e
Small fixes
daid Jun 20, 2024
8a79530
Explode nuke/emp on timeout, remove some TODOs
daid Jun 20, 2024
45b4d8e
Cross off a few more TODOs
daid Jun 24, 2024
7f7d0d4
More TODOs crossed off
daid Jun 24, 2024
688b4e5
Scanprobe TODOs done
daid Jun 24, 2024
6745835
Artifact callbacks
daid Jun 24, 2024
73504e1
Use layered script environments to share ship templates between vario…
daid Jun 26, 2024
234d2f3
Fix random transport scripts not working. Start removing usage of .ty…
daid Jun 28, 2024
9ea9d7b
Chipping away .typeNames
daid Jun 28, 2024
dffb2ff
Merge branch 'master' into ECS
daid Jun 28, 2024
29f7923
Remove few more typeNames
daid Jun 28, 2024
488c6e6
more typeName removal
daid Jul 8, 2024
ac574bf
Make nebulae render range configurable
daid Jul 26, 2024
c30e6c4
Fix 500+kb/s/client replication issue
daid Jul 28, 2024
ebcf47e
Fix nebulae not rendering in 3D, fix beam effects being rendered wrong.
daid Jul 28, 2024
331e152
Implement custom ship functions script bindings
daid Jul 28, 2024
8882e0e
Fix probe 3D model todo
daid Jul 31, 2024
3161dcf
Allow disable of reactor overload explosion
daid Jul 31, 2024
e2d1e0c
Autorepair
daid Jul 31, 2024
a9da364
Make crew position into a class enum and add helper class for a set o…
daid Aug 1, 2024
35e5f96
Fix discord build
daid Aug 1, 2024
51e75cf
Fix steam build
daid Aug 1, 2024
952dceb
Allow custom functions to be assigned to multiple stations at the sam…
daid Aug 1, 2024
f5a9120
Fix
daid Aug 1, 2024
94d0c30
Allow lua API to limit which crew positions can be used.
daid Aug 2, 2024
fcf0baf
Merge branch 'master' into ECS
daid Aug 2, 2024
9a28b72
Remove spaceobject implementation from the code, still some left over…
daid Aug 2, 2024
a7bab57
Rework how 3D rendering systems are registered.
daid Aug 4, 2024
51768be
Add billboard rendering.
daid Aug 4, 2024
9ae5914
Fix black hole radar trace
daid Aug 4, 2024
b05486f
Merge remote-tracking branch 'origin/master' into ECS
daid Aug 5, 2024
87f5fde
Remove unused files.
daid Aug 5, 2024
7231b91
Update crewPosition.h
daid Aug 8, 2024
fa8988f
Update crewPosition.h
daid Aug 8, 2024
30a3067
Merge branch 'master' into ECS
daid Aug 9, 2024
5fb6bb7
Remove the ai_controller if a template is a player ship, as the defau…
daid Aug 9, 2024
37bd1b3
Merge branch 'master' into ECS
daid Aug 11, 2024
ba918b6
Re-implement set next target in ECS (#2138)
kzsh Aug 14, 2024
7163276
Do not add hull on missiles, as that makes them targetable and other …
daid Aug 14, 2024
3d44728
Implement applyDamage lua function
daid Aug 14, 2024
ff8e8fe
Add function to generate a pseudo RNG which can be used independed of…
daid Aug 20, 2024
046329d
Merge branch 'master' into ECS
daid Aug 22, 2024
fa060c9
ECS: re-implement mesh rendering in database entries (#2140)
kzsh Aug 22, 2024
d27c349
Merge branch 'master' into ECS
daid Aug 22, 2024
738f6fb
Merge branch 'master' into ECS
daid Aug 23, 2024
0e50a6c
Fix some issues in ECS API bindings (#2148)
GinjaNinja32 Aug 28, 2024
07da13f
Merge branch 'master' into ECS
daid Aug 28, 2024
fd74021
Fix order strings compatibility issue between ECS and master. Fix sec…
daid Aug 28, 2024
234360e
Throw an error if lua->vecX conversion is not getting the right data
daid Aug 28, 2024
030f548
More ECS fixes (#2149)
GinjaNinja32 Aug 29, 2024
008be64
Fix the other script environment require() issues
daid Aug 29, 2024
3c0ecb6
Fix internal docking breaking ships (#2150)
GinjaNinja32 Aug 30, 2024
53667b1
Merge branch 'master' into ECS
daid Sep 6, 2024
1f5b2d7
Limit the multiplayer update rate of certain components to reduce net…
daid Sep 6, 2024
183db32
Improve lua REPL to show return results if they are available.
daid Sep 11, 2024
e5d37e9
Fix maneuvering system inducing oscillations in fast-turning ships (#…
GinjaNinja32 Sep 11, 2024
676f50f
Start of new script docs
daid Sep 13, 2024
07e9d25
Remove a few more TODOs
daid Sep 13, 2024
4243c13
Two more TODOs gone
daid Sep 13, 2024
02f556a
Remove 'f' suffix from numbers in lua (#2164)
kzsh Sep 19, 2024
3a2dff3
fix getReputationPoints() (#2188)
aBlueShadow Oct 4, 2024
2a90b14
Fixed #2189
daid Oct 6, 2024
e97e66a
Fix #2192
daid Oct 6, 2024
f8e0c21
Fixed #2186
daid Oct 6, 2024
e7e7df4
Do not start calling update() if init() fails. This should make issue…
daid Oct 7, 2024
7b6d823
Fixed #2187. Implemented queryScienceDatabase in pure lua
daid Oct 7, 2024
66f0e1d
Implement isInside for zones. Fixes #2183
daid Oct 7, 2024
4ec411d
Few mode command* bindings.
daid Oct 7, 2024
1ad0d69
Fixed #2190 make stations share energy by default
daid Oct 8, 2024
22918b9
Switch to 64bit windows builds per default
daid Oct 17, 2024
cca674a
Fixed #2202
daid Oct 17, 2024
3b49109
Merge remote-tracking branch 'origin/master' into ECS
daid Oct 17, 2024
6751465
Partial fix for #2194, stations now render, but some other things mig…
daid Oct 17, 2024
cddaa01
Improve the #2185 situation, making the result a lot better.
daid Oct 17, 2024
0cd380f
3 todos gone
daid Oct 30, 2024
bb4b3d3
Compile warning fix
daid Oct 30, 2024
a30d0df
Last of the command* lua bindings
daid Oct 31, 2024
50635d9
Add ship log function from lua
daid Oct 31, 2024
6e3cdb0
Resolve some more TODOs
daid Nov 1, 2024
787db69
One less TODO file
daid Nov 1, 2024
ed84778
Two more down
daid Nov 1, 2024
91f6b43
Merge remote-tracking branch 'origin/master' into ECS
daid Nov 6, 2024
e4d86d9
Remove empty file
daid Nov 6, 2024
1c08016
Beam effect lua bindings
daid Nov 8, 2024
5337f37
Shiplog replication
daid Nov 15, 2024
9a3e0ac
Add getPlayersInfo(ship)
daid Nov 15, 2024
7438a08
Add ships log to player ships...
daid Nov 15, 2024
45ebc03
Fix NaN issue with planet collision
daid Nov 18, 2024
c650bb1
Merge remote-tracking branch 'origin/master' into ECS
daid Nov 28, 2024
53472b9
Merge branch 'master' into ECS
daid Dec 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
.
daid committed Nov 22, 2023

Verified

This commit was signed with the committer’s verified signature.
torkelrogstad Torkel Rogstad
commit 2c0e18aff466092349efeea874898e8d351c1ff5
5 changes: 5 additions & 0 deletions scripts/api/entity/spaceobject.lua
Original file line number Diff line number Diff line change
@@ -317,6 +317,7 @@ end
--- Example: obj:setRadarSignatureInfo(0.0, 0.5, 1.0) -- a radar signature of 0 gravitational, 0.5 electrical, and 1.0 biological
function Entity:setRadarSignatureInfo(gravity, electrical, biological)
--TODO
return self
end
--- Returns this SpaceObject's gravitational radar signature value.
--- Example: obj:getRadarSignatureGravity()
@@ -338,6 +339,7 @@ end
--- Example: obj:setScanningParameters(2, 3)
function Entity:setScanningParameters(complexity, depth)
--TODO
return self
end
--- Returns the scanning complexity for the given SpaceObject.
--- Example: obj:scanningComplexity(obj)
@@ -356,6 +358,7 @@ end
--- Example: obj:setScanned(true)
function Entity:setScanned(is_scanned)
--TODO
return self
end
--- [DEPRECATED]
--- Returns whether this SpaceObject has been scanned.
@@ -373,6 +376,7 @@ end
--- Example: obj:setScannedByFaction("Human Navy", false)
function Entity:setScannedByFaction(faction_name, is_scanned)
--TODO
return self
end
--- Returns whether the given faction has successfully scanned this SpaceObject.
--- Requires a faction name string value as defined by its FactionInfo.
@@ -386,4 +390,5 @@ end
--- obj:onDestroyed(function() print("Object destroyed!") end)
function Entity:onDestroyed(callback)
--TODO
return self
end
55 changes: 0 additions & 55 deletions src/gameGlobalInfo.cpp
Original file line number Diff line number Diff line change
@@ -371,32 +371,6 @@ int sectorToXY(lua_State* L)
/// x,y = sectorToXY("BA12") -- x = 140000, y = 940000
REGISTER_SCRIPT_FUNCTION(sectorToXY);

static int victory(lua_State* L)
{
gameGlobalInfo->setVictory(luaL_checkstring(L, 1));
if (engine->getObject("scenario"))
engine->getObject("scenario")->destroy();
engine->setGameSpeed(0.0);
return 0;
}
/// void victory(string faction_name)
/// Sets the given faction as the scenario's victor and ends the scenario.
/// (The GM can unpause the game, but the scenario with its update function is destroyed.)
/// Example: victory("Exuari") -- ends the scenario, Exuari win
REGISTER_SCRIPT_FUNCTION(victory);

static int globalMessage(lua_State* L)
{
gameGlobalInfo->global_message = luaL_checkstring(L, 1);
gameGlobalInfo->global_message_timeout = luaL_optnumber(L, 2, 5.0);
return 0;
}
/// void globalMessage(string message, std::optional<float> timeout)
/// Displays a message on the main screens of all active player ships.
/// The message appears for 5 seconds, but new messages immediately replace any displayed message.
/// Example: globalMessage("You will soon die!")
REGISTER_SCRIPT_FUNCTION(globalMessage);

static int setBanner(lua_State* L)
{
gameGlobalInfo->banner_string = luaL_checkstring(L, 1);
@@ -489,35 +463,6 @@ static int getAllObjects(lua_State* L)
/// Example: getAllObjects()
REGISTER_SCRIPT_FUNCTION(getAllObjects);

static int getScenarioVariation(lua_State* L)
{
if (gameGlobalInfo->scenario_settings.find("variation") != gameGlobalInfo->scenario_settings.end())
lua_pushstring(L, gameGlobalInfo->scenario_settings["variation"].c_str());
else
lua_pushstring(L, "None");
return 1;
}
// this returns the "variation" scenario setting for backwards compatibility
/// string getScenarioVariation()
/// [DEPRECATED]
/// As getScenarioSetting("variation").
REGISTER_SCRIPT_FUNCTION(getScenarioVariation);

static int getScenarioSetting(lua_State* L)
{
auto key = luaL_checkstring(L, 1);
if (gameGlobalInfo->scenario_settings.find(key) != gameGlobalInfo->scenario_settings.end())
lua_pushstring(L, gameGlobalInfo->scenario_settings[key].c_str());
else
lua_pushstring(L, "");
return 1;
}
/// string getScenarioSetting(string key)
/// Returns the given scenario setting's value, or an empty string if the setting is not found.
/// Warning: Headless server modes might load scenarios without default setting values.
/// Example: getScenarioSetting("Difficulty") -- if a scenario has Setting[Difficulty], returns its value, such as "Easy" or "Normal"
REGISTER_SCRIPT_FUNCTION(getScenarioSetting);

static int getGameLanguage(lua_State* L)
{
lua_pushstring(L, PreferencesManager::get("language", "en").c_str());
24 changes: 24 additions & 0 deletions src/script.cpp
Original file line number Diff line number Diff line change
@@ -158,6 +158,13 @@ static string luaGetScenarioSetting(string key)
return "";
}

static string luaGetScenarioVariation()
{
if (gameGlobalInfo->scenario_settings.find("variation") != gameGlobalInfo->scenario_settings.end())
return gameGlobalInfo->scenario_settings["variation"];
return "None";
}

static void luaOnNewPlayerShip(sp::script::Callback callback)
{
gameGlobalInfo->on_new_player_ship = callback;
@@ -231,9 +238,26 @@ void setupScriptEnvironment(sp::script::Environment& env)

env.setGlobal("createClass", &luaCreateClass);

/// string getScenarioSetting(string key)
/// Returns the given scenario setting's value, or an empty string if the setting is not found.
/// Warning: Headless server modes might load scenarios without default setting values.
/// Example: getScenarioSetting("Difficulty") -- if a scenario has Setting[Difficulty], returns its value, such as "Easy" or "Normal"
env.setGlobal("getScenarioSetting", &luaGetScenarioSetting);
// this returns the "variation" scenario setting for backwards compatibility
/// string getScenarioVariation()
/// [DEPRECATED]
/// As getScenarioSetting("variation").
env.setGlobal("getScenarioVariation", &luaGetScenarioVariation);
env.setGlobal("onNewPlayerShip", &luaOnNewPlayerShip);
/// void globalMessage(string message, std::optional<float> timeout)
/// Displays a message on the main screens of all active player ships.
/// The message appears for 5 seconds, but new messages immediately replace any displayed message.
/// Example: globalMessage("You will soon die!")
env.setGlobal("globalMessage", &luaGlobalMessage);
/// void victory(string faction_name)
/// Sets the given faction as the scenario's victor and ends the scenario.
/// (The GM can unpause the game, but the scenario with its update function is destroyed.)
/// Example: victory("Exuari") -- ends the scenario, Exuari win
env.setGlobal("victory", &luaVictory);

env.setGlobal("addGMFunction", &luaAddGMFunction);