1

I have confirmed that this has been done before, however the person who did this refuses to share how it was done so I'm basically trying to figure it out myself instead of waiting for somebody to change their mind and such.

Basically they managed to combine a model file for Source Engine(specifically for Garrysmod) with lua code. Basically lua thats embedded into the model file.

When loaded, the code is apparently executed. This means on a server it would load once, on clients it would load once for each client that loads it at a given time. For most things this isn't really the best way to go about using lua for development in the game, however I can see a few very useful things with this that could be done with it.

I have a few theories of how it MIGHT be done. I believe maybe bytecode is involved atleast in some way. Possibly bytecode with lua but maybe also with how the mdl files are made.

if it helps with understanding the mdl files here is a page regarding them https://developer.valvesoftware.com/wiki/Model_Creation_Overview

As for lua and lua bytecode those are both pretty easy to find.

print("Testing to embed lua into model file")

Basically I'm hoping to get a working replication of what this person did to embed lua inside a model file and have it load and execute when the model file is loaded.

Shubham
  • 628
  • 1
  • 9
  • 19

0 Answers0