Zinfidel Posted January 16, 2015 Share Posted January 16, 2015 I just got started with Don't Starve modding, and while I am no stranger to coding/modding, I am new to Lua. I'm currently trying to reimplement the telnet.lua file (appears to be deprecated and non-functional) in the base game as an exercise, but I'm running into problems now when it comes to updating the TCP server because I need to insert an update function into the game's loop. Putting a copy of update.lua in my mod folder doesn't appear to work like other files - I suspect it has to do with load order, or the file is protected from mods in some way. telnet.lua references a defunct function AddWallUpdateFn(fn) that would do exactly what I need, and I have failed to find anything similar to that while perusing the codebase. Does a similar function exist to add stuff to the game loop? I discovered that I couldn't easily override update.lua when I tried to reimplement this functionality, but it never got loaded. Given that I'm doing this primarily as an exercise, I will probably just edit the core files to see some results, but it would be nice to learn how to do this kind of thing "properly" for future modding. TL;DR: Overriding update.lua doesn't seem to work as I'm trying to do it, is it possible to do this? Also, is it possible to run arbitrary functions (not attached to a specific entity or something like that) inside the game loop (WallUpdate(), Update()), such as stepping a copas server? Link to comment https://forums.kleientertainment.com/forums/topic/49206-overriding-updatelua-and-the-update-loop/ 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