ThyHolyNoodle Posted June 15, 2019 Share Posted June 15, 2019 Hello I've been trying to mod PZ for the past week but I've been having some trouble with some of the functions such as setInf(); (might misspell some of them but they don't work) while others such as RestoreHealth(); do work. If anyone knows where I can get the latest API for the latest build (or better yet build 41), that'd be awesome. Link to comment Share on other sites More sharing options...
Fenris_Wolf Posted June 15, 2019 Share Posted June 15, 2019 Assuming you mean the latest API documentation (the API is the exposed code, which is included with pz), there isn't any. The online sources for the java components are horribly out of date (by several years) and quite honestly of limited use anyways as there's no actual documentation on the functions, classes or methods. Just the arguments and return values types. For the java component's API, your best bet is to install a decompiler such JD-GUI and browse the source directly. Its much easier to see what classes and functions are exposed to the lua component, as well as the expected arguments and return values. Browsing the API this way will make sure its up-to-date, and offers far more insight to the classes and methods then the old online documentation. Link to comment Share on other sites More sharing options...
ThyHolyNoodle Posted June 15, 2019 Author Share Posted June 15, 2019 What files would I be decompiling exactly? Link to comment Share on other sites More sharing options...
Fenris_Wolf Posted June 15, 2019 Share Posted June 15, 2019 The .class files in the projectzomboid/zombie directory zombie/Lua/LuaManager.class is a excellent starting point, as it will list all exposed java classes, and global functions provided by java to the lua component. If you use JD-GUI just pick any .class file and it will allow easy viewing of all of them Link to comment Share on other sites More sharing options...
ThyHolyNoodle Posted June 15, 2019 Author Share Posted June 15, 2019 (edited) Also how do I launch jd-gui when I can't even find the “jd-gui-x.y.z.jar” file, much less the “jd-gui.exe” file. Or Better yet what are you using in that image? Edited June 15, 2019 by ThyHolyNoodle Link to comment Share on other sites More sharing options...
Fenris_Wolf Posted June 15, 2019 Share Posted June 15, 2019 https://github.com/java-decompiler/jd-gui/releases/download/v1.5.1/jd-gui-windows-1.5.1.zip there should be a windows .exe in that release Link to comment Share on other sites More sharing options...
ThyHolyNoodle Posted June 15, 2019 Author Share Posted June 15, 2019 (edited) Thanks a million. One last thing, would you happen to know where the bitten functions are off the top of your head? Nevermind Thanks Edited June 15, 2019 by ThyHolyNoodle Link to comment Share on other sites More sharing options...
ThyHolyNoodle Posted June 16, 2019 Author Share Posted June 16, 2019 Wait so what exactly am I looking for? I don't understand how I can use any of this. I mean I'm sure the information is somewhere in there and it is the latest but I don't know what I am supposed to use. Right now I am trying to find what I can put after "Events." What I am currently trying to make is a cure that makes use of the largely useless skill "first aid." So far I have function Itemcool() local inv = getPlayer():getInventory(); local player = getPlayer(); it = inv:FindAndReturn("MC.myfoods"); if it then getPlayer():Say("I have the cure"); local BP; BP = player:getBodyDamage(); BP:RestoreToFullHealth(); end end Events.OnFillInventoryObjectContextMenu.Add(invContextMenu); But that last line makes it so that it restores health if you right click on anything in your inventory. So if you could help me understand my way on navigating my way around that'd be great. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now