Lua Wrapper

#1
I've noticed that there are hardly any code modifications for SCP:CB, mostly due to the hassle of re-compiling and re-coding the mod for every update to the game.
So I was wondering if anyone would be in favor of getting a Lua wrapper done for SCP:CB, such that the community could more easily produce substantial scripted modifications.
Noobody released a Lua wrapper for Blitz3D a few years back, so it can be done. It may take me some time to write it into SCP:CB though, so I need to know if I would be wasting my time writing said wrapper into the game.

This could also be quickly added to the C++ port whenever it gets done, as there are much better (proper function pointers to be exact) wrappers for the language.
M-x dingus-mode

Re: Lua Wrapper

#3
InnocentSam wrote:Well, perhaps not Lua, but a better use of your (or mine, I'm willing to help) time is to just make it so it can run scripts in real time externally.

I.e. a text file is placed in, say, "mods/events" and it says that in "room172" SCP 106 will spawn or something like that. It'll take less time to make this than to port a Lua wrapper.
I guess we could make a significant abstraction from the game engine. I'm just not sure how parsing significant amount of text every frame will effect the speed of the game.
If only we weren't dealing with a slightly better version of BASIC...
M-x dingus-mode

Re: Lua Wrapper

#4
MonocleBios wrote: I guess we could make a significant abstraction from the game engine. I'm just not sure how parsing significant amount of text every frame will effect the speed of the game.
If only we weren't dealing with a slightly better version of BASIC...
Precache it?

Why don't you load it on game loading? Only problem is you wouldn't be able to modify the existing code, only add items.
Image

Re: Lua Wrapper

#5
The problem with caching is that nearly every module is directly implemented in the engine, rather than wrapped in an abstraction (Rooms are, but their events aren't). To allow modifications from another file, I would have to make an entry point for the cached file in multiple places.
Hence why I suggested Lua, so we can just use function pointers and be done.
M-x dingus-mode

Re: Lua Wrapper

#6
MonocleBios wrote:The problem with caching is that nearly every module is directly implemented in the engine, rather than wrapped in an abstraction (Rooms are, but their events aren't). To allow modifications from another file, I would have to make an entry point for the cached file in multiple places.
Hence why I suggested Lua, so we can just use function pointers and be done.
I think there just isn't enough modders of SCP:CB for it to even be worth attempting.
SCP - Box of Horrors v0.8.0b
Twitter
Github Profile

Re: Lua Wrapper

#7
InnocentSam wrote:
MonocleBios wrote:The problem with caching is that nearly every module is directly implemented in the engine, rather than wrapped in an abstraction (Rooms are, but their events aren't). To allow modifications from another file, I would have to make an entry point for the cached file in multiple places.
Hence why I suggested Lua, so we can just use function pointers and be done.
I think there just isn't enough modders of SCP:CB for it to even be worth attempting.
No, there is you, Monocle, and me (I just barely make it.). A trio is all we need! No, the easier it gets, the people mod it. Also, a good point is why would someone download a minor mod when they have major mods?

[Edit]
But the thing is, all we need are rooms, objects, and events. And when someone asks for something else, implement it.
Image