Modding:Basic Modding Examples: Difference between revisions
No edit summary |
|||
Line 3: | Line 3: | ||
== Changing sleep duration in beds == | == Changing sleep duration in beds == | ||
Beds in the Vanilla game are pretty limited, more often than not players | Beds in the Vanilla game are pretty limited, more often than not players prefer to skip the whole night. To achieve that open the file <code>assets/blocktypes/wood/generic/bed.json</code> | ||
Line 7-11 should contain these lines: | Line 7-11 should contain these lines: | ||
Line 15: | Line 15: | ||
The <code>sleepEfficiency</code> attribute is specific to the bed. In this case a value of 1 means the player can sleep half the day. The hay bed has a value of 0.25, which means the player can sleep for 12 * 0.25 = 3 in-game hours. Change the value to anything between 0...1 and start the game or leave and re-enter your singleplayer world. Next time you sleep in the bed you will be skipping that amount of time. | The <code>sleepEfficiency</code> attribute is specific to the bed. In this case a value of 1 means the player can sleep half the day. The hay bed has a value of 0.25, which means the player can sleep for 12 * 0.25 = 3 in-game hours. Change the value to anything between 0...1 and start the game or leave and re-enter your singleplayer world. Next time you sleep in the bed you will be skipping that amount of time. | ||
== Playing around with world generation == | == Playing around with world generation == |
Revision as of 18:15, 26 July 2018
A large amount of game content is freely modifiable through editing text files. If you feel like tinkering around, just open your assets folder. To locate it under windows, hit Winkey+R in Windows then paste in this line %appdata%/Vintagestory/assets and hit enter.
Changing sleep duration in beds
Beds in the Vanilla game are pretty limited, more often than not players prefer to skip the whole night. To achieve that open the file assets/blocktypes/wood/generic/bed.json
Line 7-11 should contain these lines:
attributesByType: {
"bed-wood-*": { sleepEfficiency: 0.375 },
"bed-hay-*": { sleepEfficiency: 0.25 },
"bed-woodaged-*": { sleepEfficiency: 0.45833 }
},
The sleepEfficiency
attribute is specific to the bed. In this case a value of 1 means the player can sleep half the day. The hay bed has a value of 0.25, which means the player can sleep for 12 * 0.25 = 3 in-game hours. Change the value to anything between 0...1 and start the game or leave and re-enter your singleplayer world. Next time you sleep in the bed you will be skipping that amount of time.
Playing around with world generation
Inside the assets folder, navigate to worldgen/terrain/standard. Copy aside the landforms.json so you have a backup, then open the landforms.json. Remove everything in this file and paste in the following text:
{ code: "landforms", "variants": [ { "code": "humongous mountain", "comment": "humongous mountains with caverns in them", "hexcolor": "#5BC184", "weight": 2, "useClimateMap": false, "terrainOctaves": [0, 0, 0, 0, 1, 1, 1, 1, 0.6, 0.2], "terrainOctaveThresholds": [0, 0, 0, 0, 0.5, 0, 0, 0, 0, 0], "terrainYKeyPositions": [0, 0.33, 0.37, 0.42, 0.43, 0.5, 0.6, 0.7, 0.9, 0.97, 1], "terrainYKeyThresholds": [1, 1, 0.87, 0.84, 0.7, 0.94, 1, 1, 0.1, 0.05, 0] }, ] }
Now next time you create a new survival world, the entire world is made of humongous mountains. Congratulations, you can now officially call yourself a modder!
Very shortly explained, this file defines the list of land forms that may appear in the world. Each section enclosed in { ... } is one landform. If you feel like, you can play around with the values for terrainYKeyPositions and terrainYKeyThresholds and see what happens (they have to be values between 0 and 1). These numbers basically determine the shape of the landform at certain elevations.
More info on on that is available on the World Generation page.
Playing around with blocks
You can tweak, add or remove almost any block you want, inluding their shape. Inside the assets folder: - The blocks themselves are all in the subfolder blocktypes - The block textures in textures/blocks - The shapes of the blocks are in blockshapes/ - these you can open up with our custom model creator
Some examples what you can do: Let's make the fire pit emit a red light and huge particles
- Open up blocktypes/wood/generic/firepit.json. There you can see the following line:
"firepit-lit": [7, 7, 17], -
These are the Hue, Saturation and Brightness values according to the VS Light Wheel (hover over any pixel to see it's HSV Value). The brightness is how far the light will spread. I'll take [0, 7, 20]:
"firepit-lit": [0, 7, 20], - On line 36 you should see this:
size: { avg: 0.25, var: 0 }, - This determines the size of the cubic glowing particles the fire pit emits, let's up the size 8 times and add some randomness to it:
size: { avg: 2, var: 0.5 },
Save the file and restart the your singpleplayer world, place your lit fire pit and you should see this:
Wondering where some links have gone?
The modding navbox is going through some changes! Check out Navigation Box Updates for more info and help finding specific pages.
Modding | |
---|---|
Modding Introduction | Getting Started • Theme Pack |
Content Modding | Content Mods • Developing a Content Mod • Basic Tutorials • Intermediate Tutorials • Advanced Tutorials • Content Mod Concepts |
Code Modding | Code Mods • Setting up your Development Environment |
Property Overview | Item • Entity • Block • Block Behaviors • Block Classes • Block Entities • Block Entity Behaviors • World properties |
Workflows & Infrastructure | Modding Efficiency Tips • Mod-engine compatibility • Mod Extensibility • VS Engine |
Additional Resources | Community Resources • Modding API Updates • Programming Languages • List of server commands • List of client commands • Client startup parameters • Server startup parameters Example Mods • API Docs • GitHub Repository |