![]() FRONT, 0, 0 ) if count >= 3 then - calling this without parameters clears the fallback that's calling it clear_callback () end end, 60 ) Local count = 0 - this upvalues to the interval set_interval ( function () count = count + 1 spawn ( ENT_TYPE. This should help to avoid bugs where one would for example just pass a random integer to a function expecting a callback id. We use those to clarify what kind of values can be passed and returned from a function, even if the underlying type is really just an integer or a string. You can load modules with require "mymod" or require "mydir.mymod", just put a in the same directory the script is, or in mydir/ to keep things organized.Ĭheck the Lua tutorial or examples how to actually make modules. Using unsafe scripts requires users to enable the option in the overlunky.ini file which is found in the Spelunky 2 installation directory. Setting meta.unsafe = true enables the rest of the standard Lua libraries like io and os, loading dlls with require and package.loadlib. For example this code that saves table and loads it back:įor _, player in players do local royal_title = nil if player : is_female () then royal_title = 'Queen' else royal_title = 'King' end local name = F '' message ( name ) end Unsafe mode To save data in your mod it makes a lot of sense to use json to encode a table into a string and decode strings to table. math base string table coroutine package json We're using Lua 5.4 with the Sol C++ binding. You can read more about them in the Lua documentation. The following Lua libraries and their functions are available. This will allow you to get auto-completion of API functions along with linting Lua libraries For example VSCode with the Lua Extension offers this feature. If you use a text editor/IDE that has a Lua linter available you can download a, place it in a folder of your choice and specify that folder as a "external function library". Playlunky will also print the messages to terminal (even from Overlunky) if ran with the -console switch. ![]() This could be cmd or even the system environment variables if playing on Steam. Set OL_DEBUG=1 in the same environment where the game is running to keep the Overlunky terminal open for better debug prints.If you're using a stable release from the past, you might find some things here don't work. This doc is up to date for the Overlunky WHIP build and Playlunky nightly build. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |