Jump to content

badtrix

Member
  • Posts

    36
  • Joined

  • Last visited

Everything posted by badtrix

  1. @dred: i got b26 too now, so i will make the mod b26 ready in the next days, depending on how much has to be changed. @aznhavsarz: do the boxes only appear when you activate my mod? I.e., when you deactivate it, is the save game loading correctly? because basically i did not change anything with respect to loading/displaying objects.
  2. @b133d: yeah, some of the objects you listed are already on my todo-list, like more container objects (shelves etc.), different walls, doors, floors, fences, railings etc. @dred: thanks, will go through that thread when i start with spikes. however, i did not upgrade to b26 yet, so i can not help you with that issue. this mod is only tested for b25. but as you just dont see the textures i guess it has something to do with the way the textures are set in b25/26. will take a look at the b26 drip irrigation mod though and check what is different. if possible, i will change it for next version, but it has to be compatible with b25 for the moment. @monkey: i thought more about a "water ditch", which you could also use to make a fire ditch, like by adding some log and light them up
  3. HOTFIX 0.2.2 online! - added the suburbsdistribution file for the materials gasbottle, gasbottlebbq, tool set and steel pipe. so you are finally able to find those items and start crafting - added new custom texture for "cellar" @aznhavsarz: strange, i just loaded a save game i made with an early version of the mod and for me nothing gets screwed up. are you sure you use build 25? because if you use another version, it could be that the IsoThumpable.class file is not compatible (maybe some function names changed etc.). an indication that you might use an older version is that you dont find screws. i think they were first implemented in build 25. EDIT: i just checked original suburbsdistribution file, and as far as i see screws can only be found in tool stores (you will find boxes of screws in shelves and counters there). i will add more possibilities with the next version, thought they are more common. Maybe i just looted tool stores very early PS: could you please try to take a screen shot at day next time? @monkey: so far i did not take a look at the fighting system, and im not sure if world objects can do other than fire damage by default (i spent more time modding than gaming so far, so i dont know if there is any other type of damage objects can do). But i like the idea of spikes etc, although i dont think you need them anymore once you built a concrete/brick wall however, i will have a look at a possibility to implement spikes etc., but maybe not before version 0.3 or 0.4. also i thought about implementing a possibility to dig water ditches which you can either fill by hand ( ), by water supply system (as long as it runs), by rain, or by connecting ditches to another waterbody like a lake or a pond. water ditches would be able to keep zombies away from your area, though the water would not be drinkable. however, this is also something for v0.3 or 0.4 maybe.
  4. oh damn, just noticed i forgot to add the distribution file for the toolbox, gas bottle etc. unfortunatly i do not have time right now, but will upload a fixed version tomorrow.
  5. @b133d: of course, tell me whatever you like if the ideas are usable/desirable/realizable i will implement them sooner or later.
  6. hm, looks like i should have better followed my own rule to first check existing lua files/mods before posting... guess i found the solution in the drip irrigation mod
  7. i was just about to post you an idea on how to destroy walls etc., but i have no idea on how to check for admin. But i came across a function called isClient() in ISInventoryTransferAction.lua, maybe there is a similar function to check if isServer(). But i did not check what isClient() actually does, so this might also totally wrong what im posting
  8. The game resources are your best friend sejemus. When i started with lua coding/modding a few weeks ago, i did not read a single tutorial (at least until i had to know about available events, etc.). What i did was analyzing the lua files of the AddBuilding mod, and when i got a basic understanding of the files involved i started with my own mod, learning step by step what i needed. So here's what i would do in your case. First, as RoboMat has suggested too, look if there is a mod which has a similar function (e.g. adds an item using batteries). If there is one, analyse that mod. If there is no similar mod, then search the orignal lua file which handles the add/remove battery to flashlight. Most likely the important steps are done by java functions (you find most of them here: http://theindiestone.com/zomboidjavadocs/), but there will be a lua file which at least triggers the event. Look in files like ISContextMenu (or how they all are called), or use WinGrep to scan all lua files for keywords like "battery". Study that lua file, look what other files are involved etc. then start rebuilding that file by copy pasting the parts you need and modifying them so they do what you want them to do. Dont forget to give them different names so they dont override the original game files (if you dont need them to do so explicitly). EDIT: i helped you a little bit by scanning the lua files for "battery". here's the result, you might want to check those files mention below first. media\lua\client\BuildingObjects\ISUI\ISBuildMenu.lua media\lua\client\ISUI\ISWorldObjectContextMenu.lua media\lua\server\Items\SuburbsDistributions.lua media\lua\server\recipecode.lua media\lua\shared\Translate\EN\Tooltip_EN.txt media\lua\shared\Translate\Recipes_empty.txt
  9. @monkeydoGames: to read the .class file, you will have to decompile it first into a .java file (then its good readable ). To decompile, i used this freeware: http://jd.benow.ca/, it also gives you a good overview of the whole java architecture. what i changed is the following: original source code: public void setIsContainer(boolean pIsContainer) { this.isContainer = pIsContainer; if (pIsContainer) { this.container = new ItemContainer("crate", this.square, this, 6, 6); this.container.setExplored(true); } }modified source code: public void setIsContainer(boolean pIsContainer) { KahluaTable containerTable = this.table; this.isContainer = pIsContainer; String contname = containerTable.rawget("name").toString(); if (pIsContainer) { if (contname.equals("Cellar")) { this.container = new ItemContainer("preserve", this.square, this, 6, 6); this.container.setExplored(true); } else { this.container = new ItemContainer("crate", this.square, this, 6, 6); this.container.setExplored(true); } } }without the changes to the IsoThumpable.class, i would not have been able to create a container of the "type" preserve and i would have had to code a work around which would have been buggy as hell. EDIT: next version will have a modified function, where i do not compare the name of the object but add a new parameter to the KahluaTable called "preserve" or something like this... will make it easier to implement more objects with the same function... Edit2: @Adapt: atm i use 3 different categories for food preserving, each with different times DaysFresh and DaysTotallyRotten (check my post about this mod Effects/Functions -> Preserve -> see full list for all items implemented at the moment). The 3 categories are Vegetables (22 food items implemented so far, stats while in "Preserve" object: DaysFresh: 300, DaysTotallyRotten: 600)Prepared Foods/Meat (37 food items implemented so far, stats while in "Preserve" object: DaysFresh: 100, DaysTotallyRotten: 200)Cheese (1 food item implemented so far, stats while in "Preserve" object: DaysFresh: 1'000. DaysTotallyRotten: 2'000)I know some times seem very unrealistic (meat, or eg. soup stays 100 days fresh in the cellar), while others have a more realistic base (like vegetables). this will need a lot of rebalancing in the future. basically i could have set the times to 10k days, so items would always stay fresh in the cellar. but i wanted to keep it at least a little bit realistic. let me know what you guys think would be good parameter values so i can find a good balance on the long term. Pot-in-pot system was not implemented because of the lack of a usable texture.
  10. Does anyone know if it is possible to add custom textures for world objects? For items you have the possibility to put the textures named like Item_Something.png into the mods texture folder. but for worldobjects it does not work, as the textures are set differently. i have seen that NakedSkin mod today which adds new character textures, but i have no idea how to do that for objects. Anyone has an idea? thanks a lot
  11. you still need also metal for some objects, however you do not need recycling mod anymore to get that resource (you are still able to recycle e.g. pots or knives to get metal or pieces of metal). yeah, a save fireplace might be something to do next, but first i think i will add some more objects to the mod, different walls etc. and also add more food items that can be preserved. and maybe then i will make this mod B26 SP and MP ready. however this has not my highest priority right now. if you notice any bugs or issues with the preserve function please let me know as i didnt test it for all items added.
  12. New version 0.2.1 uploaded! I added the object "Cellar", which allows you to store perishable food much longer than normally without rotting. Check the Changelog above for all details. Further, you do not need Recycling Mod anymore (yay).
  13. well, next version will be a standalone version, meaning you will not need the recycling mod anymore. so i do not plan to use further mods' resources, objects etc., as everyone who wants my mod would also needs the other mods, and there is no guarantee that they will be kept up-to-date by their authors etc. however i will implement new objects like forge, food preserving storage objects,etc. in future versions too. but to come back on baking clay bricks: you actually do not need to bake them, you can make clay bricks by simply drying them outdoor (winter might not be the best time though). but i will implement new features
  14. another great thing would be if mods would be allowed to use java too. so like for lua files, it would be great if modders could add .class files to the specific mod folders (e.g. zombie\iso\objects) which would override original game classes if named the same. else one would have to replace original game files if a mod needs to alter some classes.
  15. i would love if you could add something like this to your IsoThumpable. class: public IsoThumpable(IsoCell cell, IsoGridSquare gridSquare, String sprite, boolean north, KahluaTable table, String type)Where "String type" is the ItemContainer type. By default, all container created are of the "crate" type. Thus the following function would need a change too (instead of "crate", this.type or something like this). public void setIsContainer(boolean pIsContainer) { this.isContainer = pIsContainer; if (pIsContainer) { this.container = new ItemContainer("crate", this.square, this, 6, 6); this.container.setExplored(true); } }Thus it would be great if i could create a new container with an own type like self.javaObject = IsoThumpable.new(cell, self.sq, sprite, north, self, "New type");
  16. badtrix

    Java Modding?

    This might sound like a stupid question, but i need to know it Is it possible to use java for mods? More detailed: For my mod i would need to make some changes to an existing .class file (see my other help thread http://theindiestone.com/forums/index.php/topic/7949-itemcontainerisoobject/). Now im wondering if i can add the altered .class file to my mod folder the same way i add lua files or scripts. do the rules for lua modding apply to java files too? i.e., if i create a directory in my mod folder named like this zombie\iso\objects (instead of media\lua\client etc.) and place the altered file in there, would the altered class be loaded when the mod loads and override the original game class file? or would i have to manually replace the .class file in the game directory in order to work? i hoped i would find a way to solve my problem with lua only, but as the last post in the above linked thread shows i do not see any other possibility...
  17. hey rainbow. thanks. yeah, i made about the same conclusions when trying to figure out how lua works. my notepad++ has around 10 open files at any time, and now i'm also using JD decompiler to view those .class files. To create a new (functional) window, i need to call this function: public IsoWindow(IsoCell cell, IsoGridSquare gridSquare, IsoSprite gid, boolean north)However, i just need to find out how to create the needed IsoSprite parameter But the problem of altering data of worldobjects is still actual in a similar way, as i run into a similar issue: http://theindiestone.com/forums/index.php/topic/7949-itemcontainerisoobject/ Problem is i really do not know how to solve that without altering .class files, which i guess is not possible to implement in mods
  18. ok, i found the specific java classes and functions which is responsible for my problem: from IsoThumpable.class public void setIsContainer(boolean pIsContainer) { this.isContainer = pIsContainer; if (pIsContainer) { this.container = new ItemContainer("crate", this.square, this, 6, 6); this.container.setExplored(true); } }what i am wondering now, is it possible to do java modding, like to alter the original IsoThumpable.class and implement it into my mod? else i do not see how i could change the type from "crate" to "preserve".
  19. thanks RoboMat. Well, i already tried your suggestion for Windows objects last week (as they would need to be of the class IsoWindow instead of IsoThumpable to be functional). However, it did not work because it seems there is no IsoWindow.new() or ItemContainer.new() function. Basically what the problem with the IsoThumpable class is, is that it was coded to work with the buildable objects implemented in the original build 25. Thus it offers only the functions needed to create those objects. however if you want to do new stuff and implement objects with functions which havent been implemented in original game yet it gets difficult. To have alook at the java source code would be nice, but actually i do not know where to look (didnt had to do with java coding for the past 10 years i guess)? do i have to open all .jar files in the main game directory to find the IsoThumpable.new() function? or to formulate my problem in easier words with less code, thats what i want to do (just wrote that code without testing, maybe this might work): function BMContainer:create(x, y, z, north, sprite)-- get the tile we want to build our objectlocal cell = getWorld():getCell();self.sq = cell:getGridSquare(x, y, z);-- now create the objectself.javaObject = IsoThumpable.new(cell, self.sq, sprite, north, self);-- now get the ItemContainer on the same square x, y, z and setType()-- (IsoThumpable somehow creates the object as an ItemContainer)-- however, i do not know how to get the container on that square. -- thats my main problemend
  20. Since hours I'm trying to get something for my mod (Building Mod) to work, but still it isn't. So i hope maybe someone else can help me. The problem is the following: The following code creates e.g. a gun locker, dresser etc: the problem is that i need to set a parameter for that newly created object "self.javaObject" in the BMContainer:create() function, which i dont know how to do. The parameter to be set belongs to the class java.lang.Objectzombie.inventory.ItemContainer more specific, i need to set the "type" parameter, which can be done with the setType() function offered by the ItemContainer class. However, i do not know how to properly call that function, because the object created (self.javaObject) in the BMContainer:create() function belongs to the class java.lang.Objectzombie.iso.IsoObject zombie.iso.objects.IsoThumpable Further Explanation: It would be awesome if someone could tell me how i can call that setType() function so i can alter the type for the newly created item. And i hope i could explain my problem in an understandable way
  21. with this loop, is it also possible to change properties of already existing world objects? like the IsoObject type, or specific settings like isHoppable or isDoor? Because for my building mod i would require to create windows as "IsoWindow" to make them functional. however, build 25 creates all new worldobject by default as "IsoThumpable". As this step is done with java functions, i can not tailor them to my needs. and last question: are there any more detailed informations about that?
  22. oh, so you mean you want buildable objects to preserve food? Well, thats a very good idea. like a smoke box to conserve meat, or a way to preserve them by using salt. Pot-in-pot seems to have quite low storage capacity though but what about digging a cellar where its always cool and thus extends food durability by a few months (by cellar i do not mean an actual room where you can walk in and place other racks but a single or double tile objects with the texture of a hatch and storage possibility)? however, there are two problems: Textures: I did not implement any own textures yet, so im not sure how good this works. also, im really bad at making textures. for resources i basically just took a foto of google and used some photoshop filters so if there is someone out there who 1) can make textures and 2) is willing to allow me to use them in my mod, i can give it a try.Available java functions: the bigger problem will be what the game currently offers me in terms of java functions. if there is a possibility to change durability/storability with lua funcions, then i will be able to do so. if not, i will have to make a workaround (probably by making a cellar with the properties of a refrigerator which has always power). however, not sure if this would work. extending meats duarbility should be easy though, i just need to add new foods (like cured or smoked meat) and change their properties.But i will give it a try. So please let me know if you (whoever is reading this) want to make some textures for my mod.
  23. What do you mean by pot-in-pot storage system? If i would now what this is, i could think about implementing it
  24. well, thats some good point you bring in dred/dr_cox. i basically used the recycling mod because it allowed me to use resources without creating them myself. but i also noticed the author wasnt online for a while. so yes, i might remove the recycling/RMUtilities mods from my mod (so it becomes a standalone mod) for next version and implement an own metal resource (or maybe i will just implement parts of the recycling mod into my mod and upgrade them recently). Ramibuk (author recycling mod) allowed to used his mod in any way. so i will think about what is best solution and will implement it in this weekends update (maybe on sunday evening).
  25. New version v0.2 is online. Make sure to upgrade your current version to get all the new features (see changelog above). Edit: Please let me know when you discover any bugs or problems so i can fix them for next version.
×
×
  • Create New...