Project Zomboid

Project Zomboid

430 ratings
Moodle Framework
2
2
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
60.079 KB
30 Dec, 2024 @ 3:04pm
10 Mar @ 2:11pm
3 Change Notes ( view )

Subscribe to download
Moodle Framework

In 1 collection by Tchernobill
B42
22 items
Description
Makes it easy to add moodles for modders.
This version may have frequent updates that we do not wanna bother B41 MP players with.


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.

2/ Texture
Add the following text under media\lua\shared\Translate\EN
Moodles_EN { 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", }
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 multiplayer. (it is expected to work)
  • 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


Known mods using this
Have a look at how they use this mod.


On Lockdown[theindiestone.com]
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
Popular Discussions View All (2)
1
30 Dec, 2024 @ 10:15pm
Better movement sync
UnCheat
0
11 Feb @ 4:45pm
[FIXED] Incorrect moodle size bug introduced in 42.3.0
ModestPileOfCat
20 Comments
darkArt 22 Apr @ 12:23am 
If I subscribe to this and the old B41/B42 version of this mod it only shows me one moodle framework mod on the mod list.
Monkey 31 Mar @ 7:13am 
Or perhaps use the texture's width + height ratio and scale it up/down to fit in the moodle accordingly.
Monkey 31 Mar @ 7:11am 
Hey, I'm working on a mod where I need to use some item icons for the moodle picture (with SetPicture). However these are generally bigger than 30x30, sometimes even now a 1:1 ratio, and ultimately end up being bigger than the moodle boundaries. Is there a way to perhaps have optional width and height parameters, and maybe aspect ratio when passing setPicture?
Ludanhamon 22 Mar @ 1:21am 
Doesn't appear at the mods list in-game. How to fix it
Dr. Lalaoz 1 Feb @ 7:03am 
Fixed Stat Tweaks Lib. The issue was actually really unintuitive so i'm posting it here too.
StatTweaks defined PerformanceSettings as the getPerformance() function for its own use. that caused MoodleFR to be unable to call its PerformanceSettings.getLockFPS() call because it was changed.
This means that global values within mods (even "local" ones) can be changed by other mods, accidentally or otherwise.
RuralMoss 29 Jan @ 2:17am 
It's Stat Tweaks Lib, https://sp.zhabite.com/workshop/filedetails/?id=3415375593 . The author is aware i think.
RuralMoss 28 Jan @ 11:35pm 
I am also getting the exact same error as @korewednesday. I will try shortlisting as well to find if there is a conflict.
Tchernobill  [author] 27 Jan @ 11:14am 
@korewednesday There is no reason for this line to break unless you have something (a lua mod or java mod I guess) altering PerformanceSettings.getLockFPS symbol seen from lua side.
korewednesday 27 Jan @ 6:19am 
Hello! I waffled between which version to comment this on, because it's true of both, but settled on this one because I'm playing in b42; this mod is throwing constantly-generating errors in my game since the latest update. At first I thought it might be an issue of having the wrong version, since I had a mod that was a b41/42 hybrid, so I switched to that version, but it continued (below error is from error magnifier, and admittedly is while the other version is running, but I believe the errors were identical with the b42 version)

`function: updateOscilatorXOffset -- file: MF_ISMoodle.lua line # 221 | MOD: MoodleFramework
function: render -- file: MF_ISMoodle.lua line # 241 | MOD: MoodleFramework
java.lang.RuntimeException: Object tried to call nil in updateOscilatorXOffset
[continues; running afoul of char limit]


I'm still running further diagnostics to see if there's a mod conflict that previously didn't exist, but this is the only one coming up in the reports
Tchernobill  [author] 22 Jan @ 10:34am 
@engager6 This mod is not compatible B42.0.2 anymore. I do not maintain for minor versions, especially those not available legaly anymore. Wait for your mods to be updated.