So now we know that we can call Java methods from our lua code, but we still don't know how we actually execute our lua code. In the course of this tutorial I will mark methods we call from java so you don't have to worry too much about that at the moment.Įggplanticus also released a good tutorial on how to decompile the java source over here. It has a useful search function that can search through the whole source code. I use a small programm called JD-GUI for that purpose. If you want to be on the save side I suggest that you open the source code and look through it yourself. It's basically a complete list of all methods in the Java source code and it has even been updated to 2.9.9.15 recently. We can access it through lua.īut how do we know which methods there are!? Well, we can look at the javadoc. getSpecificPlayer() is a public method defined in the java source code With lua we can access all the public functions written in the Java source code. That's where the connection between lua and the java source code happens. As mentioned in the previous chapter the main base of Project Zomboid was written in Java. Lua's main purpose lies on extending existing programs written in other programming languages. To mod the game we somehow have to interact it. Okay now that we got that out of the way let's move on to the actual modding part. If you have further questions you can post them in the modding help section of the the indiestone forums and one of the many coders will help you for sure. If there is one thing I don't like then it's people who don't even take the time to read through the tutorial notes, then copy&paste the code and finally spam the thread with questions about "why it doesn't work".ĭon't be that person (unless you are Rathlord).įor more tutorials you should visit and the tutorial section on the indiestone forums. If you don't understand parts of my code, you probably should learn some basic lua syntax first. It will be a tutorial about modding Project Zomboid. Just to be as clear about this as possible: This won't be a tutorial about lua. From time to time I check the lua wiki and of course stack overflow. I mainly used the official manual to learn the language, but of course there are many other great tutorials out there. If you have some experience with programming already Lua will probably be fairly easy to pick up for you. None of them will turn you into a RobertJohnson over night, they only make your life easier. Remember: It's not the program that does the work. Find one that works for you and stick with it. There are other free alternatives like gedit, Notepad++, ZeroBraneStudio or XCode for example. I prefered working with Eclipse IDE with an extra lua plugin installed for quite some time, but recently switched to IntelliJIdea - haven't been looking back ever since. While it is possible to create a script with those programs they miss many features a specific IDE will give you (syntax-highlighting, auto-formatting, etc.). So Wordpad (Windows) or TextEdit (Mac OS) will do. While we will cover some of the basics of the scripting language we will mostly work with lua coding.īasically to edit a lua file you can use any standard text editor that is capable of saving simple (unformatted) text files. Scripting: At the moment it is only used for easily adding items to the game.If you really want to get into modding, you won't get around learning its syntax. Lua: There already are parts of the source of PZ that have been ported to lua.Eggplanticus has made a nice post about how to spelunk in the Java source if you want to try it nonetheless. According to the developers changing the java source code won’t be necessary in future versions of Project Zomboid, so we won’t look into that. While you can modify the java files it is not recommended.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |