Jump to content

[Abandoned] [Java] ModelLoader 1.16_02


Jab

Recommended Posts

So this is becoming a thing again:

 

I've done quite a bit of modding to the core game to get custom equips working from a Lua implementation / demonstation point of view, as the original functions of this mod do.

 

Items in script look like:

item Aviators {	DisplayName = Aviators,	Icon = Aviators,	Equippable = TRUE,	EquipLocation = Eyes,	ModelEquipped = glasses_aviator,}item Fedora {	DisplayName = Fedora,	Icon = Fedora,	Equippable = TRUE,	EquipLocation = Hat,	ModelEquipped = hat_fedora,}

Equippable toggles the ability to wear and unequip.

EquipLocation is a String (text) to be able to uniquely equip anywhere on the body, or a specific place for multiple items (which will unequip the other).

ModelEquipped is a model.txt file that will have a "m_" or "f_" before the name put in the field.

ModelUnEquipped will possibly be a thing too (shades on forehead or other things maybe who knows).

 

I'll look into pushing the changes possibly tomorrow, along with an example workshop mod.

 

VtW41oS.jpg

Link to comment
Share on other sites

I downloaded the most recent version for Build 33.19, copied and pasted the zomboid folder into Steam/steamapps/common/ProjectZomboid and 15 files were overwritten. Still no dice on the models working though.

 

Weird. What mods alongside it are you using? I'm assuming that my mod is the only Java mod being used. Is it server-side? I heard one or two issues regarding server-side.

Link to comment
Share on other sites

Okay guys, 1.14 has been posted to the OP.

 

This version contains what was posted earlier today. ModelLoader now supports equipped items.

 

The new version also contains an example mod for this, and the folder holding what needs to be replaced in the PZ folder. This has increased from around 12 files to about 40. A lot of work had to be done to make this possible.

 

I'll find some time to document the requirements for the added features, however, the mod should provide enough of an example for now.

 

Two things to note:

1) The equipped symbol (Orange dot on an item) does not show for an equipped item yet.

2) Female models for the example mod are not there in this version.

Link to comment
Share on other sites

Fixed a bug involving transferring the item while wearing it. 

 

Same version. Changed the download link.
 

Edit: Here's a fun way to cleanly (And less options for file names / directories) import gendered models:

 
require 'Reloading/ISReloadManager'local MOD_ID = "AMOD";local MOD_NAME = "Aviator Sunglasses Mod";local MOD_VERSION = "1.00";local MOD_AUTHOR = "Jab";local function loadZModelGender(_dir, _name, _texture) 	loadZomboidModel("m_".._name, _dir.."/media/models/m_".._name..".txt", _dir.."/media/textures/".._name..".png");	loadZomboidModel("f_".._name, _dir.."/media/models/f_".._name..".txt", _dir.."/media/textures/".._name..".png");endlocal function info()	dir = getDir("AMOD");	loadZModelGender(dir, "glasses_aviator");	loadZModelGender(dir, "hat_fedora");	 print("Mod Loaded: " .. MOD_NAME .. " by " .. MOD_AUTHOR .. " (v" .. MOD_VERSION .. ")");endlocal function addItems(_keyPressed)	local key = _keyPressed;	if key == 67 then -- F9		local player = getSpecificPlayer(0);   		local inv = player:getInventory();		inv:AddItem("AMOD.Fedora");		inv:AddItem("AMOD.Aviators");	endendEvents.OnGameBoot.Add(info);Events.OnKeyPressed.Add(addItems);

 

Edit 2:

Added a workshop mod of the example.

http://steamcommunity.com/sharedfiles/filedetails/?id=614882413

Edited by Jab
Link to comment
Share on other sites

Jab how mad are you the day you decide to fix the model loader they release 33.20 and most likely break it again? Sorry dude that has to be so frustrating. Im sick of these patches that dont add anything to the game but break the mods that actually do add to the game

I'm sure our GoG players appreciate this sentiment.

Link to comment
Share on other sites

o wow thx jab ur the best :)

 

but i got a problem jab when i install the zombie folder i get a error on the server saying

or games files dont match the servers

 

I'll take a look today.

 

Can confirm: 33.20 works with 1.14. I have not seen errors, and have not seen issues / inconsistencies so far. If anyone sees this (Outside of the server issue quoted here), let me know below this post.

Link to comment
Share on other sites

 

Jab how mad are you the day you decide to fix the model loader they release 33.20 and most likely break it again? Sorry dude that has to be so frustrating. Im sick of these patches that dont add anything to the game but break the mods that actually do add to the game

I'm sure our GoG players appreciate this sentiment.

 

I'm sure they don't even exist yet, but you're right i'm a terrible person because I want some stability before they focus on peddling the half finished game elsewhere

Link to comment
Share on other sites

  • Kirrus locked this topic
Guest
This topic is now closed to further replies.
×
×
  • Create New...