Jump to content

[Abandoned] [Java] ModelLoader 1.16_02


Jab

Recommended Posts

tjDhPZv.png

 

 

The ModelLoader is currently Unavailable for download. There is instead an open letter here:

https://dl.dropboxusercontent.com/u/31589881/PZ/ModelLoader/ModelLoader.html

 

Purpose:
 
The purpose of this mod is to expose and modify the model loading portion of the game in order to support customized models and their functions to be properly imported into the game.

Instructions:

Spoiler


- Simply copy the 'zombie' (and 'media' folder for v1.14+) in the main Project Zomboid install folder ("Steam/SteamApps/common/ProjectZomboid/"). Make sure to make a backup of the zombie folder, for in case you want to remove this mod. You can always verify your files using Steam. 

 

 

 

 

 

An Instructional video on how to Install ModelLoader:

 

 

 

 

 

 

 


 
Builds:

Spoiler

 

 

Current Version: 1.16_02 [34.28] - Download here.

 

(Old Versions):

  • V1.16_01 [34.27] - Download here. 
  • V1.15       [33.20] - Download here. (mirror)
  • V1.13       [33.19] - Download here.
  • V1.12       [33.14] - Download here.
  • V1.11       [32.30] - Download here.
  • V1.10       [32.27] - Download here.
  • V1.06       [32.16] - Download here.
  • V0.99       [31.13] - Download here.

 

