PhunLib
Изображение 1 из 5. Материалы автора из Steam Workshop.
О материале
«PhunLib» — материал мастерской Project Zomboid. Карты, транспорт, оружие и моды для выживания. Данные Steam, описание автора и ссылка для установки через подписку. Совместимость редакцией не проверена.
Описание автора
Shared functions for Phun mods
File tools
-
PhunLib.table.tableToString(table) - returns a string representation of a lua table
-
PhunLib.table.saveTable(filename, data) - saves a table to Lua{filename}.lua
-
PhunLib.file.loadTable(filename, createIfNotExists*) - returns a table loaded from Lua{filename}.lua
-
PhunLib.table.log(...) - appends the values passed to lua\Phun.log
Table tools
-
PhunLib.table.shallowCopy(original, excludeKeys*) - returns a shallow copy of original table. Optionally include an ArrayList of keys to exclude
-
PhunLib.table.deepCopy(original, excludeKeys*) - returns a deep copy of original table. Optionally include ArrayList of keys to exclude
-
PhunLib.table.merge(tableA, tableB, excludeKeys*) - returns a merged copy of 2 tables where tableA is merged into tableA. Optionally include an ArrayList of keys to exclude
String tools
-
PhunLib.string.formatWholeNumber(number) - takes a number and returns thousands separated string without any decimals (eg 2432.3 returns "2,432")
-
PhunLib.string.timeDifference(time1, time2*) - returns the number of years, months, hours, minutes and seconds as a number between 2 timestamps. time2 defaults to now
-
PhunLib.string.timeAgo(time1, time2*, defaultText*) - returns friendly text of time difference as string between timestamps. time2 defaults to now, defaultText defaults to "Just Now"
Events
-
PhunLib.events.OnDawn - triggered when its morning (configured via settings)
-
PhunLib.events.OnDusk - triggered when its evening (configured via settings)
-
PhunLib.events.OnReady - triggered when PhunLib is loaded
-
PhunLib.events.OnEmptyServer - triggered when PhunLib detects the server is empty (runs once per empty)
Misc tools
-
PhunLib.debug(...) - takes strings, numbers and/or tables and prints each out into readable format
-
PhunLib.printTable(...) - prints contents of table to console
-
PhunLib.onlinePlayers(...) - returns ArrayList of players regardless of if its single player. If called by client, returns only isLocalPlayers
More Phun Stuff
Coded with love for our awesome PhunZoid community. Repo and more info
Workshop ID: 3411695932 Mod ID: phunlib
Как установить и запустить
Откройте оригинальную страницу в Steam Workshop, проверьте версию игры, зависимости и порядок загрузки в описании автора. Нажмите «Подписаться» и дождитесь загрузки Steam. Включите материал в меню модификаций или контента игры, если это требуется. Совместимость и запуск редакцией не проверены.