Jump to content

can we use dofile() or will all code have to exist in the construct?


Mollymawk

Recommended Posts

hiya,

 

as a lua refresher exercise, i have a few simple bits of code i use in space engineers, like state machine and loop tuner objects etc and i'm converting  lau .

I was just wondering, will we be able to create code library files or will all code only exist in the construct.

can we use dofile("filename.lua") to access predefined functions. 

Link to comment
Share on other sites

I think they intend for all code to exist in constructs, which would mean you won't be able to use dofile()

 

But I'm pretty sure they intend to allow scripts to communicate between constructs that are linked together. If that's the case, having a "library" construct that contains functions that you want other constructs linked to the "library" construct to run, would be possible.

Link to comment
Share on other sites

50 minutes ago, Vellnn said:

But I'm pretty sure they intend to allow scripts to communicate between constructs that are linked together. If that's the case, having a "library" construct that contains functions that you want other constructs linked to the "library" construct to run, would be possible.

That would certainly make large ships interesting/realistic. You would actually have multiple other "computers" hooked up to the main control computer of the ship in order to access supplementary or even third-party code.

Link to comment
Share on other sites

Probably exist with the cosntruct's ID, saved in the blueprint. It's not heavy to store a 20000 lines script, let alone a 2000 lines script. and given NQ h as streamlined the lua commands, they can surely compress the size of the script even more.

 

Chances are, you'll just have to script smartly, and not with endless loops of "elseif" :P

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...