Modding:Basic Modding Examples: Difference between revisions

From Vintage Story Wiki
m
quotes
(Marked this version for translation)
m (quotes)
(2 intermediate revisions by the same user not shown)
Line 33: Line 33:
Line 8-11 should contain these lines:
Line 8-11 should contain these lines:
<syntaxhighlight lang="json">
<syntaxhighlight lang="json">
sleepEfficiencyByType: {
"sleepEfficiencyByType": {
"bed-wood-*": 0.70833333,
"bed-wood-*": 0.70833333,
"bed-hay-*": 0.58333333,
"bed-hay-*": 0.58333333,
Line 42: Line 42:
<!--T:12-->
<!--T:12-->
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.58333333, which means the player can sleep for 12 * 0.58333333 = ~7 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.58333333, which means the player can sleep for 12 * 0.58333333 = ~7 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.


== Making wolves less dangerous == <!--T:13-->
== Making wolves less dangerous == <!--T:13-->
Line 55: Line 54:
<syntaxhighlight lang="json">
<syntaxhighlight lang="json">
{
{
code: "meleeattack",
"code": "meleeattack",
entityCodes: ["player", "chicken-rooster", "chicken-hen", "chicken-baby", "hare-*"],
"entityCodes": ["player", "chicken-rooster", "chicken-hen", "chicken-baby", "hare-*"],
priority: 2,
"priority": 2,
damage: 8,
"damage": 8,
damageTier: 2,
"damageTier": 2,
damageType: "SlashingAttack",
"damageType": "SlashingAttack",
slot: 1,
"slot": 1,
mincooldown: 1500,  
"mincooldown": 1500,  
maxcooldown: 1500,  
"maxcooldown": 1500,  
attackDurationMs: 800,
"attackDurationMs": 800,
damagePlayerAtMs: 500,
"damagePlayerAtMs": 500,
animation: "Attack",
"animation": "Attack",
animationSpeed: 2.5,
"animationSpeed": 2.5,
sound: "creature/wolf/attack"
"sound": "creature/wolf/attack"
},
},
</syntaxhighlight>
</syntaxhighlight>
Line 80: Line 79:
<syntaxhighlight lang="json">
<syntaxhighlight lang="json">
{
{
code: "seekentity",
"code": "seekentity",
entityCodes: ["player", "chicken-rooster", "chicken-hen", "chicken-baby", "hare-*"],
"entityCodes": ["player", "chicken-rooster", "chicken-hen", "chicken-baby", "hare-*"],
priority: 1.5,
"priority": 1.5,
movespeed: 0.045,
"movespeed": 0.045,
seekingRange: 15,
"seekingRange": 15,
belowTempSeekingRange: 25,
"belowTempSeekingRange": 25,
belowTempThreshold: -5,
"belowTempThreshold": -5,
animation: "Run",
"animation": "Run",
leapAtTarget: true,
"leapAtTarget": true,
leapAnimation: null,
"leapAnimation": null,
animationSpeed: 2.2,
"animationSpeed": 2.2,
leapChance: 0.01,
"leapChance": 0.01,
sound: "creature/wolf/growl",
"sound": "creature/wolf/growl",
whenNotInEmotionState: "saturated"
"whenNotInEmotionState": "saturated"
},
},
</syntaxhighlight>
</syntaxhighlight>
Line 104: Line 103:
<!--T:19-->
<!--T:19-->
Be sure to also apply the changes to the female wolf in <code>wolf-female.json</code>!
Be sure to also apply the changes to the female wolf in <code>wolf-female.json</code>!


== Playing around with world generation == <!--T:20-->
== Playing around with world generation == <!--T:20-->
Line 110: Line 108:
<!--T:21-->
<!--T:21-->
Inside the assets folder, navigate to <code>assets/survival/worldgen/</code>. 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:
Inside the assets folder, navigate to <code>assets/survival/worldgen/</code>. 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:
<pre>
<syntaxhighlight lang="json">
{
{
code: "landforms",
"code": "landforms",
"variants":  
"variants":  
[
[
Line 128: Line 126:
]
]
}
}
</pre>
</syntaxhighlight>


<!--T:22-->
<!--T:22-->
Confirmedusers
27

edits