Modding Guide: Part One

Want to learn or teach others some of the finer details of Life is Feudal? This section is for the game guides, tutorials and FAQ's.

Maegfaer
Mod Developer
 
Posts: 246
Joined: 26 Sep 2014, 08:01

Modding Guide: Part One

Post by Maegfaer » 27 Oct 2014, 15:20

Introduction

This is the first part of my series of guides on modding LiF:YO dedicated servers. In these guides it is assumed the reader has basic computer skills and knows for example how to modify data in a SQL database.



On server<->client communication

Almost all PM's I receive with modding questions begin with "I changed X in the server database/XML files but it makes no difference in the game!", so let my address this mystery first.

The core problem here is a wrong perspective on the communication between the clients and the server. Most people seem to assume that the server determines for example the capacity of a Warehouse, and that the server sends this information to the client, which displays it to the player. This is not the case, because it would increase the server load needlessly. Every client connecting to the server would need to receive all this game data, every time the client reconnects.

Instead, game data like the capacity of warehouse is configured both on the client and the server. The client simply uses it's local data to display a value like the Warehouse capacity to the player, and will also refuse a deposit if it would exceed it's (client-side) capacity. The server doesn't even come into play (yet). This is the reason why your server-side changes didn't seem to work.

The server does come into play when the client accepts the deposit. The deposit is send to the server, which also checks if the deposit does not exceed the Warehouse capacity on the server side. If it passes, the deposit takes effect, if not, the server replies to the client that it was denied after all.

So in the end, the server has the final say on pretty much everything, but very often the client has the first say. It works like this to minimize the data transfer between the server and the clients, since that is the bottleneck on scalability of networked multiplayer games.

This means that a lot of modifications need to be done both server and client side in order to work properly. A notable exception is damage values for weapons/armour and damage calculations. If you think about it with the above in mind, it should become pretty obvious why client-side damage values and calculations would be useless. Another exception is Claim time values.



On the patch.sql file

In the server files there is the file sql/patch.sql. This file contains SQL queries for the official patches. The patch.sql file is executed every time your server is restarted, and may revert your mod's changes, for example Claim times.

In my experience this patch.sql file only needs to be run once after every patch, and can then be deleted. It is remade after every official patch. You could also edit patch.sql file to edit out the conflicting patch changes if you don't feel comfortable with deleting the entire file.



How to's

In this part we'll discuss the easiest of modifications, namely the ones that only require adjustments in database tables and in XML files. All relevant XML files can be found in the Data directory, on both the server and the client.

How to adjust container capacity and what types of objects can be stored in a container
Spoiler
How to adjust an object's Claim time
Spoiler
How to make an unclaimable object claimable
Spoiler
How to adjust an object's weight
Spoiler
How to allow a building to be set as a Home
Spoiler
How to adjust Skill experience gain when using abilities
Spoiler
How to change the welcome message on login
Spoiler
How to change armour protection values
Spoiler
How to change recipes and their requirements
Spoiler
How to reconfigure Skill lines
Spoiler



Final words

Feel free to make requests, although in this part I'll only handle XML-files and database changes. If you can think of your own how-to's, you can post them here and I'll add them to the OP with credits.
Pioneer LiF:YO modder
Author of Life is Balanced
My Modding Guide

Image


Heinrich_von_Leipa
Alpha Tester
 
Posts: 198
Joined: 26 Aug 2014, 16:05

Re: Modding Guide: Part One

Post by Heinrich_von_Leipa » 27 Oct 2014, 18:39

First off: Sorry for "spamming" this clean thread!
Secondly: It's awesome what you're doing here, not only your LiB project, but evne more so that you write down "tuts" here for other modders! Keeo this going!

However, a third thing also: I am wondering if there is an issue with the claim timer thing. It seems that whatever I change and adjust, while it works for stuff like bags, objects to drop, etc. it doesn't change the 23:00:00hrs claim timer on structures... I'm not sure whether I'm doing something wrong or it's a limitation of the game, not being able to show more hours than 23:00:00, if I set the timer to say 7 days in seconds in the DB. I'd be amazed if you could help me with this!


Maegfaer
Mod Developer
 
Posts: 246
Joined: 26 Sep 2014, 08:01

Re: Modding Guide: Part One

Post by Maegfaer » 27 Oct 2014, 19:00

Richard_Smith wrote:However, a third thing also: I am wondering if there is an issue with the claim timer thing. It seems that whatever I change and adjust, while it works for stuff like bags, objects to drop, etc. it doesn't change the 23:00:00hrs claim timer on structures... I'm not sure whether I'm doing something wrong or it's a limitation of the game, not being able to show more hours than 23:00:00, if I set the timer to say 7 days in seconds in the DB. I'd be amazed if you could help me with this!


It's the patch.sql file, I addressed it in the OP.
Pioneer LiF:YO modder
Author of Life is Balanced
My Modding Guide

Image


Heinrich_von_Leipa
Alpha Tester
 
Posts: 198
Joined: 26 Aug 2014, 16:05

Re: Modding Guide: Part One

Post by Heinrich_von_Leipa » 27 Oct 2014, 22:10

Maegfaer wrote:
Richard_Smith wrote:However, a third thing also: I am wondering if there is an issue with the claim timer thing. It seems that whatever I change and adjust, while it works for stuff like bags, objects to drop, etc. it doesn't change the 23:00:00hrs claim timer on structures... I'm not sure whether I'm doing something wrong or it's a limitation of the game, not being able to show more hours than 23:00:00, if I set the timer to say 7 days in seconds in the DB. I'd be amazed if you could help me with this!


It's the patch.sql file, I addressed it in the OP.


I would have thought that I had opened the patch.sql file when I opened the only sql file I found on my server, via navicat :-P 'course after all, it worked in said file when I set various other values to NULL, e.g. bags and dropable stuff. It's now without a claim time, as I wanted it, just the structural claim time didn't change... Anyway I'll look into it more then. Thanks for the "clue"!


Summeryforce
 
Posts: 1
Joined: 27 Oct 2014, 09:22

Re: Modding Guide: Part One

Post by Summeryforce » 31 Oct 2014, 13:56

I love this guide.

There's one thing that I want to do though. I'd like to know if it's possible to edit the animal trap or snare to catch pigs, boars, ram and sheep.
Then I would like to know how to edit the quantity of items you get from slaughtering these animals (right now you get like 800 mutton and 150 bones from 1 sheep/ram which is impossible to get unless you're a GM).


Maegfaer
Mod Developer
 
Posts: 246
Joined: 26 Sep 2014, 08:01

Re: Modding Guide: Part One

Post by Maegfaer » 31 Oct 2014, 15:33

Summeryforce wrote:I love this guide.

There's one thing that I want to do though. I'd like to know if it's possible to edit the animal trap or snare to catch pigs, boars, ram and sheep.
Then I would like to know how to edit the quantity of items you get from slaughtering these animals (right now you get like 800 mutton and 150 bones from 1 sheep/ram which is impossible to get unless you're a GM).



That's not possible with merely XML and SQL modifications. Those things are handled in compiled code and are far harder to change. I guess you'll just have to wait for the official patches...
Pioneer LiF:YO modder
Author of Life is Balanced
My Modding Guide

Image


Reaganomicon
 
Posts: 31
Joined: 22 Jul 2014, 10:43

Re: Modding Guide: Part One

Post by Reaganomicon » 03 Nov 2014, 05:34

Maegfaer wrote:
Summeryforce wrote:I love this guide.

There's one thing that I want to do though. I'd like to know if it's possible to edit the animal trap or snare to catch pigs, boars, ram and sheep.
Then I would like to know how to edit the quantity of items you get from slaughtering these animals (right now you get like 800 mutton and 150 bones from 1 sheep/ram which is impossible to get unless you're a GM).



That's not possible with merely XML and SQL modifications. Those things are handled in compiled code and are far harder to change. I guess you'll just have to wait for the official patches...


From my relatively brief delving into the disassembly, you could probably reuse the snare code to implement traps a couple of weeks ahead of bobik(read: very possible, totally not worth it)


Motta
 
Posts: 8
Joined: 30 Oct 2014, 02:41

Re: Modding Guide: Part One

Post by Motta » 03 Nov 2014, 21:24

Wonderfull guide man! You are my idol! How i can flaten a pave ? What is the table to change?


Dealtime
 
Posts: 4
Joined: 30 Oct 2014, 15:54

Re: Modding Guide: Part One

Post by Dealtime » 16 Nov 2014, 06:17

Thanks for this guide !!!

I tryed to change Mallet made by Knife but doesnt work
And Bone Glue made by Animal lore doesnt work too

update recipe set StartingToolsID = 216 where ID in 116
update recipe set SkillTypeID = 22 where ID in 188

And how can I increase speed of uproot skill? Thanks again for this guide, :beer:


Cruber
 
Posts: 1
Joined: 27 Nov 2014, 04:11

Re: Modding Guide: Part One

Post by Cruber » 04 Dec 2014, 09:23

Anyone figure out how to change the uproot speed?

I find this block of code under data/skill_types.xml file.

<ability lvl="30" name="Uproot" id="35">
<duration const="50 5"></duration>

It seems I could change the duration time and lower it. I tried 10 and it made removal 2 minutes. Ideas?


OnkelBazi
 
Posts: 134
Joined: 22 Sep 2014, 09:24
Location: Bavaria

Re: Modding Guide: Part One

Post by OnkelBazi » 11 Dec 2014, 23:07

i will flatten faster

not faster but more

when i get flatt there only 30 fertile soil out of my inventory but i wanna more how can i chanfe this?

i hope u know what i mean


Maegfaer
Mod Developer
 
Posts: 246
Joined: 26 Sep 2014, 08:01

Re: Modding Guide: Part One

Post by Maegfaer » 12 Dec 2014, 08:28

That's influenced by the terraformingSpeed in your server's /config/world_X.xml file
Pioneer LiF:YO modder
Author of Life is Balanced
My Modding Guide

Image


Officinale
 
Posts: 7
Joined: 26 Nov 2014, 15:41

Re: Modding Guide: Part One

Post by Officinale » 17 Dec 2014, 20:21

What do I need to set to be able to flatten paved roads on my server?


Maegfaer
Mod Developer
 
Posts: 246
Joined: 26 Sep 2014, 08:01

Re: Modding Guide: Part One

Post by Maegfaer » 17 Dec 2014, 20:59

Officinale wrote:What do I need to set to be able to flatten paved roads on my server?


Extract the attached ZIP in /scripts/server/ on the server-side

On the client-side, edit the file /scripts/cm_substances.cs and find the StoneRoad entry (should be the last one). Change canBeShaped = 0 to canBeShaped = 1

In /data/skill_types.xml (both server and client side), add substance 177 to all the appropriate terraforming (flatten etc) abilities.
Pioneer LiF:YO modder
Author of Life is Balanced
My Modding Guide

Image


Officinale
 
Posts: 7
Joined: 26 Nov 2014, 15:41

Re: Modding Guide: Part One

Post by Officinale » 19 Dec 2014, 15:43

Maegfaer wrote:
Officinale wrote:What do I need to set to be able to flatten paved roads on my server?


Extract the attached ZIP in /scripts/server/ on the server-side

On the client-side, edit the file /scripts/cm_substances.cs and find the StoneRoad entry (should be the last one). Change canBeShaped = 0 to canBeShaped = 1

In /data/skill_types.xml (both server and client side), add substance 177 to all the appropriate terraforming (flatten etc) abilities.


works fine thanks :-)


Trekkan
 
Posts: 11
Joined: 21 Feb 2014, 06:30

Re: Modding Guide: Part One

Post by Trekkan » 23 Dec 2014, 06:58

Very nice guide! One thing I'm looking for are server side console commands. Commands like centerPrintAll and such? Is there a list of those anywhere?

Thanks!


Officinale
 
Posts: 7
Joined: 26 Nov 2014, 15:41

Re: Modding Guide: Part One

Post by Officinale » 28 Dec 2014, 14:28

I have another question: What do I need to set to allow all buildings skills to be allowed to be built on flattened rock ground?


Maegfaer
Mod Developer
 
Posts: 246
Joined: 26 Sep 2014, 08:01

Re: Modding Guide: Part One

Post by Maegfaer » 28 Dec 2014, 17:02

Officinale wrote:I have another question: What do I need to set to allow all buildings skills to be allowed to be built on flattened rock ground?


I think you only need to add the rock substance ID(s) to the substances list of the "Construct" and "Build" abilities etc. In skill_types.xml. No guarantees that that's enough, haven't tried it myself. Let me know if it works.
Pioneer LiF:YO modder
Author of Life is Balanced
My Modding Guide

Image


HydroxTV
Beta Tester
 
Posts: 84
Joined: 10 Oct 2014, 15:27

Re: Modding Guide: Part One

Post by HydroxTV » 29 Dec 2014, 16:06

Maegfaer wrote:
Officinale wrote:What do I need to set to be able to flatten paved roads on my server?


Extract the attached ZIP in /scripts/server/ on the server-side

On the client-side, edit the file /scripts/cm_substances.cs and find the StoneRoad entry (should be the last one). Change canBeShaped = 0 to canBeShaped = 1

In /data/skill_types.xml (both server and client side), add substance 177 to all the appropriate terraforming (flatten etc) abilities.



Still working after patch? :) Just answer as soon as you can,no hurry ^^


Officinale
 
Posts: 7
Joined: 26 Nov 2014, 15:41

Re: Modding Guide: Part One

Post by Officinale » 29 Dec 2014, 16:39

You need to add for:

<ability lvl="0" name="Build" id="19"> (Masonry)
<ability lvl="0" name="Construct" id="18"> (Construction)
<ability lvl="0" name="Raise a Building" id="20"> (Architecture)

The value 11 in:

<ent_req type="substance">1 6 7 8 9 10 11 19</ent_req>

In skill_types.xml client sided


HydroxTV
Beta Tester
 
Posts: 84
Joined: 10 Oct 2014, 15:27

Re: Modding Guide: Part One

Post by HydroxTV » 01 Jan 2015, 09:29

Did someone test the paved roads mod,is it still working after the patch?!


Maegfaer
Mod Developer
 
Posts: 246
Joined: 26 Sep 2014, 08:01

Re: Modding Guide: Part One

Post by Maegfaer » 01 Jan 2015, 11:49

HydroxTV wrote:Did someone test the paved roads mod,is it still working after the patch?!


Should still work. Also, why not test it yourself? Someone has got to do it. ;)
Pioneer LiF:YO modder
Author of Life is Balanced
My Modding Guide

