How to add custom items?

Place for sharing your game modifications for Life is Feudal: Your Own

Dannan
Beta Tester
 
Posts: 55
Joined: 08 Oct 2014, 07:22

How to add custom items?

Post by Dannan » 09 Nov 2015, 22:42

Hi all,

I am trying to add a custom item to the server, for purposes of a Quest event. I have followed the steps detailed below, however when I /add in GM mode I get a wooden scout tower in my inventory, rather than the custom item.

1. Added item to object_types table by adding a line of data to the relevant SQL command in dump.sql and rebooting server. The line of data added was based on the data for 'Torch', but used the ID of '2222', and of course name etc was changed.
2. Created a PNG image, named it as per the name provided for the FaceName field in the objects_types table, and put it into the art\2D\Items folder client side.
3. Also on client side opened objects_types.xml and added a <row> at the bottom with data matching that which was added to the DB.

What am I missing? Why am I getting a wooden scout tower?

User avatar
Cattoaster
 
Posts: 110
Joined: 03 Nov 2014, 16:13
Location: Medieval Germany

Re: How to add custom items?

Post by Cattoaster » 10 Nov 2015, 23:42

Hej Dannan,

your approach is correct. I've added some stuff on my local lif server too. At first assigned ids starting from 1153 (current max object id is 1152), ingame check: passed.

Then I've added an object with the id 2222 ... and the ingame result was a -surprise- Wooden Scout Tower :ROFL:

It took me awhile but I've figured it out.
If you add an object with the id 2221 you'll get a castle wall, add an object with the id 2178 and you'll get a 'primitve sickle'. Don't forget these first 30 pseudo-objects (system objects, gameplay objects, inventory etc.)

2178-30 ..
so the current max. value for a valid ID is 2048 (and useable new objects)
I guess it could be a mariadb configuration but I've not checked it yet.

That's it


Alakar
Beta Tester
 
Posts: 202
Joined: 23 Jan 2015, 07:39

Re: How to add custom items?

Post by Alakar » 11 Nov 2015, 03:48

besides adding them on the server you also have to add them on the client side in the objects_types.xml file and also in the equip_types.xml file if you can equip it or its an armor.

-Alakar
http://arkhaya.com/


Dannan
Beta Tester
 
Posts: 55
Joined: 08 Oct 2014, 07:22

Re: How to add custom items?

Post by Dannan » 11 Nov 2015, 23:42

Wow thanks Cattoaster, well found, I am using 1900 as the ID now, and its working great!

Multiple Quest Items, here we come!

User avatar
RetroLogi
 
Posts: 137
Joined: 29 Dec 2014, 15:49
Location: Italia

Re: How to add custom items?

Post by RetroLogi » 25 Sep 2016, 09:00

Someone could create a guide/tutorial to insert new objects, I would be grateful.

Return to Game mods