Search the Community

Showing results for tags 'documentation'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Hot Lava
    • [Hot Lava] - General Discussion
    • [Hot Lava] - Suggestions and Feedback
    • [Hot Lava] - Bug Tracker
    • [Hot Lava] - Strats and Records
    • [Hot Lava] - Developer Log
    • Hot Lava Latest Update
  • Griftlands
    • [Griftlands] - General Discussion
    • [Griftlands] - Suggestions and Feedback
    • [Griftlands] - Mods and Tools
    • [Griftlands] - Localization
    • [Griftlands] - Bug Tracker
    • [Griftlands] - Developer log
  • Oxygen Not Included
    • Oxygen Not Included FAQ
    • [Oxygen Not Included] - Developer log
    • [Oxygen Not Included] - General Discussion
    • [Oxygen Not Included] - Bug Tracker
    • [Oxygen Not Included: Spaced Out!] - Bug Tracker
    • [Oxygen Not Included] - Mods and Tools
    • [Oxygen Not Included] - Suggestions and Feedback
    • [Oxygen Not Included] Art, Music & Lore
    • Community Challenges
    • [Oxygen Not Included] - Latest Content Update
    • [Oxygen Not Included] - Latest Animated Short
    • Oxygen Not Included DLC Alpha
  • Don't Starve Together
    • Don't Starve Together FAQ
    • [Don't Starve Together] Developer log
    • [Don't Starve Together] General Discussion
    • [Don't Starve Together] Beta Branch
    • [Don't Starve Together] PS4
    • [Don't Starve Together] Xbox One
    • [Don't Starve Together] Bug Tracker
    • [Don't Starve Together] Trading
    • [Don't Starve Together] Server Bulletin
    • [Don't Starve Together] Dedicated Server Discussion
    • [Don't Starve Together] Mods and Tools
    • [Don't Starve Together] Tales of Life and Death
    • [DS + DST] Art, Music and Lore
    • [Don't Starve Together] Suggestions and Feedback
    • [Don't Starve Together] The Forge
    • [Don't Starve Together] The Gorge
    • [Archived Bugs]
  • Don't Starve
  • Klei Entertainment Games
  • Other Stuff

Categories

  • Don't Starve
    • Custom Character and Skins
    • Game Modifications
    • Language Packs
    • Modding Tools, Tutorials & Examples
    • Custom Maps

Categories

  • Oxygen Not Included
  • Oxygen Not Included: Spaced Out! (Early Access)
  • Griftlands
  • Don't Starve: Hamlet
  • Don't Starve: Hamlet Early Access
  • Don't Starve Together
  • Don't Starve Together: Beta Branch
  • Don't Starve Together: Return of Them
  • Don't Starve Together: The Gorge
  • Don't Starve Together: The Forge
  • Don't Starve Together: The Forge (Archive)
  • [Don't Starve Together] PS4
  • [Don't Starve Together] Xbox One
  • Don't Starve: Shipwrecked
  • Don't Starve: Shipwrecked [archive]
  • [Don't Starve Together] PS4 (archive)
  • [iOS] Don't Starve: Shipwrecked
  • Don't Starve: Hamlet Closed Beta (ARCHIVE)

Categories

  • Oxygen Not Included
  • Oxygen Not Included: Spaced Out! (Early Access)
  • Griftlands
  • Hot Lava
  • Don't Starve Together
  • [PS4] Don't Starve Together
  • [Xbox One] Don't Starve Together
  • Don't Starve: Hamlet
  • Don't Starve: Shipwrecked

Categories

  • Hot Lava - Bug Reports

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End



Biography


Location


Interests


Occupation


Favorite Game


Modder


Chester Kickstarter


Chester Kickstarter


Chester Kickstarter


Chester Kickstarter


Chester Kickstarter


Klei Featured Artist


Early Supporter


Early Supporter


Don't Starve


Don't Starve Together

Found 5 results

  1. Hey, this is just a small little thread that lists all the engine functions in the game(Stuff like Transform, AnimState, SoundEmitter are defined in the engine). I'll try my best to keep this up to date and I hope you find it useful. AnimState Transform SoundEmitter MiniMapEntity Light LightWatcher Physics Follower WaveComponent VFXEffect DynamicShadow Pathfinder Network Map TheSim TheNet TheInputProxy TheShard FontManager PostProcessor EnvelopeManager TheInventory MapLayerManager RoadManager Some of these functions may not be so clear in what their use is. So you can ask me and i'll try to figure out what the function is used to do and let you know too : ).
  2. Understanding Components Hello and welcome to this documentation post on understanding components! I’ll help you understand components and how to use them. So, what is a component?: A component is something an entity can do. For example, a birchnut does different things like being able to be examined, cooked, go into inventories, be planted. So a birchnut would have different components like the “inspectable”, “cookable”, “inventoryitem”, “deployable” components to accomplish all those things I mentioned. Every component in the game can be found as files in the scripts/components folder of the games folder. Why do we have them?: We have components because it makes it really easy to add pre-existing mechanics to new entities. Could you imagine if the code for examining an entity had to be manually done in every single prefab file? That would be terrible! But of course, instead we have an “inspectable” component file and if we want something to be examinable, we simply add the inspectable component to the entity. What does a component file look like?: At its most basic form, a component’s file will look like this: local Component = Class(function(self, inst) self.inst = inst end) return Component In this snippet of code, a new Class is created and assigned to the “Component” variable and the Component variable is returned. That’s the most basic form of a component. But of course, most components don’t look like that, most are much much more complicated. How are components added?: Components are generally added when an entity is being initially constructed from their Prefab file. inst:AddComponent(“inspectable”) All components are added through the AddComponent function available to all entities in the game. In the code snippet above, we’re adding the “inspectable” component, so the game searches in the components folder for an inspectable file and finds it(Well hopefully it finds it. If the game doesn’t find the component you asked for it will crash!). The component initializes and is now accessible with: inst.components.inspectable We can now use this specific instance of the component however we like, set and change new/old variables, call functions from it, etc. That’s a simple explanation of components done, if there’s something you’re still confused about or something you think should be added to this post then please let me know and i’ll see about it! I may add a little snippet on replicable components later on and how they work
  3. Hey! I'll be listing some documentation on all of the functions in the scripts/modutil.lua file. All of these functions are very common and were made for Modders to use so I decided to document them all so you might have a better understanding of how to use that function. Note: This thread is a W.I.P! I still need to add the world gen utility functions, RPC handler functions and a few others. I'll try to add those as soon as I can! GetModConfigData AddSimPostInit AddClassPostConstruct The functions below here can only be used in modmain.lua and are excluded from modworldgenmain.lua AddModCharacter AddAction AddPopup AddComponentAction AddPlayerPostInit AddPrefabPostInit AddPrefabPostInitAny AddComponentPostInit AddBrainPostInit AddStategraphPostInit AddCookerRecipe AddIngredientValues AddRecipe AddRecipeTab RemapSoundEvent AddReplicableComponent RegisterInventoryItemAtlas AddMinimapAtlas RemoveDefaultCharacter
  4. Understanding Prefabs If you’ve taken a look at the game's source code, or even saw people just talking about modding in general, you’ve probably heard the term “Prefab”. But what is a prefab? Well, to say it most simply. A prefab is like a blueprint the game reads to create an entity. The game might be asked to spawn a “rabbit” prefab. So it checks to see the “rabbit” prefab data and reads it as if it is a blueprint to construct a “rabbit” entity. Nearly every other entity in the game works like this. There are prefabs for characters, mobs, bosses, items, structures and pretty much everything! Prefab("acorn", fn, assets, prefabs) Prefabs are created through the Prefab class(as seen in the code snippet above). There are 4 main parameters to the class. The first parameter is the name of the prefab, the second parameter is the constructor function for the prefab. This function handles the creation of the prefab when the game tries to spawn it in. The third parameter is a table of assets that are used for the entity. This is necessary to define so the game can load in those assets so that the prefab is able to use them. The 4th parameter is a table of other prefabs, so they may be loaded in/ready to be used when our prefab needs them. The constructor functions for prefabs generally look something like this: local function fn() local inst = CreateEntity() --Code here is run on the server AND clients if not TheWorld.ismastersim then return inst end --Code here is run ONLY on the server side return inst end An entity is created by calling the CreateEntity function which is then assigned to a local variable named “inst” (Short for Instance). If you look at some prefabs in the game (Prefabs can be found in the Dont Starve Together/data/databundles/scripts/prefabs folder) you will commonly see snippets of code like these. inst.entity:AddTransform() inst.entity:AddAnimState() inst.entity:AddSoundEmitter() inst.entity:AddNetwork() Right after the inst variable is assigned. These C functions(functions that are defined in the game engine) are extremely fundamental bases for pretty much every entity in the game. AddTransform allows your entity to have an x, y, and z position in the world, have a rotation and able to be scaled, AddAnimState allows your entity to have an animated model, AddSoundEmitter allows your entity to emit and play sounds, AddNetwork is necessary for networking the entity to clients. There are much more C functions like these (AddPhysics, AddMiniMapEntity, AddLight) which you can find being used in other prefabs. After client and server data is initialized(C functions, etc) we reach this check if not TheWorld.ismastersim then return inst end This is just a simple check to see if it’s the client or server side running this code. If it’s the client we return the inst variable. This is because the code ahead is meant for only the server and should not be run on the client, so we make sure only the server side is passing ahead. Now we are on the server-side of the constructor function where code that only affects the server-side is added and other things like components will be added. What are components? I plan to make a separate post for them but to summarise components are things that an entity can do. For example the “acorn” prefab (Birchnuts) can be looked at, is an inventory item, can be stacked, can be cooked, can be eaten, can be planted. So components are added to the prefab like the “inspectable”, “inventoryitem”, “stackable”, “cookable”, “edible”, “deployable” components. These help to accomplish the things we might want the entity to do. There are tons and tons of components in the game that all do different things. They can be found in the Dont Starve Together/data/databundles/scripts/components folder. That’s a basic explanation of how the constructor function for prefabs works. I urge you to check out the constructor functions of prefabs in the game and see how they work and what they do to accomplish their mechanics and features! But now let’s talk about how assets tables are defined. The assets table will contain instances of the “Asset” class. The Asset class will generally look something like this: Asset(“ANIM”, “anim/acorn.zip”) The first parameter is the type of asset we’re loading in. Is it an animation? If so, then its “ANIM”, is it an image? Then it’s “IMAGE”, if it’s an atlas, “ATLAS” and so on. There are many types of asset types and those can be found just by scouring through the game’s lua code and see how some instances of the Asset class name their asset types. The second parameter is the file path to the asset we’d like to load in. Simple enough. local assets = { Asset(“ANIM”, “anim/acorn.zip”), Asset(“ANIM”, “anim/pinecone.zip”), } The game will then initialize and load in the assets you have put in the assets table and now you’re able to use them in the game! If you try to use an asset that hasn’t been put in an assets table, and thus hasn’t been loaded in, then simply nothing will happen, if you’re trying to use a unloaded visual asset your entity will simply just appear invisible, trying to use an unloaded sound will result in no sound at all coming out, etc. Let’s talk about the last and final thing in the Prefab class, the prefabs table! Now, to be honest i’m not completely sure how the prefabs table works and what it’s used for. But I believe the prefabs table is used to load in prefabs ahead of time that are used for our prefab. For example, a perishable food item might need to put “spoiled_food” (the prefab name for rot) in their prefabs table so the game can know that this prefab is needed for when the food item spoils and rot needs to be put in place of the food item. So the prefabs table for a perishable food item would look like this local prefabs = { “spoiled_food”, } Fairly simple, and you can add as many prefabs as you want. The prefabs table isn’t necessary, prefabs can work without it, but it seems to help in some way so i’d recommend making sure you have one. (If your custom prefab isn’t linked to any other prefabs in any way then you can leave it blank). And that’s how prefabs and the Prefab class is defined! I hope you found this documentation useful in some way, i’m a bit worried i’m not explaining some parts in enough detail or even if I'm maybe over explaining things. If you have any feedback or questions please let me know/ask away! I hope to make posts on understanding components, brains, stategraphs and UI some time soon : )
  5. I've noticed that hardly anyone knows how to make worldgen mods, so I thought I'd share my knowledge on the subject. Feel free to correct me on anything I got wrong or give me information I might not have EDIT: Yay! My post got the "popular" thing! ----> Thanks Guys! Section 1: What are the parts of World Geneation? Part 1: Prefabs and Static Layouts Prefabs are, as far as this guide is concerned, the smallest units in the don’t starve worldgen. Everything you see in the world is made of a combination of prefabs. I’m not going to be going over how to create prefabs in this guide, only how to implement already made prefabs and place them in the world. Static layouts are a series of prefabs that are placed in a specific order, when a static layout is placed, it will be exactly the same every single time. If you remember the pig king, or the teleportato pieces, these are good examples of static layouts (mostly just because they’re easy to remember as the same every time). I include these two in the same part because they’re both used when you make... Part 2: Rooms, and Setpieces Rooms are the first randomly generated part of don’t starve, they have contents (prefabs and static layouts), tags, and values. The tags determine special characteristics of a room, and the value determines the floor, what you’ll find yourself standing on. Contents are defined in a table, under several categories which are: countstaticlayouts, a table that holds the static layouts that you want in your room countprefabs, a table which holds prefabs that you want in your room distributepercent, a floating point value that determines the distribution of the prefabs in your room distributeprefabs, a table of prefabs to be distributed and how distributed they are prefabdata, to determine how to modify the prefabs in the room At first glance, distributeprefabs and countprefabs seem to be similar, but they’re actually used for very different purposes. The table, distributeprefabs is used for prefabs that you don’t necessarily want a specific amount of, but you want them evenly distributed across the room, things like trees, and flint. Whereas countprefabs is used for prefabs that you want a specific amount of. The countstaticlayouts table is used in an identical fashion to countprefabs, but obviously for static layouts. The table, prefabdata is used to determine the starting conditions of prefabs like trees (which can be burnt) and spider dens (which can be teir1,2,or 3) You don’t need to use prefabdata to determine the starting conditions for tree growth, as that is randomly selected by the trees. The reason for this is that people are unlikely to want a tree forest with trees the same height, but spider dens are frequently all tier1, or all tier3, or a random selection, so naturally you would want to determine this on a room-by-room basis. Setpieces are the middleground between a room and a static layout, generally incorporated into the world after it has been generated, and around the same size as a static layout, but (somewhat) randomly generated like a room. Part 3: Tasks, locks and keys A task has five important parts: Locks, which determine how the task can be “attached” to other tasks Keys, are the other half of the equation that determines if two tasks can be attached to eachother. Rooms, which are in essence what the task is made up of. room_bg and background_room, which determines the type of room used to flesh out the area. When the world is being generated, it goes through each task, checks the locks, and keys, and attaches the tasks together so that each lock is unlocked by any of the keys that can unlock it. A list of locks and keys can be found in the locksandkeys.lua in the maps folder. Locks and keys can be used to shape mildly. Rooms are the main rooms of the world, you define a specific amount of these. As opposed to room_bg and background_room, which are used to flesh out the area and an amount of them is chosen at random.. Part 4: Levels This is the part where you pick what you want in the world. The level is made of several portions, In this guide I’ll discuss the important parts for a survival mode world leveltype, there are a few options for this, we’ll be using survival id, the level id, this is how the game recognized the level name, the name of your world, which will be viewable by the players desc, the description of the world, which will be viewable by the players overrides override specific settings in the world tasks, these are guaranteed to be in the world which is what the world is made of optional tasks, which are what the world could be made of, if they’re picked setpieces, guaranteed to be in the world, covered in part 2 random setpieces, that could be in the world if they’re picked Leveltype is the type of level that this level is going to be, survival, adventure, etc. survival maps can be picked from the world generation menu. Overrides are used to override specific settings in the world, meaning you could make the start season winter, or have only islands, start on a specific setpiece, or a number of other things. Tasks are where you put the tasks that you made in part 3, setpieces are where you put the setpieces that we learned about in part 2. Random setpieces and optional tasks are setpieces and tasks that shouldn’t necessarily be in every world, but belong in some worlds. Section 2: Making your worldgen mod; A tutorial. This is going to be the most basic world you could possibly make, but it uses all the basic concepts and makes for a fairly short tutorial that someone could easily make a much better world based off of. So here we go Part 1: Making mod folder. Name it whatever you want, and make the following directory structure Top level folder modinfo.lua (empty) modworldgenman.lua (empty) scripts map levels rooms tasks Part 2: Making your first room Create a new empty lua file in scripts/map/rooms and open it in your favorite text editor Start with the function addroom(“name of your room”{}) Add in colour and value, color is (as far as I’m aware) purely for debugging purposes which we aren’t going over in this guide. Add the contents, I chose to add only grass Add a background room, it’s going to be pretty much the same as your normal room, but in this specific case, it doesn’t really matter, as it’s probably going to get overwritten by the start node(although you can choose to not include a start node) Part 3: Make yourself a task Since we only have one task this is pretty simple, I’m only planning on putting in one task for this demo. If you want more, you’re going to have to go through the locks and keys lua file in maps, but since we only have one right now, I’m just going to leave locks and keys as none. For future reference, you must choose locks.none if you want a specific area to be your starting area. Then we need to make our room_choices table, for mine I put in one of the plains room we made. If you want to see your background room, you should put in more than one, you’ll see why when we actually make the world. Lastly, add in your room_bg (it should match the room you’re making), your background_room, and the colour, which once again, is only used for debug purposes, so you can make it any color you want. Part 4: Levels Add in your survival level, with an id, name, and description of your choosing. Next comes overrides, you can make your own starting setpiece if you want to, but I just used the default one provided with don’t starve. And finally tasks, we have no optional tasks because we only made one task. Part 5: Playing the mod Now comes the moment of truth, link all your files in modworldgenmain.lua, name the mod in modinfo, and install your mod! If everything worked out, you should have a new world preset, and when you select it…. I know it looks stupid, but that's because there's only one room. Note: the green comes from the start node, and you can't see any of my background room, but my plains room is clearly visible.