Skip to content

Switch to Oberon00's LuaBind 0.9.1 fork#273

Open
Architector4 wants to merge 8 commits intocortex-command-community:developmentfrom
Architector4:luabind-0.9.1-forked
Open

Switch to Oberon00's LuaBind 0.9.1 fork#273
Architector4 wants to merge 8 commits intocortex-command-community:developmentfrom
Architector4:luabind-0.9.1-forked

Conversation

@Architector4
Copy link
Contributor

Everything compiles and the game runs, but some lua scripts screw up.

For instance, in NativeHumanAI.lua, in line 353, accessing Owner.MOMoveTarget.Pos creates a lua error about no matching overloads or something. Enemy AI doesn't work, as a result.

Those will need further work to find out why that is. I'm spent.

Everything compiles and the game runs, but some lua scripts screw up.

For instance, in `NativeHumanAI.lua`, in line 353, accessing
`Owner.MOMoveTarget.Pos` creates a lua error about no matching overloads
or something

Those will need further work to find out why that is. I'm spent.
@Architector4
Copy link
Contributor Author

oh

my GOD

of course literally everything except linux breaks

on some boost bullshit of course

oh and yeah stuff i did here completely ignores msbuild so that might need to get figured out too

@Architector4
Copy link
Contributor Author

Architector4 commented Mar 4, 2026

also can someone pull in the minizip commit separately into development branch or something please lmao

edit: go go gadget separate PR

#274

@Architector4
Copy link
Contributor Author

Tried out this branch right now. (that and plus the minizip one to make it build)

Everything seems to work fine, except that a few scenarios spam "ERROR: stack overflow" in the console and don't run right after starting.

Note: I mostly just tried starting the scenario and walking left/right or whatever for a few seconds, nothing too involved.

the broken scenarios are:

  • OMA Zero-G (either one, I think it's from the AIs because normal OMA works just fine)
  • Exploration ("Activity was NOT started due to errors!")
  • Decision day ("Activity was NOT started due to errors!")

All other scenarios seem to work lol

This only replaces the get/set pairs where the clear intent is to let
the Lua code read or write the vectors at will, and where the
getters/setters don't do anything at all.

Rationale: the getters all return `const RTE::Vector&` - a *constant*
reference, modifying through which breaks programmer and compiler
assumptions. This makes innocent looking Lua code like `Thing.Pos.X = 5`
ill-defined.

In particular, Oberon00's fork of Luabind errors out on code like the
above exactly due to this circumstance. This commit fixes most instances
of this.

I can't guarantee that this commit is comprehensive. I vote for getting
rid of all the useless getters/setters like these in the first place,
which would then make it easier to ensure that the Lua code does not run
into this on accident.
@Architector4
Copy link
Contributor Author

It was all due to scripts mutating things through const ref. Fixed now in latest commit.

CI still screams, but as far as I can tell, that's all due to the minizip moment. Also I ignored msbuild, so I'd like someone else to mop that up too lol

@Architector4 Architector4 changed the title [BROKEN] Switch to Oberon00's LuaBind 0.9.1 fork Switch to Oberon00's LuaBind 0.9.1 fork Mar 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants