Jab Posted June 5, 2015 Posted June 5, 2015 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. Leoquent, Oneline, Mr_Sunshine and 16 others 19
Fuji Posted June 6, 2015 Posted June 6, 2015 Best of luck to you! I tried to do this exact thing, but I ran into issues with incomplete decompilation, and no bytecode editors having support for using classes as constants which Kahlua requires. Jab 1
Jab Posted June 6, 2015 Author Posted June 6, 2015 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.
Fuji Posted June 7, 2015 Posted June 7, 2015 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.
Jab Posted June 7, 2015 Author Posted June 7, 2015 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.
Fuji Posted June 7, 2015 Posted June 7, 2015 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. Jab 1
Jab Posted June 7, 2015 Author Posted June 7, 2015 Initial version released with an example. I'll go ahead and test this for the current IWBUMS.
Break-Off Posted June 7, 2015 Posted June 7, 2015 This is awesome! Can't wait to see this implemented and used by modders. Props to you, Jab!
ORMtnMan Posted June 7, 2015 Posted June 7, 2015 Hey, so I am super excited about this but I get a crash error when I load up with this NoClassFoundDefError:zombie/iso/areas/safehouseThe last line below that mentions your lua exposer and Java 800. Am I doing something wrong here? Rabisco 1
Jab Posted June 7, 2015 Author Posted June 7, 2015 (edited) Hey, so I am super excited about this but I get a crash error when I load up with this NoClassFoundDefError:zombie/iso/areas/safehouseThe 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 June 7, 2015 by Jab
ORMtnMan Posted June 7, 2015 Posted June 7, 2015 Hey, so I am super excited about this but I get a crash error when I load up with this NoClassFoundDefError:zombie/iso/areas/safehouseThe 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
ORMtnMan Posted June 19, 2015 Posted June 19, 2015 Jab! Please update for the 32.7! It just updated and killed my mod via the ModelLoader...
Jab Posted June 19, 2015 Author Posted June 19, 2015 Jab! Please update for the 32.7! It just updated and killed my mod via the ModelLoader... Will get it later today. fluffe9911 and ORMtnMan 2
Wilson Posted June 19, 2015 Posted June 19, 2015 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. Jab 1
Reblar Posted June 19, 2015 Posted June 19, 2015 Does this have to be updated every single time there's a IWBUMS patch then?
ORMtnMan Posted June 19, 2015 Posted June 19, 2015 Does this have to be updated every single time there's a IWBUMS patch then? Probably anytime they change the LUAmanager class Such is the terror of modding a game still in Alpha/Beta Jab 1
Jab Posted June 20, 2015 Author Posted June 20, 2015 Updated. Also, feel free to distro this mod if you need to. ORMtnMan 1
Wilson Posted June 20, 2015 Posted June 20, 2015 Thanks for the speedy update, Jab. ORGM is looking good once again!
lorneagle Posted June 21, 2015 Posted June 21, 2015 Hey Jab, I switched ZomboidXBow to your your modloader and it's now beautifully compatible with ORMtnMan's Real guns. Awesome work!! Everyone with custom models in their mod should use this. ORMtnMan 1
Candyflip Posted June 24, 2015 Posted June 24, 2015 (edited) 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 June 24, 2015 by Candyflip
Jab Posted June 24, 2015 Author Posted June 24, 2015 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?
lorneagle Posted June 24, 2015 Posted June 24, 2015 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 # 922When 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
Jab Posted June 24, 2015 Author Posted June 24, 2015 LuaManager did have an update. Will push an update sometime within the next day.
JaRu Posted June 25, 2015 Posted June 25, 2015 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
Candyflip Posted June 25, 2015 Posted June 25, 2015 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.
Recommended Posts