Jump to content

turbotutone

The Indie Stone
  • Posts

    212
  • Joined

  • Last visited

Reputation Activity

  1. Like
    turbotutone got a reaction from Dr_Cox1911 in Local Chat - How does it work?   
    Didnt read properly btw and misread you were looking for LOCAL
     
    By the reference JonSyn gave, the :Say() method can be found in IsoGameCharacter:

    As seen uses sendChat in GameClient. However i wasnt able to quickly spot the part that handles reception of these messages, i.e. theres no receiveChat() so probably handled somewhere inside a method.
     
    EDIT:
    private void mainLoopDealWithNetData(ZomboidNetData d)

     
    Chat()

     
    Regards,
    Turbo
  2. Like
    turbotutone got a reaction from FinchEz in References: LuaMethods, Events, Exposed Classes   
    Made a little alphabetically sorted cheat sheet for stuff mentioned in title, thought id share for whomever it is usefull.
     
    Events:
    (note a reference can also be found here (not done by me), albeit a little outdated it has some more infos: http://pz-mods.net/guide/event-reference/ )


     
    LuaMethods:


     
    Exposed Classes:

  3. Like
    turbotutone reacted to Sejemus in Moding for build 25+ tutorial series (Status Update Nov. 24 - 2014)   
    Heya fellow survivors.
     
    In this thread I will write a tutorial series describing everything I know about moding for Build25+ so far.
    Please note that some of the information I supply is what I think and might not be 100% correct.
     
    I want to make this series as I want to get all the information in one place, and because I found it diffacoult to find all the information myself when I started.
     
    Part one: Folder Structure.  This is the folder structure as of Build 25 through 26.mymod: mod.info file, poster.png and all the icons your mod items use goes here. (NOTE: All icons MUST start with "Item_" like so: Item_iconname.png. Note the capital I, it's important)mymod/media/lua/client: Lua files in here are executed client side.mymod/media/lua/server: Lua files in here are executed server side. (NOTE: You ARE starting a server when you start a new sp world, so world gen stuff goes here EVEN ON SINGLEPLAYER!)mymod/media/lua/shared: I don't know the exact purpose of this folder, but I have noticed that it loads before the client and server files are loaded.mymod/media/scripts: Item and recipe scripts goes in here, just plain .txt files. That's what I know about the new folder structure so far. If you have changes or want me to add stuff, feel free to post below and let me know. Part two: mod.info The mod.info file is the most important file of any mod as it is the way to get the modloader to know it's a mod.The mod.info file contains this information:name=Name you will see in the mod listposter=poster.png (This is the image shown in the mod list)id=yourmodid (This is the id which the modloader reads when it is looking for mods that may requre this mod)require=mod1id, mod2id, etc. (This tells the modloader that this mod requires mod1 and mod2 where mod1id is the id of mod1 and alike with mod2)description=A description of your mod, what does it do?url=When you make your pzmods page for your mod you can add the link here. You can then access this link from the mod within the mod loading screen. That's about it for the mod.info. It may seem simple, and it is pretty simple. But it is also the most important file of your mod, so don't forget about it.  
    Part three: Simple Recipe Mod. Next up, I will teach you how to make your own recipes in your mod.It very simple, at least the way I do it. For this tutorial we will be adding two recipes.1. Dry towel2. Dry bathtowel All you have to do here is the following:1. Find the "mymod/media/scripts" directory.2. Find/make a new file called "yourmod_recipes.txt", or a better name if you are creative, and open it in your favorite text editor.3. Now for the "coding" part (Well, as the folder suggests, it's more scripting than actual coding here ) Start by adding the module (this is basicly the id of the recipes, if you ever need to include them. In another mod maybe.)module yourmod_recipes (or a better name){ <-- Remember these, those are most important! "Recipes goes here"}Now, import the items we will be working with, as we are using items from the base game, we will include the module "base". If you use moded items, you need to requre the mods items module here.module yourmod_recipes{ imports { <-- Again. remember these! Base } "recipes goes here"}Now we are adding the actual recipes. Don't worry, it'll be over very soon.module yourmod_recipes{ imports { Base } recipe Dry Towel <-- Recipe name, this will apear in the inventory when we rightclick a wet towel. { <-- And once again. remember these for each recipe DishClothWet, <-- Requires a wet towel, you can check the "Steam\SteamApps\common\ProjectZomboid\media\scripts" for item files in which the items are listed. Result:DishCloth = 1, <-- As you might have guessed, this is what the recipe will give you once it is done. Time:120.0, <-- And here is the time of the recipe (How long it will take in in-game seconds) } recipe Dry Bath Towel <-- Here I have added the same recipe, but for bath towels. { BathTowelWet, Result:BathTowel = 1, Time:120.0, }}NOTE: REMEMBER the "," after each line! 
    And that's it for the recipes! Yes, you are done.
     
     
    Part four soon to follow! So stay tuned for that. We'll take items next!
     
     
    ----
    Update: It's been a while, sorry about that. Honestly.. School have taken a lot of my time this year because I'll be graduating this summer, so I really wanted to give it everything I got. Anyway, enough of the boring blabbering.. I'll continue this guide in January and then see how much I can work on it from then. I'll also see if there has been any large changes in my other examples as I go.
     
    TL;DR: School, busy, continuing in January.
    ----
    -Sejemus
  4. Like
    turbotutone got a reaction from Dr_Cox1911 in Simple Lua OOP (without metatables)   
    Very neat and clean article!
     
     
    As for the performance, my 2 cents from memory ^^
    This approach gets its performance boost from upvalue variables from what ive gathered:
    function Test.new() local self = {}; local testvar = 1; -- <-- upvalue variable function self.printvar() print(testvar); endendwhich, if i recall correctly, are accessed faster then anything else. The only big con's would be:
    - More memory usage for a constructed object
    - Slower construction of objects
    - functions cannot be shared or accessed indepently as sugar syntaxed ones can
     
    In most cases neglectable, however, if you are creating loads of objects on the fly, you might want to stick to a tabled approach with sugar syntaxed functions.
    Also with inheritance, the local variables (upvalues) within your class are not shared with inherinting structures so subsequently you have to puzzle a bit to keep up the performance gain with inheritance .
     
    Another thing worth mentioning when it comes to performance perhaps, if you have lots of calls to one or more global functions within your class, for example:
    function Test.new() local self = {}; function self.printvar() return ZombRand(100) + ZombRand(100) + ZombRand(100); endendYou can save global table lookups by referencing ZombRand locally like:
    function Test.new() local self = {}; local myRand = ZombRand; function self.printvar() return myRand(100) + myRand(100) + myRand(100); endendwhich looks up ZombRand globally only once uppon creation and uses local reference on function calls.
  5. Like
    turbotutone got a reaction from SpaceJunk in Erosion - Nature takes over   
    So maybe i lied a little when i said i wouldnt continue this version before mp, however i wasnt sure yet at the time if the fix would work. But, it seemed it did, and it seems the version is stable

    To be clear: This is a SP only build that works with PZ build 26, MP is under construction still.

    Many kuddos to the following people:
    - RJ & Lemmy, for adding a event that was crucial to fixing that dreaded reload bug!
    - EnigmaGrey, for helping me out with decompile/recompile of java.
    - RoboMat, for allowing me to hack and slash parts from his lockpicking mod to quickly create the Sickle.

    And ofcourse Sir Twiggy! for having the balls to live test the mod without it being properly tested
    For those of you who missed out on, his last attempt of 100 days Erosion ended prematurly due to a big bug i failed to catch before releasing.

    Check out his channel if you havent already:
    http://www.twitch.tv/sirtwiggy/
    Hes currently on a challenge to survive atleast a 100 days with Erosion mod enabled, Part II.
     
     
    Download:

    Erosion Alpha v0.2 [sP-ONLY][PZ BUILD 26]

    * when activating the mod in the menu, make sure you restart your game once afterwards.


    Changelog v0.2:
    - Added, Thutzor sprites! Loads of winter stuff (roofs, snowed under vanilla objects), new bushes, more vines etc
    - Added, small background for time controls (better visible with snow)
    - Changed, a bunch of sprites (grass, small trees)
    - Changed, a bunch of stuff in seasonal color code.
    - Fixed, Erosion added trees can now be cut (with regular tools)
    - Fixed, All grass, and erosion bushes can be cut with new item: Improv Sickle (see below for recipe)
    - Fixed, the dreaded bug that firked up the world on reload.
    - Fixed, bug that would reset the time to december on reload.

    Possibly other things, but it seems i accidentally deleted my changelog file, if i remember more ill add later

    Improv sicke recipe
     
    Some screens @ full erosion:

     
    P.s. will update main post asap, its a mess and outdated with infos.
  6. Like
    turbotutone got a reaction from lordixi in Erosion - Nature takes over   
    So maybe i lied a little when i said i wouldnt continue this version before mp, however i wasnt sure yet at the time if the fix would work. But, it seemed it did, and it seems the version is stable

    To be clear: This is a SP only build that works with PZ build 26, MP is under construction still.

    Many kuddos to the following people:
    - RJ & Lemmy, for adding a event that was crucial to fixing that dreaded reload bug!
    - EnigmaGrey, for helping me out with decompile/recompile of java.
    - RoboMat, for allowing me to hack and slash parts from his lockpicking mod to quickly create the Sickle.

    And ofcourse Sir Twiggy! for having the balls to live test the mod without it being properly tested
    For those of you who missed out on, his last attempt of 100 days Erosion ended prematurly due to a big bug i failed to catch before releasing.

    Check out his channel if you havent already:
    http://www.twitch.tv/sirtwiggy/
    Hes currently on a challenge to survive atleast a 100 days with Erosion mod enabled, Part II.
     
     
    Download:

    Erosion Alpha v0.2 [sP-ONLY][PZ BUILD 26]

    * when activating the mod in the menu, make sure you restart your game once afterwards.


    Changelog v0.2:
    - Added, Thutzor sprites! Loads of winter stuff (roofs, snowed under vanilla objects), new bushes, more vines etc
    - Added, small background for time controls (better visible with snow)
    - Changed, a bunch of sprites (grass, small trees)
    - Changed, a bunch of stuff in seasonal color code.
    - Fixed, Erosion added trees can now be cut (with regular tools)
    - Fixed, All grass, and erosion bushes can be cut with new item: Improv Sickle (see below for recipe)
    - Fixed, the dreaded bug that firked up the world on reload.
    - Fixed, bug that would reset the time to december on reload.

    Possibly other things, but it seems i accidentally deleted my changelog file, if i remember more ill add later

    Improv sicke recipe
     
    Some screens @ full erosion:

     
    P.s. will update main post asap, its a mess and outdated with infos.
  7. Like
    turbotutone got a reaction from Thuztor in Erosion - Nature takes over   
    So maybe i lied a little when i said i wouldnt continue this version before mp, however i wasnt sure yet at the time if the fix would work. But, it seemed it did, and it seems the version is stable

    To be clear: This is a SP only build that works with PZ build 26, MP is under construction still.

    Many kuddos to the following people:
    - RJ & Lemmy, for adding a event that was crucial to fixing that dreaded reload bug!
    - EnigmaGrey, for helping me out with decompile/recompile of java.
    - RoboMat, for allowing me to hack and slash parts from his lockpicking mod to quickly create the Sickle.

    And ofcourse Sir Twiggy! for having the balls to live test the mod without it being properly tested
    For those of you who missed out on, his last attempt of 100 days Erosion ended prematurly due to a big bug i failed to catch before releasing.

    Check out his channel if you havent already:
    http://www.twitch.tv/sirtwiggy/
    Hes currently on a challenge to survive atleast a 100 days with Erosion mod enabled, Part II.
     
     
    Download:

    Erosion Alpha v0.2 [sP-ONLY][PZ BUILD 26]

    * when activating the mod in the menu, make sure you restart your game once afterwards.


    Changelog v0.2:
    - Added, Thutzor sprites! Loads of winter stuff (roofs, snowed under vanilla objects), new bushes, more vines etc
    - Added, small background for time controls (better visible with snow)
    - Changed, a bunch of sprites (grass, small trees)
    - Changed, a bunch of stuff in seasonal color code.
    - Fixed, Erosion added trees can now be cut (with regular tools)
    - Fixed, All grass, and erosion bushes can be cut with new item: Improv Sickle (see below for recipe)
    - Fixed, the dreaded bug that firked up the world on reload.
    - Fixed, bug that would reset the time to december on reload.

    Possibly other things, but it seems i accidentally deleted my changelog file, if i remember more ill add later

    Improv sicke recipe
     
    Some screens @ full erosion:

     
    P.s. will update main post asap, its a mess and outdated with infos.
  8. Like
    turbotutone got a reaction from Sieben in Erosion - Nature takes over   
    Well thank you
     
    also, check out:
     
    http://www.twitch.tv/sirtwiggy
     
    will update the thread later today with a download
  9. Like
    turbotutone got a reaction from Dr_Cox1911 in Erosion - Nature takes over   
    Well thank you
     
    also, check out:
     
    http://www.twitch.tv/sirtwiggy
     
    will update the thread later today with a download
  10. Like
    turbotutone got a reaction from Kyun in Erosion - Nature takes over   
    Well thank you
     
    also, check out:
     
    http://www.twitch.tv/sirtwiggy
     
    will update the thread later today with a download
  11. Like
    turbotutone reacted to RoboMat in Simple Lua OOP (without metatables)   
    Simple Lua OOP


    I
    II
    III
    IV
    V
    VI
    VII
    VIII


    I. Foreword

    I haven't written a tutorial in a while and since I had some free time I wrote a quick one Today's tutorial isn't specifically about PZ-Modding but about a simple approach to OOP in Lua. I'm not going to talk a lot about the technical details (if you understand those you probably don't need this tutorial anyway).

    We'll take a look at the closure–approach. That's the main approach I use when I write my own game projects. The good thing about it is that we don't need any of that crazy metatable stuff every serious lua programmer is constantly talking about.



    II. Basic Class

    We'll start with this class skeleton:
    Character = {};function Character.new() local self = {}; return self;endThis "Character" class serves as a public entry point which allows us to call the contained new() function from anywhere in our program (I'll call it class even if some people out there might be offended by that).

    The new() function can be compared to constructors that other OOP languages have. It creates a new object of type Character and returns it. While coming from the same class all those character objects will be totally independent from each other, which is awesome.

    The actual object is created with "local self = {}". This creates a table to hold all of the public information our object will have. I will explain this a bit more detailed in a moment. For now just note that "local self = {}" creates an (empty) object which is returned to the outside world at the end of the new() function via "return self".

    At this point we can already create a new character with this line:
    local hobbit = Character.new();Obviously our object is just an empty table and therefore pretty boring. So let's change that.



    III. Adding fields

    Let's add a public variable (or field if you will) to our class:
    Character = {};function Character.new() local self = {}; self.name = "Frodo"; return self;endNow, every object we create will have the name "Frodo", which we can access like this:
    local hobbit = Character.new();print(hobbit.name); -- prints "Frodo"This is still pretty straight forward. If you look at the hobbit object from the above example it doesn't really know anything about the Character class or even the new() function. All it knows is it"self". Therefore by storing name (or any variable) in the "self" table the object can access it.

    This leads us to our next example which displays nicely why you'd need objects in the first place and how awesome they are. Lets say we want to add a dwarf character then the following will happen:
    local hobbit = Character.new();local dwarf = Character.new();print(hobbit.name); -- prints "Frodo"print(dwarf.name); -- prints "Frodo"Dwarfs never are called Frodo so we need to change that. But how do we do that? If we change the "self.name" in Character.new() to something different then now the hobbit will have the wrong name. There are two ways to solve this (there might be more but we'll ignore them for now).

    We could use a parameter to determine the name of the the object upon it's creation:
    Character = {};function Character.new(name) local self = {}; self.name = name; return self;endThis would work like this:
    local hobbit = Character.new("Frodo");local dwarf = Character.new("Gimli");print(hobbit.name); -- prints "Frodo"print(dwarf.name); -- prints "Gimli"The other (sligtly easier) way would be to change the name directly like this:
    local hobbit = Character.new();local dwarf = Character.new();-- We can change the variables directly since they are public.hobbit.name = "Frodo";dwarf.name = "Gimli";print(hobbit.name); -- prints "Frodo"print(dwarf.name); -- prints "Gimli"If you are new to coding or OOP, this might confuse you, since we changed "self.name" which both objects obviously have (or else we'd get a nil reference). BUT as you can see, they are independent from each other. Basically EVERY object we create from the Character class will have its own name and we could set it to whatever we want without affecting the other objects.

    This is also still pretty easily explainable. Just remember that the Character.new() function creates a new table each time it is called, so if we add a variable to that table it of course only exists in there.



    IV. Adding a public method

    Now our object's already have cool names, but we them to do cool stuff to so we'll need functions. Since functions in lua are basically code hiding behind a variable name we can add them to the class like a public variable:
     
    Character = {};function Character.new(name) local self = {}; self.name = name; self.speak = function(words) print(words); end return self;endOr by using lua's syntactic sugar (which I highly recommend, since the syntactic sugar does a little more under the hood than just making it nicer to look at and saves you from a few pain-in-the-ass problems later on down the road):
    Character = {};function Character.new(name) local self = {}; self.name = name; function self.name(words) print(words); end return self;endWe now can make the hobbit speak like this:
    local hobbit = Character.new("Frodo");local dwarf = Character.new("Gimli");hobbit.speak("Damn it Gandalf!"); -- Will print "Damn it Gandalf"dwarf.speak("I hate elves!"); -- Will print "I hate elves"Now you basically already now enough to create a lot of different objects with all sorts of crazy behaviour. There still are a few more cool things I'd like to show you.



    V. Inheritance

    One, if not the most important aspect of OOP is Inheritance. Simply said, it just allows one object to inherit certain things from a parent (think about how parents pass on some characterstics like hair color etc. to their children).

    This example might show what that means in practise:
    -- Character class.Character = {};function Character.new(name) local self = {}; self.name = name; function self.speak(words) print(words); end return self;end-- Hobbit class.Hobbit = {};function Hobbit.new(name) local self = Character.new(name); self.hasRing = true; return self;end-- Dwarf class.Dwarf = {};function Dwarf.new(name) local self = Character.new(name); self.hasBeard = true; return self;endNote that we now have two new classes for hobbits and dwarfs. If you look closely at their new() functions they don't create a new table via "local self = {}". Instead they call the constructor of their parent class "Character", get the new table from that class and use it, to implement their own custom characteristics (hobbit's can have rings / dwarfs can have beards).
     
    local hobbit = Hobbit.new("Frodo");local dwarf = Dwarf.new("Gimli");print(dwarf.name) -- Gimliprint(dwarf.speak("Throw me over there!"));print(hobbit.hasRing) -- trueprint(hobbit.hasBeard) -- Causes error since the hobbit object doesn't know how have a beardObjects can even overwrite inherited behaviour from their parents like this:
    -- Hobbit class.Hobbit = {};function Hobbit.new(name) local self = Character.new(name); self.hasRing = true; function self.speak() print("I overwrite my parent's behaviour!"); end return self;end
    VI. Hiding from the world

    All the above examples had ome major flaw. All of their informations and implementations were public and therefore easily changeable from the outside. The explanation for why private variables are private isn't easy, but the implementation is:
    Character = {};function Character.new(name) local self = {}; local name = name; -- local / private variable function self.getName() if name then return name; else return "No Name"; end end return self;endThat's actually all it takes to hide a variable from the outside world.
     
    local hobbit = Character.new("Frodo")print(hobbit.name) -- can't access name directly -> nilprint(hobbit.getName()) -- prints "Frodo"Now you might ask yourself, why the hell this would be a good idea. Our example already shows one pro. We can make sure that the object has a name (for example if the programmer forgets to pass one along during the function call) or return "No Name" instead. Of course this is a highly artificial example but I hope it gets the point across

    The next question you should ask is how our objects can have seperate names now if they aren't stored in the "self" table anymore. Here comes the part which is a bit more complicated and I'll try to explain it as simple and as short as I can (if you want a more in-depth explanation take a look at this: http://www.lua.org/pil/6.1.html).

    The important word here is "closures". Basically what it comes down to is that a function can always "peek" outside of its own body and look at local variables of the function in which it is enclosed.
     
    local function enclosingFunction() local foo = 20; local function enclosedFunction() print(foo); -- can see foo from the enclosingFunction() endendIf you look back at our example from above, you can clearly see that Character.new() is the enclosingFunction() while self.getName() is the enclosedFunction() (of course there can be many more enclosedFunctions with access to name in our object). This means that as long as our object exists, the local variable "name" will live on and on and on ...
    Character = {};function Character.new(name) local self = {}; local name = name; -- local / private variable function self.getName() if name then return name; else return "No Name"; end end return self;endPersonally I rarely use public variables and instead write getters and setters if they are needed. It just feels cleaner to me, that I have total control over how and when the variable of an object changes.

    I admit that this is a pretty short and non-technical explanation, but trying to explain it in detail is far beyond the scope of this (easy) tutorial. If you really wanted to understand it you'd need to also know about the stack and how memory is handled and all the other boring (well actually it is really interesting) stuff.



    VII. Performance

    Since performance apparently is very important in game programming another question might be how fast this approach is compared to all the others. My answer is: I don't know and frankly I don't care

    This article suggests that it might be faster, some others suggest it is not, but in the end the difference is probably neglectable anyway.



    turbotutone posted some nice info about performance here.


    VIII. Using Modules

    !Note: This won't work in PZ since the require function is broken!

    I just want to add another section on how to use the classes as proper modules. Up until now all of our classes were stored in a global table and therefore accessible anywhere in our program.

    To do this we have to make the table local and return it at the end of the file:

    local Class = {};function Class.new() local self = {}; -- Code ...
 
 return self;endreturn Class;Now if we want to use it in a different file we will have to "require" it first:
    -- Load the module.local Foo = require('path/to/Class');-- Use the module as before:local object = Foo.new();That's all we have to do.
  12. Like
    turbotutone got a reaction from Austin in Erosion - Nature takes over   
    The idea
     
    To slowly have the map detoriate over time, nature grows wild and the urban areas slowly decay.
     
    What will the mod do?
     
    Currently the planning is for Erosion to add the following effects to the game:
     
    Plantlife:Nature will slowly start to take over, popping up on natural tiles. Currently plants have 6 stages (low grass to tree), only the most fertile spots will reach the maximum. Random special objects with a very low chance of spawning (imagine a dead campfire and the likes). Streets:Big cracks in the road that gradually become more intense. Patches of cracked road where grass and stuff grows through. More litter and garbage appearing over time. Random special objects with a very low chance of spawning (a pile of zombie corpses for example). Houses (exterior):Cracks that can appear on over time. Vines that slowly takover a part of a wall. Windows have a chance to be broken over time (idea by RobertJohnson) Doors have a tiny chance to pop open at some point. Random stuff like smudges and what not.  
     
    Textures by Thutzor
     
    Thutzor will be doing the extensive list of additional artwork for the mod. Thank you Thutzor!
     
    build 27 version:
    pz build 27 click here
    Post 25 march 2014 steam update:
    pz build 26B click here
    Pre 25 march 2014 steam update:
    pz build 26A click here
     
    Download Erosion Alpha 0.1
     
     
    Modding Erosion
     
    Videos
     
    Screenshots
     
    Screenshots Archive
    Outdated screenshots from the very first functional version:
  13. Like
    turbotutone got a reaction from Brybry in References: LuaMethods, Events, Exposed Classes   
    Made a little alphabetically sorted cheat sheet for stuff mentioned in title, thought id share for whomever it is usefull.
     
    Events:
    (note a reference can also be found here (not done by me), albeit a little outdated it has some more infos: http://pz-mods.net/guide/event-reference/ )


     
    LuaMethods:


     
    Exposed Classes:

  14. Like
    turbotutone got a reaction from TheOfficialStinger in References: LuaMethods, Events, Exposed Classes   
    Made a little alphabetically sorted cheat sheet for stuff mentioned in title, thought id share for whomever it is usefull.
     
    Events:
    (note a reference can also be found here (not done by me), albeit a little outdated it has some more infos: http://pz-mods.net/guide/event-reference/ )


     
    LuaMethods:


     
    Exposed Classes:

  15. Like
    turbotutone got a reaction from JonSyn in References: LuaMethods, Events, Exposed Classes   
    Made a little alphabetically sorted cheat sheet for stuff mentioned in title, thought id share for whomever it is usefull.
     
    Events:
    (note a reference can also be found here (not done by me), albeit a little outdated it has some more infos: http://pz-mods.net/guide/event-reference/ )


     
    LuaMethods:


     
    Exposed Classes:

  16. Like
    turbotutone got a reaction from Dr_Cox1911 in References: LuaMethods, Events, Exposed Classes   
    Made a little alphabetically sorted cheat sheet for stuff mentioned in title, thought id share for whomever it is usefull.
     
    Events:
    (note a reference can also be found here (not done by me), albeit a little outdated it has some more infos: http://pz-mods.net/guide/event-reference/ )


     
    LuaMethods:


     
    Exposed Classes:

  17. Like
    turbotutone got a reaction from Viceroy in References: LuaMethods, Events, Exposed Classes   
    Made a little alphabetically sorted cheat sheet for stuff mentioned in title, thought id share for whomever it is usefull.
     
    Events:
    (note a reference can also be found here (not done by me), albeit a little outdated it has some more infos: http://pz-mods.net/guide/event-reference/ )


     
    LuaMethods:


     
    Exposed Classes:

  18. Like
    turbotutone reacted to EasyPickins in Build 26 Custom Maps & Spawn Locations   
    To play a custom map on your server, both the client and server need to install a mod containing the map.  As an example of what is needed to add a custom map to the game (singleplayer or multiplayer), I've attached a Bedford Falls mod (but without the .lotheader or .lotpack files which you can download elsewhere).
     
    To use this mod in multiplayer, edit the Zomboid/Server/*.ini file for your server with these lines:
    Mods=BedfordFallsMap=Bedford Falls, KYAnother funky new feature is the ability to let the client choose where to spawn in a map.  This is done by creating a "spawn regions" file for your server.  This example lets the client choose to spawn in Muldraugh or Westpoint when creating a new character, using those maps' spawnpoints.lua files.
    function SpawnRegions() return { { name = "Muldraugh, KY", file = "media/maps/Muldraugh, KY/spawnpoints.lua" }, { name = "West Point, KY", file = "media/maps/West Point, KY/spawnpoints.lua" }, }endTo use this in your server, paste the lines into a file called servertest_spawnregions.lua and add this to your server's *.ini file:
    SpawnRegions=servertest_spawnregions.luaYou can name the file anything you like; put it in the Zomboid/Server/ directory.
     
    You can add any number of alternate spawn locations for your clients by adding lines to the SpawnRegions() table.
    { name = "My Custom Spawn Location", serverfile = "MyCustomSpawnLocation_spawnpoints.lua" },Note the "serverfile" will load the *.lua file from the Zomboid/Server/ directory.
    Bedford Falls.zip
  19. Like
    turbotutone reacted to EnigmaGrey in usefulBleach Release 1   
    https://www.dropbox.com/s/0961pa6lv0rv8lm/usefulBleach.zip

    No longer just a quaint method of thirst reduction, harness the buautifying pwoer of bleach to cleanse those stubborn blood stains from walls.

    Version 1 cares about your pathetic inventory and it's contents. It rejects your attempts to wash anything and everything, other than which can be washed by bleach. From removing troublesom stains on walls to floors, bleach enables all.

    If it doesn't come out in one go, try two, three, four, or even five times! Get that spot out.

    Spoiler  
    https://www.dropbox.com/s/0961pa6lv0rv8lm/usefulBleach.zip

    No longer just a quaint method of thirst reduction, harness the beautifying power of bleach to clean those stubborn blood stains (and far too much more)  from walls.


    Version 0 doesn't care about your pathetic inventory, nor it's contents. It will let you wash anything, and everything, even those which won't appear washed (floor tiles, zombie corpses, yourself), but it will remove blood from walls -- and even remove accent pieces, such as trim overlapping brick.

    Though this includes an additional Java function in IsoGridSquare (UnDoBloodSplat), it appears to be unnecessary. Everything it does should be doable in the Lua side . . . eventually.

    Source code included.



    Note, this is not compatible with save files (it will not work on loaded blood spatter nor blood overlays). Do not use this with The Censor mod. Be sure to use only in a well-ventilated area.
  20. Like
    turbotutone got a reaction from daorkboypl in Erosion - Nature takes over   
    The idea
     
    To slowly have the map detoriate over time, nature grows wild and the urban areas slowly decay.
     
    What will the mod do?
     
    Currently the planning is for Erosion to add the following effects to the game:
     
    Plantlife:Nature will slowly start to take over, popping up on natural tiles. Currently plants have 6 stages (low grass to tree), only the most fertile spots will reach the maximum. Random special objects with a very low chance of spawning (imagine a dead campfire and the likes). Streets:Big cracks in the road that gradually become more intense. Patches of cracked road where grass and stuff grows through. More litter and garbage appearing over time. Random special objects with a very low chance of spawning (a pile of zombie corpses for example). Houses (exterior):Cracks that can appear on over time. Vines that slowly takover a part of a wall. Windows have a chance to be broken over time (idea by RobertJohnson) Doors have a tiny chance to pop open at some point. Random stuff like smudges and what not.  
     
    Textures by Thutzor
     
    Thutzor will be doing the extensive list of additional artwork for the mod. Thank you Thutzor!
     
    build 27 version:
    pz build 27 click here
    Post 25 march 2014 steam update:
    pz build 26B click here
    Pre 25 march 2014 steam update:
    pz build 26A click here
     
    Download Erosion Alpha 0.1
     
     
    Modding Erosion
     
    Videos
     
    Screenshots
     
    Screenshots Archive
    Outdated screenshots from the very first functional version:
  21. Like
    turbotutone reacted to badtrix in Building Mod v0.2.2   
    Last Edit: 14:50  GMT, 2nd May
    Latest Version: 0.2.2
     
    To all modders out there: i have no clue of debugging, I'm doing trial & error scripting so far if anyone knows how to debug, please tell me if there are some "hidden" errors and stuff. thx
     
    Hello fellow survivors,
     
    I'm new to the modding community and want to present you my first mod v0.2.1.
     
    As the topic title suggests, i made a mod which allows you to build whatever you like. Well, not yet, but soon
     
    Longterm target: I want this mod to become a community project where everyone can suggest new items or buildable objects (as long as they provide the textures).
     
    HOTFIX v0.2.2 is online! Check out the Changelog! RecyclingMod not required anymore!
     
    Read before installing: From v0.2.1 onwards, this mod uses a modified version of the ISInventoryTranserAction.lua. So this mod has compatibility issues with other mods using modified versions of the ISInventoryTranserAction.lua. However, i do not know of any other mod using the same file yet.
     
    Important Known Bug: Sometimes if you want to add a single item to a container (drop one), it seems not to work. however, i found that repeatedly clicking "drop one" will solve the problem sooner or later (sometimes after 2 retries, sometimes after 10 or more).
     
    get the mod here: http://pz-mods.net/gameplay/BuildingMod/
     
     
    What this mod is able to do so far:
     
    Buildable Objects
     
    Effects/Functions
     
    Resources used
     
    Farming
     
    Recipes
     
    Changelog
     
    Known Bugs/Issues
     
    What is planned for this mod:
     
    See targets for further versions:
     
     

     
    Installation:
     
    Credits:
    Thanks to Ramibuk for his work on the Recycling Mod, of which i integrated parts (i.e. items, recipes, textures) into my mod to make it a standalone mod.
     
    Permissions: Feel free to link this mod, alter this mod, or use it as a starting point for your own mod. All i want is credits
     
     
     
    I will keep this thread up to date. Please post me any suggestions, bugs, and whatever you like to post
  22. Like
    turbotutone got a reaction from Cykodelik in Erosion - Nature takes over   
    eya guys, yes im still here, still working on it... not at the pace i would like tho, have been having other stuff interfering that simply needed to get done (moneys etc)
     
    but bear with me, it will come, the eta is variable as heck tho
  23. Like
    turbotutone got a reaction from Cykodelik in Erosion - Nature takes over   
    Thanks all
     
    Thought id leave a small post since ive not updated much lately. Firstly to answer these questions:
     
    Something like that oughta be possible, the system as is could have support for interior erosion with the addition of 2 lines of code or so. In future im planning to enable that feature and maybe add a few basic litering, spider rags etc.
     
    The grass cutter will be added as many people have asked for it to keep their gardens clean, frikken hippies! The tree issue is correct, in the public version all erosion stuff isnt clickable, got that fixed on my local version so next update the problem will be gone.
     
    Secondly, concerning the next update, on my local version most bugs of the current build have been fixed (theres still a nasty one not yet resolved, that firks up the sprites uppon loading a game) In the meantime, the MP had been released as well, which is pretty kick ass i might add. Now i wanna see if i can make the next version of erosion also compatible with MP. However since the whole mp stuff is currently under development, ima wait a bit till its in a more mature state.
    Also got some plans to rework some stuff in erosion that im not to happy about, so ill retreat to the shades for a little while and work on that.
  24. Like
    turbotutone got a reaction from Cykodelik in Erosion - Nature takes over   
    yes, indoors could be added as a "region" in the system... the only reason ive steered away from it so far is because im unsure how this will affect player build stuff, havent looked into that yet.
     
    Also, if nothing goes wrong ill be posting a alpha version within 24 hours from this post
    Got some code cleaning up to do, perhaps a little documentation on how to use some stuff, then ill put it up for testing.
     
    Here some screens from the latest build (with reworked grasses):

     

  25. Like
    turbotutone reacted to Doublebrain in Where do I post sprites? Maybe here?   
    I'll do some last changes tomorrow and then upload the sleeping bag.
    Have a look:

×
×
  • Create New...