Mollymawk Posted October 13, 2017 Share Posted October 13, 2017 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 More sharing options...
Veln Posted October 13, 2017 Share Posted October 13, 2017 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. mmyesrice 1 Link to comment Share on other sites More sharing options...
Shockeray Posted October 13, 2017 Share Posted October 13, 2017 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. Veln 1 Link to comment Share on other sites More sharing options...
Anaximander Posted October 13, 2017 Share Posted October 13, 2017 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" Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now