Image


HydroxTV
Beta Tester
 
Posts: 84
Joined: 10 Oct 2014, 15:27

Re: Modding Guide: Part One

Post by HydroxTV » 01 Jan 2015, 21:03

Maegfaer wrote:
Officinale wrote:I have another question: What do I need to set to allow all buildings skills to be allowed to be built on flattened rock ground?


I think you only need to add the rock substance ID(s) to the substances list of the "Construct" and "Build" abilities etc. In skill_types.xml. No guarantees that that's enough, haven't tried it myself. Let me know if it works.



Works actually :)


Officinale
 
Posts: 7
Joined: 26 Nov 2014, 15:41

Re: Modding Guide: Part One

Post by Officinale » 03 Jan 2015, 14:33

How can I change time for example uprooting?


Venom
 
Posts: 6
Joined: 21 Dec 2014, 04:31

Re: Modding Guide: Part One

Post by Venom » 06 Jan 2015, 02:35

HOw can I speed up the Fishing, Terrreforming, and all the actions, everything is very time consuming... Would be nice to speed it up a little


Dawixx
 
Posts: 1
Joined: 12 Jan 2015, 19:18

Re: Modding Guide: Part One

Post by Dawixx » 12 Jan 2015, 19:20

I've added one recipe and the game doesnt want to turn on now... stuck at loading main menu. What did I do wrong?


KarlHeinzSchneid
 
Posts: 6
Joined: 21 Oct 2014, 21:32

Re: Modding Guide: Part One

Post by KarlHeinzSchneid » 13 Jan 2015, 08:24

Cruber wrote:Anyone figure out how to change the uproot speed?

I find this block of code under data/skill_types.xml file.

<ability lvl="30" name="Uproot" id="35">
<duration const="50 5"></duration>



Same question for me?!?


Bull4Ever
 
Posts: 3
Joined: 18 Jan 2015, 08:21

Re: Modding Guide: Part One

Post by Bull4Ever » 18 Jan 2015, 09:19

Hey guys.

Just posted this in the feedback sections where someone was having the same problem as I was.

auroch-issue-t9054/

Like a dumb ass I decided to tame an Auroch with no Barn. Now I have no room in my inventory and cannot build a barn to store it in.

Attempted to drop its weight to '0'. But I am not sure how to change both the client-side and the server. I think I have found one, but not the other, as I go into the game the Bull shows a weight of '0' but I still cannot put it into the traders cart. I assume it is because the "length" of the traders cart is too small.

If someone could explain where to find each file it would be greatly appreciated :D

Or if there is an easier way to solve my dilemma.

Thanks a lot!!


EDIT:

Just solved my problem using GM commands, raised my Will so I could carry 300+ stones. No need to do any modding.


Drakanus
 
Posts: 7
Joined: 21 Jan 2015, 00:11

Re: Modding Guide: Part One

Post by Drakanus » 23 Jan 2015, 18:24

hi there.
I try to find the files to mod a server.

i want to change the crates an furnace or kiln space from 100 to 1000.
But i cant find the files wich needed.

Could someone make a zip file from the changeable server files and upload them for me pls?


Schattenfalke
 
Posts: 7
Joined: 27 Jan 2015, 08:30

Re: Modding Guide: Part One

Post by Schattenfalke » 28 Jan 2015, 13:01

First thank you for this awesome guide! It helps me to modificate nearby every task for my peoples. ;)

Now to my request:

I search for a possibility to create loot for stumps to make the long-timed uprooting a little bit more attractive.
I hear some rumors that these stumps cause server-problems like lags or something else. And i want to prevent that.
To speed it up it is not that "real" as I intend for.

Who can help? Who have some tips for me with worked examples?

Thank you very much.

Return to Guides and Tutorials