ModelLoader Extension: (This is broken for now. Don't use it)

  • V1.01 [33.20] - Download here.

 

 

 

Documentation:

Spoiler

 

Global Lua Functions:

Spoiler


-- Returns the folder directory for a mod.
string getDir(MOD_ID)

-- Loads a standard non-static Zomboid model.
----     String name: The name of the model registered in the system.
--       (Note: For gender models, you need to specify "m_" for male and "f_"
--             for female.)
--     
----     String modelLoaction: The location of the model file. 
--         (Note: Use "getDir()" and append your file location inside the mod folder.)
----     String textureLocation: The location of the texture file.
--         (Note: Use "getDir()" and append your file location inside the mod folder.)
void loadZomboidModel(String name, String modelLocation, String textureLocation)

-- Loads a static Zomboid model. (Note: This is for weapons.)
----     String name: The name of the model registered in the system.
--         (Note: For gender models, you need to specify "m_" for male and "f_"
--             for female.)--     
--       String modelLoaction: The location of the model file.
--         (Note: Use "getDir()" and append your file location inside the mod folder.)
----     String textureLocation: The location of the texture file.
--         (Note: Use "getDir()" and append your file location inside the mod folder.)
void loadStaticZomboidModel(String name, String modelLocation, String textureLocation)

--       Loads a static OBJ model. (Note: This is for weapons.)
----     String name: The name of the model registered in the system.
--         (Note: For gender models, you need to specify "m_" for male and "f_"
--             for female.)
--     
----     String modelLoaction: The location of the model file. 
--         (Note: Use "getDir()" and append your file location inside the mod folder.)
----     String textureLocation: The location of the texture file.
--         (Note: Use "getDir()" and append your file location inside the mod folder.)
void loadStaticObjModel(String name, String modelLocation, String textureLocation)

 

 

ITEM SCRIPTING:

Spoiler


item example {		
	-- The flag that says this item should be equippable.
	Equippable = (TRUE / FALSE)		

	-- This is the designated spot the game will say your item is being equipped to.
	-- This can be anything you put. If you want it to interact with other mods,
	-- You simply use the same location name you put here.
	-- Locations are not case-sensitive.
	EquipLocation = Head		

	-- The name of your model goes here.
	-- You do not specify the gender, as ModelLoader already assigns and locates the proper gender model.		
	ModelEquipped = my_model_name,	
} 

 

 



ChangeLog:

Spoiler

V1.16_02:

Updated to 34.28.

 

V1.16_01:

Updated to 34.27. 

Removed the Equipment slot stuff until I can get a fix for multiplayer.

 


V1.15:

Removed the Lua folder due to multiplayer checksum mismatches.

Added a extension mod on the workshop and on the download for non-steam users. Enable this for custom equipment feature.

 

V1.14:
Added ability to equip items, showing models.

V1.13:
Updated to 33.19.

V1.12:
Updated to 33.14.

V1.11:
Updated to 32.30.

V1.10:
Updated to 32.27.
Code has been reverted for additional shader support for more weights due to glitches and not needing this anyways.
LuaManager API call 'getDir(MOD_ID)' added. Returns directory for mod. (This is for Steam too!).
Code cleaning.
Plans for recoding previous support for Clothing model mods.

V1.09:
Added Support for models with more than 4 weights per vertex (Limitation in Vanilla).
Progress on support for custom clothes. (Not done yet!) Bugged. Reverted the code.

V1.06:
Added Wavefront .OBJ support.

V1.05:
Updated to 32.
V1.00:
Initial Release.
Added Zomboid Model calls.

V0.99:
Additional Release.

Link to comment
Share on other sites

Updated the OP / First post.

 

So I have managed to modify the Lua portion of the code successfully, and also the model managing portions. So I've definitely made progress.

Link to comment
Share on other sites

Updated the OP / First post.

So I have managed to modify the Lua portion of the code successfully, and also the model managing portions. So I've definitely made progress.

Think it would be possible to override the character rendering to look for models instead of sprites? That'd really be all that's needed to allow for clothing additions.

Not the backpacks and headgear everyone wants, though.

Link to comment
Share on other sites

 

Think it would be possible to override the character rendering to look for models instead of sprites? That'd really be all that's needed to allow for clothing additions.

Not the backpacks and headgear everyone wants, though.

 

 

In this situation, I'd say the best route to take as far as the sprite stuff goes is to find a way to make our own sprites. Maybe this can be achieved using my soon-to-be-made model viewer. iirc, lemmy and binky made renders of things as sprite sheets, albiet a bit complicated as for each change to a character required a whole set of sprites for each difference and cosmetic component. This may be the exact reason why a move like model loading support has not been made yet. I believe the modding community can find a way around this issue. Maybe. 

Link to comment
Share on other sites

Think it would be possible to override the character rendering to look for models instead of sprites? That'd really be all that's needed to allow for clothing additions.

Not the backpacks and headgear everyone wants, though.

In this situation, I'd say the best route to take as far as the sprite stuff goes is to find a way to make our own sprites. Maybe this can be achieved using my soon-to-be-made model viewer. iirc, lemmy and binky made renders of things as sprite sheets, albiet a bit complicated as for each change to a character required a whole set of sprites for each difference and cosmetic component. This may be the exact reason why a move like model loading support has not been made yet. I believe the modding community can find a way around this issue. Maybe.

With the sheer magnitude of sprites its no doubt they're renders (otherwise whoever drew them is clinically insane). The problem with character sprites is that they're sheets of DDS files rather than PNG like everything else, which while they can be unpacked, no one has yet (I don't think) come up with a way of repackaging them in any usable way.

Maybe once animations are moddable, hopefully.

Link to comment
Share on other sites

Hey, so I am super excited about this but I get a crash error when I load up with this

 

NoClassFoundDefError:zombie/iso/areas/safehouse

The last line below that mentions your lua exposer and Java 800.

 

Am I doing something wrong here?

 

I tested this on a fresh install of 32.5.

 

Are you sure you are modding 32.4 or 32.5?

 

Build 31 does not have this class.

Edited by Jab
Link to comment
Share on other sites

 

Hey, so I am super excited about this but I get a crash error when I load up with this

 

NoClassFoundDefError:zombie/iso/areas/safehouse

The last line below that mentions your lua exposer and Java 800.

 

Am I doing something wrong here?

 

I tested this on a fresh install of 32.5.

 

Are you sure you are modding 32.4 or 32.5?

 

Build 31 does not have this class.

 

That would be it, I am not on the IWBUMS. So, that's a requirement then?

 

Edit: Confirmed the upgrade to IWBUMS cleared it up. Guess my mod will require build 32 now... totally worth it though

Link to comment
Share on other sites

  • 2 weeks later...

I took our dedicated server offline until this is updated so ORGM is working again.  Looking forward to an update soon!  Cheers!

 

EDIT:  Well, it appears the guns still work, they're just invisible so I've put the server back online.  Hopefully ModelLoader gets updated soon.

Link to comment
Share on other sites

Hello, I am trying to get this modelloader to work for ORGM But everytime i copy the zombie file to project zomboid file in steam/steamapps/common/projectzomboid the game starts up trys to load lua then closes with no crash just closes instantly. I have no other mods downloaded except ORGM don't know what i am doing wrong any suggestions of how i can fix this? Any help is much appreciated thanks =)

 

Found this in my project zomboid folder (error txt file) dont know if it helps

 

java.lang.ClassNotFoundException: zombie.gameStates.MainScreenState
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at com.exe4j.runtime.LauncherEngine.launch(Unknown Source)
    at com.exe4j.runtime.WinLauncher.main(Unknown Source)
 

Edited by Candyflip
Link to comment
Share on other sites

Hello, I am trying to get this modelloader to work for ORGM But everytime i copy the zombie file to project zomboid file in steam/steamapps/common/projectzomboid the game starts up trys to load lua then closes with no crash just closes instantly. I have no other mods downloaded except ORGM don't know what i am doing wrong any suggestions of how i can fix this? Any help is much appreciated thanks =)

 

Found this in my project zomboid folder (error txt file) dont know if it helps

 

java.lang.ClassNotFoundException: zombie.gameStates.MainScreenState

    at java.net.URLClassLoader$1.run(Unknown Source)

    at java.net.URLClassLoader$1.run(Unknown Source)

    at java.security.AccessController.doPrivileged(Native Method)

    at java.net.URLClassLoader.findClass(Unknown Source)

    at java.lang.ClassLoader.loadClass(Unknown Source)

    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

    at java.lang.ClassLoader.loadClass(Unknown Source)

    at com.exe4j.runtime.LauncherEngine.launch(Unknown Source)

    at com.exe4j.runtime.WinLauncher.main(Unknown Source)

 

 

What version are you running?

Link to comment
Share on other sites

Hey Jab,

 

I'm getting the following errors since 32.9 which I assume are related to function introduced to the LuaManager for the new crafting UI

 

Upon entering the game world

-----------------------------------------STACK TRACE-----------------------------------------function: populateRecipesList -- file: ISCraftingUI.lua line # 652function: createChildren -- file: ISCraftingUI.lua line # 599function: instantiate -- file: ISUIElement.lua line # 549function: addToUIManager -- file: ISUIElement.lua line # 822function: createInventoryInterface -- file: ISPlayerDataObject.lua line # 135function: createPlayerData -- file: ISPlayerData.lua line # 121java.lang.RuntimeException: Object tried to call nil in populateRecipesList        at se.krka.kahlua.vm.KahluaUtil.fail(KahluaUtil.java:91)        at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:947)        at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:162)        at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1722)        at se.krka.kahlua.vm.KahluaThread.pcallvoid(KahluaThread.java:1667)        at se.krka.kahlua.integration.LuaCaller.pcallvoid(LuaCaller.java:53)        at se.krka.kahlua.integration.LuaCaller.protectedCallVoid(LuaCaller.java:81)        at zombie.Lua.Event.trigger(Event.java:37)        at zombie.Lua.LuaEventManager.triggerEvent(LuaEventManager.java:112)        at zombie.gameStates.GameLoadingState.exit(GameLoadingState.java:338)        at zombie.gameStates.GameStateMachine.update(GameStateMachine.java:105)        at zombie.GameWindow.logic(GameWindow.java:624)        at zombie.GameWindow.run(GameWindow.java:1169)        at zombie.GameWindow.maina(GameWindow.java:977)        at zombie.gameStates.MainScreenState.main(MainScreenState.java:162)

When opening the menu

----------------------------------------function: onPressKey -- file: ISCraftingUI.lua line # 922-------------------------------------------------------------attempted index: view of non-table: null----------------------------------------------------------------------------------STACK TRACE-----------------------------------------function: onPressKey -- file: ISCraftingUI.lua line # 922java.lang.RuntimeException: attempted index: view of non-table: null        at se.krka.kahlua.vm.KahluaThread.tableget(KahluaThread.java:1544)        at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:471)        at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:162)        at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1722)        at se.krka.kahlua.vm.KahluaThread.pcallvoid(KahluaThread.java:1667)        at se.krka.kahlua.integration.LuaCaller.pcallvoid(LuaCaller.java:53)        at se.krka.kahlua.integration.LuaCaller.protectedCallVoid(LuaCaller.java:81)        at zombie.Lua.Event.trigger(Event.java:37)        at zombie.Lua.LuaEventManager.triggerEvent(LuaEventManager.java:83)        at zombie.input.GameKeyboard.update(GameKeyboard.java:51)        at zombie.GameWindow.logic(GameWindow.java:564)        at zombie.GameWindow.run(GameWindow.java:1169)        at zombie.GameWindow.maina(GameWindow.java:977)        at zombie.gameStates.MainScreenState.main(MainScreenState.java:162)-----------------------------------------STACK TRACE-----------------------------------------function: onPressKey -- file: ISCraftingUI.lua line # 922

When I click the crafting UI button 

------------------------------------------------------------attempted index: setDoLuaKeyPressed of non-table: null-----------------------------------------STACK TRACE-----------------------------------------function: setVisible -- file: ISCraftingUI.lua line # 21function: toggleCraftingUI -- file: ISCraftingUI.lua line # 907function: onOptionMouseDown -- file: ISEquippedItem.lua line # 71function: onMouseUp -- file: ISButton.lua line # 55java.lang.RuntimeException: attempted index: setDoLuaKeyPressed of non-table: null        at se.krka.kahlua.vm.KahluaThread.tableget(KahluaThread.java:1544)        at se.krka.kahlua.vm.KahluaThread.luaMainloop(KahluaThread.java:471)        at se.krka.kahlua.vm.KahluaThread.call(KahluaThread.java:162)        at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1722)        at se.krka.kahlua.vm.KahluaThread.pcall(KahluaThread.java:1637)        at se.krka.kahlua.integration.LuaCaller.pcall(LuaCaller.java:63)        at zombie.ui.UIElement.onMouseUp(UIElement.java:874)        at zombie.ui.UIElement.onMouseUp(UIElement.java:836)        at zombie.ui.UIManager.update(UIManager.java:1065)        at zombie.GameWindow.logic(GameWindow.java:581)        at zombie.GameWindow.run(GameWindow.java:1169)        at zombie.GameWindow.maina(GameWindow.java:977)        at zombie.gameStates.MainScreenState.main(MainScreenState.java:162)-----------------------------------------STACK TRACE-----------------------------------------function: setVisible -- file: ISCraftingUI.lua line # 21function: toggleCraftingUI -- file: ISCraftingUI.lua line # 907function: onOptionMouseDown -- file: ISEquippedItem.lua line # 71function: onMouseUp -- file: ISButton.lua line # 55
Link to comment
Share on other sites

Hey there,

 

I´m using latest version of PZ (32.9) and your 1.01 version together with ORGM (1.235).

My problem is, as soon as my girlfriend wants to join a game in splitscreen mode she can´t use the Gamepad anymore.

It reacts, allows her to select her char and join the game, but the buttons on the pad stopp working. Only thing possible is using left stick to run arround and the button to add a new player (even after she is in the game and controls her char, she can select "add a new player")

When I copy over my backup of the "zombie" folder your plugin replaces or adds stuff to, it works all fine again... exept no guns are shown in ORGM´s mod...

 

Is there anything I can do for now, besides getting used to invisible guns?

 

Thnx in advance

Link to comment
Share on other sites

Version of the mod? or the version of the game? Game version: 31.13 on steam, Version: ORGM 1.235 And Version: Lua extendor v1.01

 (sorry for late reply but the problem still persists) Thanks for the relpy too, really wanna get this to work.

Link to comment
Share on other sites

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