[MOD] Additional inventory items on character creation

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

NoVoS
 
Posts: 3
Joined: 02 Jul 2015, 10:34

Re: [MOD] Additional inventory items on character creation

Post by NoVoS » 02 Jul 2015, 10:36

This isent working for me in 5.5.2

Code: Select all
CREATE TRIGGER `character_after_insert` AFTER INSERT ON `character` FOR EACH ROW BEGIN
   SET @backpack = NEW.RootContainerID;
   SET @temp = f_insertNewItemInventory(@backpack, 1059, 100, 100, 50000, 50000, '',''); /* copper coins */
   SET @temp = f_insertNewItemInventory(@backpack, 1060, 100, 50, 50000, 50000, '',''); /* silver coins */
   SET @temp = f_insertNewItemInventory(@backpack, 1061, 100, 25, 50000, 50000, '',''); /* gold coins */   
END

User avatar
Rjmspoel
True Believer
 
Posts: 69
Joined: 01 Oct 2014, 12:44

Re: [MOD] Additional inventory items on character creation

Post by Rjmspoel » 03 Jul 2015, 21:39

No, the devs are trying freaking hard to make sure none of the mods work anymore with each version they update


NoVoS
 
Posts: 3
Joined: 02 Jul 2015, 10:34

Re: [MOD] Additional inventory items on character creation

Post by NoVoS » 03 Jul 2015, 22:02

na that's .... but is there any solution for 0.5.5.2?

User avatar
Rjmspoel
True Believer
 
Posts: 69
Joined: 01 Oct 2014, 12:44

Re: [MOD] Additional inventory items on character creation

Post by Rjmspoel » 06 Jul 2015, 14:17

No....

User avatar
Azzerhoden
Alpha Tester
 
Posts: 1621
Joined: 08 May 2014, 17:44

Re: [MOD] Additional inventory items on character creation

Post by Azzerhoden » 09 Jul 2015, 23:50

So, I was able to resolve this. Had to run all the commands in the query window to get an error to point me to the solution. After it made perfect sense.... :pardon:

The issue is that with the changes to f_insertNewItemInventory, you do not pass in '' for the 7th and 8th parameter (though it will work depending on variables unknown to me....). You instead pass in the NULL value.

Here's my code that adds a sack, then populates it with some items.
Code: Select all
DELIMITER #
CREATE TRIGGER `character_after_insert` AFTER INSERT ON `character` FOR EACH ROW BEGIN
   SET @sack = f_createContainer(NEW.RootContainerID, 459, 0);
   SET @temp = f_insertNewItemInventory(@sack, 555, 50, 1, 50000, 50000, NULL, NULL); /* practice sword */
   SET @temp = f_insertNewItemInventory(@sack, 41, 100, 1, 50000, 50000, NULL, NULL); /* primitive shovel */
   SET @temp = f_insertNewItemInventory(@sack, 43, 100, 1, 50000, 50000, NULL, NULL); /* primitive hammer */
   SET @temp = f_insertNewItemInventory(@sack, 45, 100, 1, 50000, 50000, NULL, NULL); /* primitive axe */
   SET @temp = f_insertNewItemInventory(@sack, 50, 100, 1, 50000, 50000, NULL, NULL); /* primitive saw */
   SET @temp = f_insertNewItemInventory(@sack, 30, 100, 1, 50000, 50000, NULL, NULL); /* primitive sickle */
   SET @temp = f_insertNewItemInventory(@sack, 47, 100, 1, 50000, 50000, NULL, NULL); /* primitive pickaxe */
   SET @temp = f_insertNewItemInventory(@sack, 289, 100, 1, 50000, 50000, NULL, NULL); /* primitive knife */
   SET @temp = f_insertNewItemInventory(@sack, 974, 50, 25, 50000, 50000, NULL, NULL); /* 25x q50 Apple Buns */
   SET @temp = f_insertNewItemInventory(@sack, 1028, 50, 1, 15000, 15000, NULL, NULL); /* primitive cooking pot */
END #


Just tested - works for me
| - Alpha Tester and Zealous Believer
Image

Kingdom of Hyperion founding Duchy - A practical RP Community est. 1999 - Apply Today!

User avatar
Rjmspoel
True Believer
 
Posts: 69
Joined: 01 Oct 2014, 12:44

Re: [MOD] Additional inventory items on character creation

Post by Rjmspoel » 10 Jul 2015, 15:52

Can not use a DELIMITER with BlueFang Servers it seems :(

You are running mysql db Azzerhoden?

User avatar
Azzerhoden
Alpha Tester
 
Posts: 1621
Joined: 08 May 2014, 17:44

Re: [MOD] Additional inventory items on character creation

Post by Azzerhoden » 10 Jul 2015, 16:25

I am, I run it on a NFOServer. I think you can run the trigger without specifying a delimiter though. I'm sure I saw something in another thread on these forums.
| - Alpha Tester and Zealous Believer
Image

Kingdom of Hyperion founding Duchy - A practical RP Community est. 1999 - Apply Today!


NavyS34l
 
Posts: 41
Joined: 15 Jun 2015, 16:12

Re: [MOD] Additional inventory items on character creation

Post by NavyS34l » 11 Jul 2015, 03:31

@Rjmspoel

Cant you just manually create the trigger from Heidi or whatever tool you're using and paste the BEGIN-END in? That is what I did and its working fine.

Thanks for the post Azzerhoden. I found out the same fix beforehand just didn't have time to post it, damn work in the AM.
Image

User avatar
Rjmspoel
True Believer
 
Posts: 69
Joined: 01 Oct 2014, 12:44

Re: [MOD] Additional inventory items on character creation

Post by Rjmspoel » 11 Jul 2015, 08:53

NavyS34l wrote:@Rjmspoel

Cant you just manually create the trigger from Heidi or whatever tool you're using and paste the BEGIN-END in? That is what I did and its working fine.

Thanks for the post Azzerhoden. I found out the same fix beforehand just didn't have time to post it, damn work in the AM.



Yea gonna do that and see if it works, complementary job Azzerhoden for experimenting, I can't just experiment on our server, people go mad if i screw up something and need a wipe :P


NavyS34l
 
Posts: 41
Joined: 15 Jun 2015, 16:12

Re: [MOD] Additional inventory items on character creation

Post by NavyS34l » 12 Jul 2015, 03:40

Yeah my server is the same way. Luckily if it doesnt work you can just delete the trigger and reboot, everything is good.
Image


Zhalls
Alpha Tester
 
Posts: 89
Joined: 14 Mar 2014, 19:30

Re: [MOD] Additional inventory items on character creation

Post by Zhalls » 13 Aug 2015, 05:25

Works flawlessly as of 8/12/15.
Thanks!


GriffinLion
 
Posts: 3
Joined: 13 Mar 2016, 01:11

Re: [MOD] Additional inventory items on character creation

Post by GriffinLion » 13 Mar 2016, 01:16

Hi all,

I'm extremely new to SQL scripts, the info here has helped me a lot in setting up my new rented server,

However after using the parameters you guys suggested i edited it to give metal tools & a low level horse.

I removed the horse code from the script in the Patch.sql file and re uploaded it, But still the horse spawns?

does the game add the feature into another SQL file somewhere that i also have to remove? so the horse no longer spawns in the starter kit.

Thanks for your help in advanced


Piter_Ragnarson
 
Posts: 3
Joined: 21 Nov 2013, 19:49

Re: [MOD] Additional inventory items on character creation

Post by Piter_Ragnarson » 19 Mar 2016, 11:02

GriffinLion wrote:Hi all,

I'm extremely new to SQL scripts, the info here has helped me a lot in setting up my new rented server,

However after using the parameters you guys suggested i edited it to give metal tools & a low level horse.

I removed the horse code from the script in the Patch.sql file and re uploaded it, But still the horse spawns?

does the game add the feature into another SQL file somewhere that i also have to remove? so the horse no longer spawns in the starter kit.

Thanks for your help in advanced


For ONE time add smth like this in your patch sql

DROP TRIGGER `asd`;
replace asd wjth the name of your trigger, that add tools and horses

add this line before your trigger
After one server restart you can delete this line.


Catherine
 
Posts: 31
Joined: 01 Mar 2016, 10:00

Re: [MOD] Additional inventory items on character creation

Post by Catherine » 30 Mar 2016, 11:20

non of the scripts wich are in this thread are working for me.
is there anyone who can help us with how and where to put the code and make it work properly

User avatar
Custodian
Mod Developer
 
Posts: 655
Joined: 08 Jun 2015, 14:58
Location: Lisbon

Re: [MOD] Additional inventory items on character creation

Post by Custodian » 30 Mar 2016, 11:22

Padme wrote:non of the scripts wich are in this thread are working for me.
is there anyone who can help us with how and where to put the code and make it work properly

You dont need to use any scripts.
Alter server file "data\cm_createchar.xml" to change startup items for different races.


Catherine
 
Posts: 31
Joined: 01 Mar 2016, 10:00

Re: [MOD] Additional inventory items on character creation

Post by Catherine » 30 Mar 2016, 11:39

Custodian wrote:
Padme wrote:non of the scripts wich are in this thread are working for me.
is there anyone who can help us with how and where to put the code and make it work properly

You dont need to use any scripts.
Alter server file "data\cm_createchar.xml" to change startup items for different races.



thx :D


Everettham
Alpha Tester
 
Posts: 56
Joined: 22 Apr 2014, 02:16

Re: [MOD] Additional inventory items on character creation

Post by Everettham » 09 May 2016, 19:10

Anyway to alter this code so that items spawn not just at character creation but after respawn from death as well?

Code: Select all
DELIMITER //
CREATE TRIGGER `character_after_insert` AFTER INSERT ON `character` FOR EACH ROW BEGIN
SET @backpack = f_createContainer(NEW.RootContainerID, 458, 0);
SET @temp = f_insertNewItemInventory(@backpack, 555, 50, 1, 50000, 50000, '', 0,0,0,0, 0,0);
END//


Cromesqui
 
Posts: 4
Joined: 23 Aug 2016, 08:43

Re: [MOD] Additional inventory items on character creation

Post by Cromesqui » 23 Aug 2016, 19:10

Custodian wrote:
Padme wrote:non of the scripts wich are in this thread are working for me.
is there anyone who can help us with how and where to put the code and make it work properly

You dont need to use any scripts.
Alter server file "data\cm_createchar.xml" to change startup items for different races.



it's works perfecly


Cromesqui
 
Posts: 4
Joined: 23 Aug 2016, 08:43

Re: [MOD] Additional inventory items on character creation

Post by Cromesqui » 23 Aug 2016, 19:12

[quote="Everettham"]Anyway to alter this code so that items spawn not just at character creation but after respawn from death as well?





need the same, i'd like to change the skill too, for poeples could us sword, bow and leather armor


Cromesqui
 
Posts: 4
Joined: 23 Aug 2016, 08:43

Re: [MOD] Additional inventory items on character creation

Post by Cromesqui » 23 Aug 2016, 19:19

to change add skill a creating char, it could be here? data skill_types.xml


i'm afraid it's cumulate skills points after respawning


Catherine
 
Posts: 31
Joined: 01 Mar 2016, 10:00

Re: [MOD] Additional inventory items on character creation

Post by Catherine » 15 Sep 2016, 08:28

<?xml version="1.0" encoding="utf-8"?>
<xml>
<items>
<item id="316" amount="1" vik="no" mon="no"/>
<item id="1063" amount="1" eur="no" mon="no"/>
<item id="951" amount="1" vik="no" eur="no"/>
<item id="297" amount="1" vik="no" mon="no"/>
<item id="1137" amount="1" eur="no" mon="no"/>
<item id="1138" amount="1" vik="no" eur="no"/>
<item id="984" amount="2"/>
</items>
</xml>

How do i make this work for all characterS? cause it works only on 1

User avatar
WolfDart
Zealous Believer
 
Posts: 15
Joined: 26 Dec 2016, 01:26

Re: [MOD] Additional inventory items on character creation

Post by WolfDart » 29 Jan 2017, 23:50

Catherine wrote:<?xml version="1.0" encoding="utf-8"?>
<xml>
<items>
<item id="316" amount="1" vik="no" mon="no"/>
<item id="1063" amount="1" eur="no" mon="no"/>
<item id="951" amount="1" vik="no" eur="no"/>
<item id="297" amount="1" vik="no" mon="no"/>
<item id="1137" amount="1" eur="no" mon="no"/>
<item id="1138" amount="1" vik="no" eur="no"/>
<item id="984" amount="2"/>
</items>
</xml>

How do i make this work for all characterS? cause it works only on 1


I would also like to know how this works, There is no information online regarding this question.. I would result to scripts & i'm sure it's easy but i'm a complete noob when it comes to scripting. I can't afford to mess my server up at this point :no:


Tobias0412
 
Posts: 32
Joined: 06 Dec 2016, 21:15

Re: [MOD] Additional inventory items on character creation

Post by Tobias0412 » 31 Jan 2017, 10:18

Catherine wrote:
How do i make this work for all characterS? cause it works only on 1


What do u mean with "works for all" ? This script is running every time u create a new character on your server. Every character will get the items you defined there....

But anyway...here are some tipps:

The following code we use on our server. Every new char, gets all tools when he spawns.
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<xml>
   <items>
      <item id="297" amount="1" vik="no" mon="no"/>
      <item id="1137" amount="1" eur="no" mon="no"/>
      <item id="1138" amount="1" vik="no" eur="no"/>
      <item id="42" amount="1"/>
      <item id="33" amount="1"/>
      <item id="40" amount="1"/>
      <item id="51" amount="1"/>
      <item id="48" amount="1"/>
      <item id="290" amount="1"/>
      <item id="46" amount="1"/>
      <item id="44" amount="1"/>
      <item id="1013" amount="5"/>
   </items>
</xml>


If u want other items or more items just change, add oder delete some lines. If u want to give more then 1 from a single item, just change "amount". If the item is not stackable, just add another line with the same item id.

Without definiers all items will have Q50 and D50.

VIK, MON & EUR means Viking, Mongol and European.
So in my code this means:
Item 297 is only for European(EUR)
Item 1137 is only for Viking(VIK)
Item 1138 is only for Mongol(MON)

if u have more questions about this, just ask. :-)


Estharos
 
Posts: 11
Joined: 29 Jan 2017, 16:18

Re: [MOD] Additional inventory items on character creation

Post by Estharos » 31 Jan 2017, 19:27

Where you put that coding?

Cheers,


Tobias0412
 
Posts: 32
Joined: 06 Dec 2016, 21:15

Re: [MOD] Additional inventory items on character creation

Post by Tobias0412 » 01 Feb 2017, 00:33

Estharos wrote:Where you put that coding?

Cheers,


Look in your server folder, there is a folder named "data" and there u will find a file named "cm_createchar.xml"
Just edit the file as u like and replace with the old one.


Helena
 
Posts: 12
Joined: 23 Jan 2016, 17:46

Re: [MOD] Additional inventory items on character creation

Post by Helena » 02 Feb 2017, 10:57

What is the definer for the quality?


Bustylicious
 
Posts: 2
Joined: 12 Jul 2017, 15:33

Re: [MOD] Additional inventory items on character creation

Post by Bustylicious » 12 Jul 2017, 15:37

Is it possible to bind it on the SteamID so that players can't use it twice by creating another char?


Hunter79
 
Posts: 9
Joined: 03 Mar 2019, 15:53

Re: [MOD] Additional inventory items on character creation

Post by Hunter79 » 15 Mar 2019, 19:30

do
Last edited by Hunter79 on 31 May 2021, 06:55, edited 1 time in total.


Polysta2r
 
Posts: 1
Joined: 26 Feb 2018, 00:11

Re: [MOD] Additional inventory items on character creation

Post by Polysta2r » 19 Mar 2019, 00:01

Hello, your mod is not working on Life is feudal 2.0, can you update it as soon as possible? if you updated it, i will donate $20 to you. thanks :D


Nitewolf
 
Posts: 2
Joined: 08 Jan 2018, 12:44

Re: [MOD] Additional inventory items on character creation

Post by Nitewolf » 14 Feb 2020, 01:28

How do we add definers to get quality and durability?
If you want 1 pickaxe quality 100 durability 50 say?

Return to Game mods