![]() Remember that you might not need to add all the special functions to your controllers, only the ones that you need for its correct behavior. Return the controller so it can be used as a class. Local some_component = self._sv._entity:get_component('my_mod:custom_comp') initialize ourselves, save it in self._sv Note, if you want to be sure something has been restored, by the time we Called on load, after all datastores saved in self._sv have been restored self._sv variable into which you can save thingsįunction M圜ontroller:create(entity, uri) ![]() Note: all controllers are automatically equipped with a Initialize is called when the controller is first created Inventory trackers (and the util class that distinguishes each inventory tracker's functions)Ĭontrollers are classes with self._sv for saving variables and with initialize/restore/etc functions that guarantee some saved state flow control between saves and loads.Controllers have some behaviors that make initializing / loading / destroying easier. Components themselves are also controllers, except they get loaded at a specific time at game start up, and are specifically tied to an entity. The existing controllers are distributed among many of the folders from the stonehearth mod, so to find them take a look at their paths in the manifest.Ī controller is a utility class that stores data/performs a function (and isn't a component / service / call handler / etc).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |