Moodle Framework
О материале
«Moodle Framework» — материал мастерской Project Zomboid. Карты, транспорт, оружие и моды для выживания. Данные Steam, описание автора и ссылка для установки через подписку. Совместимость редакцией не проверена.
Описание автора
Makes it easy to add moodles for modders.
Fellow modders:
IsoPlayer ModData.Moodles was removed. If you own a mod accessing it directly, please remove that access. Use MF.getMoodle and check against nil. That should be enough.
Moodle mods users:
You can use (https://steamcommunity.com/sharedfiles/filedetails/?id=3789490511) for backward compatibility until moodle modders update their interface usage.
Reports:
If you have errors, report with console.txt on Official PZ Discord: mod_support channel.
Moodle Framework Configuration
If you want colors to be easier to distinguish, you can set to white the reference color for moodles (default on). This applies to both vanilla and modded moodles. You can also deactivate various displays to enhance mod compatibility. Modded Backgrounds with small extensions right or down are now handled too.
How to create a new moodle
If you wanna create a Moodle * then follow the next steps, replacing * by your moodle name.
1/ Moodle Texture
Add Moodle *.png under media\ui. Should be 30 by 30 pixels png with alpha enabled. Note you can also has specific textures per moodle level: e.g. *_Bad_2.png or *_Good_4.png
2/ Texture
Add the following text under media\lua\shared\Translate\EN\Moodles.json
{
"Moodles_*_Good_lvl1": "text_1",
"Moodles_*_Good_desc_lvl1": "text_desc_1",
"Moodles_*_Good_lvl2": "text_2",
"Moodles_*_Good_desc_lvl2": "text_desc_2",
"Moodles_*_Good_lvl3": "text_3",
"Moodles_*_Good_desc_lvl3": "text_desc_3",
"Moodles_*_Good_lvl4": "text_4",
"Moodles_*_Good_desc_lvl4": "text_desc_4",
"Moodles_*_Bad_lvl1": "text_1",
"Moodles_*_Bad_desc_lvl1": "text_desc_1",
"Moodles_*_Bad_lvl2": "text_2",
"Moodles_*_Bad_desc_lvl2": "text_desc_2",
"Moodles_*_Bad_lvl3": "text_3",
"Moodles_*_Bad_desc_lvl3": "text_desc_3",
"Moodles_*_Bad_lvl4": "text_4",
"Moodles_*_Bad_desc_lvl4": "text_desc_4"
}
(json format: don't put a comma on the last entry) You can implement only a subset of this as long as you call only the implemented part.
3/ Moodle object creation
Add these lines in your mod:
require "MF_ISMoodle"
MF.createMoodle(*);
4/ Moodle value updates
Access your moodle from your code with
require "MF_ISMoodle"
MF.getMoodle(*,playerNum):setValue(myNewMoodleValue)--float
0.0 <= myNewMoodleValue <=1.0 Missing playerNum will make the mod incompatible with SplitScreen.
For tuning options see dedicated discussion
Limitations
-
Not tested with splitscreen. (it is expected to work since last version)
-
Oscillations are not based on vanilla value and the behaviour may depend on performances.
Credits where it is due
- This is inspired from the (removed) mod Zombie Camouflage moodle management by the awesome Dislaik.
Known mods using this
Have a look at how they use this mod.
On Lockdown This mod cannot be modified by anyone else, for anything else, at all, ever. Even if the user disappears, he or she would much rather you didn't touch the fruits of their hard labour.
You wanna support? A nice word is always welcome. Constructive feedback too.
Workshop ID: 3396446795 Mod ID: MoodleFramework
Как установить и запустить
Откройте оригинальную страницу в Steam Workshop, проверьте версию игры, зависимости и порядок загрузки в описании автора. Нажмите «Подписаться» и дождитесь загрузки Steam. Включите материал в меню модификаций или контента игры, если это требуется. Совместимость и запуск редакцией не проверены.