method

398Currently online
71Today's Reading
40Share Today
Multilingual display

Famine mod tutorial: Code tips and tricks

2018-03-27 11:12:02

(Translated from foreign tutorial: CodeTipsandTricks "CodeTipsandTricks") Author :squeek I just want to record my modded famine. Some of the things along the way, the things that I felt during the writing of the game, might be a little hidden, not intuitive, not recorded, or hard to find the answer to. All the things mentioned in a working example can be found here: for example, code tips and tricks are required (requireisrequired, the first is a noun, the last is an adjective)require this Lua function is a very handy tool. Whenever a file is loaded, it stores the result in a table (package.loaded), with the same module name as any subsequent calls (you can use the module name as the file name if you are not familiar with the Lua module now) and gives you a reference to the previous result. components, screens, widgets, these modules basically return a defined class (because they will almost always return the file of the class). Because this function (require) it caches the result and refers to the cached result, if you modify the result it returns and then call the module, Famine will usually reload the files. (Because there is no limit to experience, so the rest of the content go to my blog)

Recommendation