[MOD] Additional inventory items on character creation

Place for sharing your game modifications for Life is Feudal: Your Own
User avatar
Vamyan
 
Posts: 198
Joined: 23 Oct 2014, 22:29

[MOD] Additional inventory items on character creation

Post by Vamyan » 09 Nov 2014, 21:21

With the following SQL trigger, all newly created characters on the server will start with a backpack that has a practice sword inside.

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//


Hyldeblomsten
True Believer
 
Posts: 22
Joined: 18 Oct 2014, 04:11

Re: [MOD] Additional inventory items on character creation

Post by Hyldeblomsten » 30 Nov 2014, 03:51

sweet.. but where do i add this ?

User avatar
Vamyan
 
Posts: 198
Joined: 23 Oct 2014, 22:29

Re: [MOD] Additional inventory items on character creation

Post by Vamyan » 30 Nov 2014, 12:43

Execute it in your server database, it creates a trigger procedure.

I actually set mine up to give the full "newbie pack" from the GM tools thread...

Code: Select all
   SET @backpack = f_createContainer(NEW.RootContainerID, 458, 0);
   SET @temp = f_insertNewItemInventory(@backpack, 555, 100, 1, 50000, 50000, '', 0,0,0,0, 0,0); /* practice sword */
   SET @temp = f_insertNewItemInventory(@backpack, 40, 100, 1, 50000, 50000, '', 0,0,0,0, 0,0); /* shovel */
   SET @temp = f_insertNewItemInventory(@backpack, 48, 100, 1, 50000, 50000, '', 0,0,0,0, 0,0); /* pickaxe */
   SET @temp = f_insertNewItemInventory(@backpack, 46, 100, 1, 50000, 50000, '', 0,0,0,0, 0,0); /* hatchet */
   SET @temp = f_insertNewItemInventory(@backpack, 51, 100, 1, 50000, 50000, '', 0,0,0,0, 0,0); /* saw */
   SET @temp = f_insertNewItemInventory(@backpack, 33, 100, 1, 50000, 50000, '', 0,0,0,0, 0,0); /* sickle */
   SET @temp = f_insertNewItemInventory(@backpack, 974, 50, 25, 50000, 50000, '', 0,0,0,0, 0,0); /* 25x q50 Apple Buns */
   SET @temp = f_insertNewItemInventory(@backpack, 885, 50, 1, 15000, 15000, '', 0,0,0,0, 0,0); /* padded helm */
   SET @temp = f_insertNewItemInventory(@backpack, 886, 50, 1, 15000, 15000, '', 0,0,0,0, 0,0); /* padded chest */
   SET @temp = f_insertNewItemInventory(@backpack, 887, 50, 1, 15000, 15000, '', 0,0,0,0, 0,0); /* padded arms */
   SET @temp = f_insertNewItemInventory(@backpack, 888, 50, 1, 15000, 15000, '', 0,0,0,0, 0,0); /* padded gauntlets */
   SET @temp = f_insertNewItemInventory(@backpack, 889, 50, 1, 15000, 15000, '', 0,0,0,0, 0,0); /* padded leggings */
   SET @temp = f_insertNewItemInventory(@backpack, 890, 50, 1, 15000, 15000, '', 0,0,0,0, 0,0); /* padded boots */


Hyldeblomsten
True Believer
 
Posts: 22
Joined: 18 Oct 2014, 04:11

Re: [MOD] Additional inventory items on character creation

Post by Hyldeblomsten » 01 Dec 2014, 03:23

sweet dude.. is there a way so they dont get a backpack ? dont wanna give to much stuff out?. :)

User avatar
Vamyan
 
Posts: 198
Joined: 23 Oct 2014, 22:29

Re: [MOD] Additional inventory items on character creation

Post by Vamyan » 02 Dec 2014, 01:44

change the SET @backpack line to SET @backpack = NEW.RootContainerID;


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

Re: [MOD] Additional inventory items on character creation

Post by Heinrich_von_Leipa » 02 Dec 2014, 12:58

Vamyan wrote:Execute it in your server database, it creates a trigger procedure.


Hi! Could you explain this part a little more, for sql noobs? :-) I tried adding the snippet at the end of the patch.sql like some other snippets from this forum, but it doesn't seem to do anything :-) So could you explain in a few steps where to put this code, to make it a trigger?

User avatar
Vamyan
 
Posts: 198
Joined: 23 Oct 2014, 22:29

Re: [MOD] Additional inventory items on character creation

Post by Vamyan » 02 Dec 2014, 17:03

I just put it in a query window in HeidiSQL, but I don't see why it wouldn't work in the patch.sql... hrm.


Hyldeblomsten
True Believer
 
Posts: 22
Joined: 18 Oct 2014, 04:11

Re: [MOD] Additional inventory items on character creation

Post by Hyldeblomsten » 03 Dec 2014, 03:18

sweet dude.. thanks for your work.. helps alot..

do you know if you can alter i the char. race.. i tryed to change the names in the database but when i make a new char. it still has the normal races.. ?

User avatar
Vamyan
 
Posts: 198
Joined: 23 Oct 2014, 22:29

Re: [MOD] Additional inventory items on character creation

Post by Vamyan » 03 Dec 2014, 10:50

I don't know, but I imagine it could be hardcoded into the program for character creation, or at least hardcoded into the GUI.


Hyldeblomsten
True Believer
 
Posts: 22
Joined: 18 Oct 2014, 04:11

Re: [MOD] Additional inventory items on character creation

Post by Hyldeblomsten » 03 Dec 2014, 15:06

okay.. thanks for your help.. :beer:


Gazerano
 
Posts: 4
Joined: 08 Jan 2015, 17:21

Re: [MOD] Additional inventory items on character creation

Post by Gazerano » 13 Jan 2015, 16:33

Vamyan wrote:Execute it in your server database, it creates a trigger procedure.

I actually set mine up to give the full "newbie pack" from the GM tools thread...

Code: Select all
   SET @backpack = f_createContainer(NEW.RootContainerID, 458, 0);
   SET @temp = f_insertNewItemInventory(@backpack, 555, 100, 1, 50000, 50000, '', 0,0,0,0, 0,0); /* practice sword */
   SET @temp = f_insertNewItemInventory(@backpack, 40, 100, 1, 50000, 50000, '', 0,0,0,0, 0,0); /* shovel */
   SET @temp = f_insertNewItemInventory(@backpack, 48, 100, 1, 50000, 50000, '', 0,0,0,0, 0,0); /* pickaxe */
   SET @temp = f_insertNewItemInventory(@backpack, 46, 100, 1, 50000, 50000, '', 0,0,0,0, 0,0); /* hatchet */
   SET @temp = f_insertNewItemInventory(@backpack, 51, 100, 1, 50000, 50000, '', 0,0,0,0, 0,0); /* saw */
   SET @temp = f_insertNewItemInventory(@backpack, 33, 100, 1, 50000, 50000, '', 0,0,0,0, 0,0); /* sickle */
   SET @temp = f_insertNewItemInventory(@backpack, 974, 50, 25, 50000, 50000, '', 0,0,0,0, 0,0); /* 25x q50 Apple Buns */
   SET @temp = f_insertNewItemInventory(@backpack, 885, 50, 1, 15000, 15000, '', 0,0,0,0, 0,0); /* padded helm */
   SET @temp = f_insertNewItemInventory(@backpack, 886, 50, 1, 15000, 15000, '', 0,0,0,0, 0,0); /* padded chest */
   SET @temp = f_insertNewItemInventory(@backpack, 887, 50, 1, 15000, 15000, '', 0,0,0,0, 0,0); /* padded arms */
   SET @temp = f_insertNewItemInventory(@backpack, 888, 50, 1, 15000, 15000, '', 0,0,0,0, 0,0); /* padded gauntlets */
   SET @temp = f_insertNewItemInventory(@backpack, 889, 50, 1, 15000, 15000, '', 0,0,0,0, 0,0); /* padded leggings */
   SET @temp = f_insertNewItemInventory(@backpack, 890, 50, 1, 15000, 15000, '', 0,0,0,0, 0,0); /* padded boots */


Doesn't work for me, it says SQL Error (1109): Unknown table NEW in field list. Which sort of makes sense but no idea how to fix it. :(


Gazerano
 
Posts: 4
Joined: 08 Jan 2015, 17:21

Re: [MOD] Additional inventory items on character creation

Post by Gazerano » 13 Jan 2015, 16:54

Its ok, I see where I went wrong. Needed to insert that code into the origional posts context. :oops:


Ziong18
 
Posts: 109
Joined: 09 Oct 2014, 03:48

Re: [MOD] Additional inventory items on character creation

Post by Ziong18 » 17 Jan 2015, 11:20

Gazerano wrote:Its ok, I see where I went wrong. Needed to insert that code into the origional posts context. :oops:


Can you be more specific plz? I'm getting the same error and can't figure out how to fix?


Koiecks
 
Posts: 28
Joined: 07 Feb 2015, 07:15

Re: [MOD] Additional inventory items on character creation

Post by Koiecks » 08 Feb 2015, 02:23

I am a total noob to the missing part, where do I add this script to make it work? I've tried several places including the patch.sql and can't get it to work
Image


Koiecks
 
Posts: 28
Joined: 07 Feb 2015, 07:15

Re: [MOD] Additional inventory items on character creation

Post by Koiecks » 09 Feb 2015, 04:27

This is the error I'm getting when running a query, hoping to create a trigger

SQL Error (1305): FUNCTION information_schema.f_createContainer does not exist
Image


Koiecks
 
Posts: 28
Joined: 07 Feb 2015, 07:15

Re: [MOD] Additional inventory items on character creation

Post by Koiecks » 09 Feb 2015, 04:32

I think I may have figured it out, one of the SET lines was offfset by one space, will test and report on the findings
Image


Koiecks
 
Posts: 28
Joined: 07 Feb 2015, 07:15

Re: [MOD] Additional inventory items on character creation

Post by Koiecks » 09 Feb 2015, 05:36

I was able to get the backpack and the practice sword to appear. I could not, (yes I checked all the codes), get anything else to appear in the backpack that was in my inventory.
Image


Koiecks
 
Posts: 28
Joined: 07 Feb 2015, 07:15

Re: [MOD] Additional inventory items on character creation

Post by Koiecks » 09 Feb 2015, 14:40

This is the code I placed in the query, it ran with no errors but still only gave me the practice sword and backpack.
After trying to remove the END// I can't get the query to work at all.

DELIMITER //
CREATE TRIGGER `character_after_insert` AFTER INSERT ON `character` FOR EACH ROW BEGIN
SET @backpack line to SET @backpack = NEW.RootContainerID;
SET @temp = f_insertNewItemInventory(@backpack, 555, 50, 1, 50000, 50000, '', 0,0,0,0, 0,0);
END//
SET @backpack line to SET @backpack = NEW.RootContainerID;
SET @temp = f_insertNewItemInventory(@backpack, 555, 100, 1, 50000, 50000, '', 0,0,0,0, 0,0); /* practice sword */
SET @temp = f_insertNewItemInventory(@backpack, 40, 100, 1, 50000, 50000, '', 0,0,0,0, 0,0); /* shovel */
SET @temp = f_insertNewItemInventory(@backpack, 48, 100, 1, 50000, 50000, '', 0,0,0,0, 0,0); /* pickaxe */
SET @temp = f_insertNewItemInventory(@backpack, 46, 100, 1, 50000, 50000, '', 0,0,0,0, 0,0); /* hatchet */
SET @temp = f_insertNewItemInventory(@backpack, 51, 100, 1, 50000, 50000, '', 0,0,0,0, 0,0); /* saw */
SET @temp = f_insertNewItemInventory(@backpack, 33, 100, 1, 50000, 50000, '', 0,0,0,0, 0,0); /* sickle */
SET @temp = f_insertNewItemInventory(@backpack, 974, 50, 25, 50000, 50000, '', 0,0,0,0, 0,0); /* 25x q50 Apple Buns */
SET @temp = f_insertNewItemInventory(@backpack, 885, 50, 1, 15000, 15000, '', 0,0,0,0, 0,0); /* padded helm */
SET @temp = f_insertNewItemInventory(@backpack, 886, 50, 1, 15000, 15000, '', 0,0,0,0, 0,0); /* padded chest */
SET @temp = f_insertNewItemInventory(@backpack, 887, 50, 1, 15000, 15000, '', 0,0,0,0, 0,0); /* padded arms */
SET @temp = f_insertNewItemInventory(@backpack, 888, 50, 1, 15000, 15000, '', 0,0,0,0, 0,0); /* padded gauntlets */
SET @temp = f_insertNewItemInventory(@backpack, 889, 50, 1, 15000, 15000, '', 0,0,0,0, 0,0); /* padded leggings */
SET @temp = f_insertNewItemInventory(@backpack, 890, 50, 1, 15000, 15000, '', 0,0,0,0, 0,0); /* padded boots */
Image


Koiecks
 
Posts: 28
Joined: 07 Feb 2015, 07:15

Re: [MOD] Additional inventory items on character creation

Post by Koiecks » 09 Feb 2015, 21:29

I had it working at least in a partial since and now I can't get it to even give the new characters the backpack or practice sword. Heidi SQL keeps telling me error 1064, wrong syntax near line 2.
Will someone please help with this, it would be great to be able to actually use this to help the new players pain.

That is this part
CREATE TRIGGER `character_after_insert` AFTER INSERT ON `character` FOR EACH ROW BEGIN

Koiecks wrote:This is the code I placed in the query, it ran with no errors but still only gave me the practice sword and backpack.
After trying to remove the END// I can't get the query to work at all.

DELIMITER //
CREATE TRIGGER `character_after_insert` AFTER INSERT ON `character` FOR EACH ROW BEGIN
SET @backpack line to SET @backpack = NEW.RootContainerID;
SET @temp = f_insertNewItemInventory(@backpack, 555, 50, 1, 50000, 50000, '', 0,0,0,0, 0,0);
END//
SET @backpack line to SET @backpack = NEW.RootContainerID;
SET @temp = f_insertNewItemInventory(@backpack, 555, 100, 1, 50000, 50000, '', 0,0,0,0, 0,0); /* practice sword */
SET @temp = f_insertNewItemInventory(@backpack, 40, 100, 1, 50000, 50000, '', 0,0,0,0, 0,0); /* shovel */
SET @temp = f_insertNewItemInventory(@backpack, 48, 100, 1, 50000, 50000, '', 0,0,0,0, 0,0); /* pickaxe */
SET @temp = f_insertNewItemInventory(@backpack, 46, 100, 1, 50000, 50000, '', 0,0,0,0, 0,0); /* hatchet */
SET @temp = f_insertNewItemInventory(@backpack, 51, 100, 1, 50000, 50000, '', 0,0,0,0, 0,0); /* saw */
SET @temp = f_insertNewItemInventory(@backpack, 33, 100, 1, 50000, 50000, '', 0,0,0,0, 0,0); /* sickle */
SET @temp = f_insertNewItemInventory(@backpack, 974, 50, 25, 50000, 50000, '', 0,0,0,0, 0,0); /* 25x q50 Apple Buns */
SET @temp = f_insertNewItemInventory(@backpack, 885, 50, 1, 15000, 15000, '', 0,0,0,0, 0,0); /* padded helm */
SET @temp = f_insertNewItemInventory(@backpack, 886, 50, 1, 15000, 15000, '', 0,0,0,0, 0,0); /* padded chest */
SET @temp = f_insertNewItemInventory(@backpack, 887, 50, 1, 15000, 15000, '', 0,0,0,0, 0,0); /* padded arms */
SET @temp = f_insertNewItemInventory(@backpack, 888, 50, 1, 15000, 15000, '', 0,0,0,0, 0,0); /* padded gauntlets */
SET @temp = f_insertNewItemInventory(@backpack, 889, 50, 1, 15000, 15000, '', 0,0,0,0, 0,0); /* padded leggings */
SET @temp = f_insertNewItemInventory(@backpack, 890, 50, 1, 15000, 15000, '', 0,0,0,0, 0,0); /* padded boots */
Image


Revv
 
Posts: 76
Joined: 22 Sep 2014, 12:53

Re: [MOD] Additional inventory items on character creation

Post by Revv » 15 Feb 2015, 16:59

I'm obviously not a coder but END// looks like it should maybe be at the end of all the code?


Revv
 
Posts: 76
Joined: 22 Sep 2014, 12:53

Re: [MOD] Additional inventory items on character creation

Post by Revv » 16 Feb 2015, 02:40

Koiecks wrote:This is the code I placed in the query, it ran with no errors but still only gave me the practice sword and backpack.
After trying to remove the END// I can't get the query to work at all.

DELIMITER //
CREATE TRIGGER `character_after_insert` AFTER INSERT ON `character` FOR EACH ROW BEGIN
SET @backpack line to SET @backpack = NEW.RootContainerID;
SET @temp = f_insertNewItemInventory(@backpack, 555, 50, 1, 50000, 50000, '', 0,0,0,0, 0,0);
END//
SET @backpack line to SET @backpack = NEW.RootContainerID;
SET @temp = f_insertNewItemInventory(@backpack, 555, 100, 1, 50000, 50000, '', 0,0,0,0, 0,0); /* practice sword */
SET @temp = f_insertNewItemInventory(@backpack, 40, 100, 1, 50000, 50000, '', 0,0,0,0, 0,0); /* shovel */
SET @temp = f_insertNewItemInventory(@backpack, 48, 100, 1, 50000, 50000, '', 0,0,0,0, 0,0); /* pickaxe */
SET @temp = f_insertNewItemInventory(@backpack, 46, 100, 1, 50000, 50000, '', 0,0,0,0, 0,0); /* hatchet */
SET @temp = f_insertNewItemInventory(@backpack, 51, 100, 1, 50000, 50000, '', 0,0,0,0, 0,0); /* saw */
SET @temp = f_insertNewItemInventory(@backpack, 33, 100, 1, 50000, 50000, '', 0,0,0,0, 0,0); /* sickle */
SET @temp = f_insertNewItemInventory(@backpack, 974, 50, 25, 50000, 50000, '', 0,0,0,0, 0,0); /* 25x q50 Apple Buns */
SET @temp = f_insertNewItemInventory(@backpack, 885, 50, 1, 15000, 15000, '', 0,0,0,0, 0,0); /* padded helm */
SET @temp = f_insertNewItemInventory(@backpack, 886, 50, 1, 15000, 15000, '', 0,0,0,0, 0,0); /* padded chest */
SET @temp = f_insertNewItemInventory(@backpack, 887, 50, 1, 15000, 15000, '', 0,0,0,0, 0,0); /* padded arms */
SET @temp = f_insertNewItemInventory(@backpack, 888, 50, 1, 15000, 15000, '', 0,0,0,0, 0,0); /* padded gauntlets */
SET @temp = f_insertNewItemInventory(@backpack, 889, 50, 1, 15000, 15000, '', 0,0,0,0, 0,0); /* padded leggings */
SET @temp = f_insertNewItemInventory(@backpack, 890, 50, 1, 15000, 15000, '', 0,0,0,0, 0,0); /* padded boots */



Okay so I read through your code and if you have a look and compare it to the op yours is missing the ID number for backpack which is 458 so you aren't spawning a back pack but trying to spawn stuff in it.
Try this:
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); /* practice sword */
   SET @temp = f_insertNewItemInventory(@backpack, 40, 100, 1, 50000, 50000, '', 0,0,0,0, 0,0); /* shovel */
   SET @temp = f_insertNewItemInventory(@backpack, 48, 100, 1, 50000, 50000, '', 0,0,0,0, 0,0); /* pickaxe */
   SET @temp = f_insertNewItemInventory(@backpack, 46, 100, 1, 50000, 50000, '', 0,0,0,0, 0,0); /* hatchet */
   SET @temp = f_insertNewItemInventory(@backpack, 51, 100, 1, 50000, 50000, '', 0,0,0,0, 0,0); /* saw */
   SET @temp = f_insertNewItemInventory(@backpack, 33, 100, 1, 50000, 50000, '', 0,0,0,0, 0,0); /* sickle */
   SET @temp = f_insertNewItemInventory(@backpack, 974, 50, 25, 50000, 50000, '', 0,0,0,0, 0,0); /* 25x q50 Apple Buns */
   SET @temp = f_insertNewItemInventory(@backpack, 885, 50, 1, 15000, 15000, '', 0,0,0,0, 0,0); /* padded helm */
   SET @temp = f_insertNewItemInventory(@backpack, 886, 50, 1, 15000, 15000, '', 0,0,0,0, 0,0); /* padded chest */
   SET @temp = f_insertNewItemInventory(@backpack, 887, 50, 1, 15000, 15000, '', 0,0,0,0, 0,0); /* padded arms */
   SET @temp = f_insertNewItemInventory(@backpack, 888, 50, 1, 15000, 15000, '', 0,0,0,0, 0,0); /* padded gauntlets */
   SET @temp = f_insertNewItemInventory(@backpack, 889, 50, 1, 15000, 15000, '', 0,0,0,0, 0,0); /* padded leggings */
   SET @temp = f_insertNewItemInventory(@backpack, 890, 50, 1, 15000, 15000, '', 0,0,0,0, 0,0); /* padded boots */
END//


Revv
 
Posts: 76
Joined: 22 Sep 2014, 12:53

Re: [MOD] Additional inventory items on character creation

Post by Revv » 16 Feb 2015, 12:38

For those who know even less than me when it comes to scripting this is what worked for me and this is a little starter kit I put together:

Code: Select all
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, 1060, 100, 40, 50000, 50000, '', 0,0,0,0, 0,0); /* silver coins */
   SET @temp = f_insertNewItemInventory(@backpack, 48, 100, 1, 50000, 50000, '', 0,0,0,0, 0,0); /* pickaxe */
   SET @temp = f_insertNewItemInventory(@backpack, 46, 100, 1, 50000, 50000, '', 0,0,0,0, 0,0); /* hatchet */
   SET @temp = f_insertNewItemInventory(@backpack, 974, 50, 25, 50000, 50000, '', 0,0,0,0, 0,0); /* 25x q50 Apple Buns */
   SET @temp = f_insertNewItemInventory(@backpack, 299, 50, 1, 15000, 15000, '', 0,0,0,0, 0,0); /* simple clothes */
END;


I just added this to the bottom of patch.sql which is in the:
Life Is Feudal Your Own Dedicated Server/sql folder, it should add this everytime the server restarts so you dont have to run it manually.


Koiecks
 
Posts: 28
Joined: 07 Feb 2015, 07:15

Re: [MOD] Additional inventory items on character creation

Post by Koiecks » 19 Feb 2015, 00:02

Revv wrote:For those who know even less than me when it comes to scripting this is what worked for me and this is a little starter kit I put together:

Code: Select all
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, 1060, 100, 40, 50000, 50000, '', 0,0,0,0, 0,0); /* silver coins */
   SET @temp = f_insertNewItemInventory(@backpack, 48, 100, 1, 50000, 50000, '', 0,0,0,0, 0,0); /* pickaxe */
   SET @temp = f_insertNewItemInventory(@backpack, 46, 100, 1, 50000, 50000, '', 0,0,0,0, 0,0); /* hatchet */
   SET @temp = f_insertNewItemInventory(@backpack, 974, 50, 25, 50000, 50000, '', 0,0,0,0, 0,0); /* 25x q50 Apple Buns */
   SET @temp = f_insertNewItemInventory(@backpack, 299, 50, 1, 15000, 15000, '', 0,0,0,0, 0,0); /* simple clothes */
END;


I just added this to the bottom of patch.sql which is in the:
Life Is Feudal Your Own Dedicated Server/sql folder, it should add this everytime the server restarts so you dont have to run it manually.



You seem to know much more than most when it comes to the coding. Thanks for the assist!
Image


Koiecks
 
Posts: 28
Joined: 07 Feb 2015, 07:15

Re: [MOD] Additional inventory items on character creation

Post by Koiecks » 20 Feb 2015, 04:52

Still doesn't work

Koiecks wrote:
Revv wrote:For those who know even less than me when it comes to scripting this is what worked for me and this is a little starter kit I put together:

Code: Select all
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, 1060, 100, 40, 50000, 50000, '', 0,0,0,0, 0,0); /* silver coins */
   SET @temp = f_insertNewItemInventory(@backpack, 48, 100, 1, 50000, 50000, '', 0,0,0,0, 0,0); /* pickaxe */
   SET @temp = f_insertNewItemInventory(@backpack, 46, 100, 1, 50000, 50000, '', 0,0,0,0, 0,0); /* hatchet */
   SET @temp = f_insertNewItemInventory(@backpack, 974, 50, 25, 50000, 50000, '', 0,0,0,0, 0,0); /* 25x q50 Apple Buns */
   SET @temp = f_insertNewItemInventory(@backpack, 299, 50, 1, 15000, 15000, '', 0,0,0,0, 0,0); /* simple clothes */
END;


I just added this to the bottom of patch.sql which is in the:
Life Is Feudal Your Own Dedicated Server/sql folder, it should add this everytime the server restarts so you dont have to run it manually.



You seem to know much more than most when it comes to the coding. Thanks for the assist!
Image


Revv
 
Posts: 76
Joined: 22 Sep 2014, 12:53

Re: [MOD] Additional inventory items on character creation

Post by Revv » 20 Feb 2015, 14:23

Koiecks wrote:Still doesn't work

I really don't know much but I do know this works.
Where are you putting the code? Are you getting an error or just nothing happening? Did you create a new character to test it?


Koiecks
 
Posts: 28
Joined: 07 Feb 2015, 07:15

Re: [MOD] Additional inventory items on character creation

Post by Koiecks » 20 Feb 2015, 15:25

Revv wrote:
Koiecks wrote:Still doesn't work

I really don't know much but I do know this works.
Where are you putting the code? Are you getting an error or just nothing happening? Did you create a new character to test it?




I placed it at the end of the patch.sql

Created a new character after server restart

It should work, maybe my server is just being weird? :%)
Image


Revv
 
Posts: 76
Joined: 22 Sep 2014, 12:53

Re: [MOD] Additional inventory items on character creation

Post by Revv » 21 Feb 2015, 04:45

The only way to know for sure would be to drop box your patch.sql so I could see exactly what you have there.


Koiecks
 
Posts: 28
Joined: 07 Feb 2015, 07:15

Re: [MOD] Additional inventory items on character creation

Post by Koiecks » 23 Feb 2015, 14:06

So I figured out the hard way that when running your server thru Bluefang that you should not place a /DELIMITER (sp) command in the patch.sql

It will cause too many errors on start up that it crashes. Once removed and updated it ran again with no problems.
Image


Remystemple
 
Posts: 80
Joined: 15 Jan 2015, 22:30

Re: [MOD] Additional inventory items on character creation

Post by Remystemple » 24 Feb 2015, 22:23

anyone know how to make this work with the character limiter. i keep getting an error that say something like "can't do multiple triggers"

any info on this would be awesome.


Revv
 
Posts: 76
Joined: 22 Sep 2014, 12:53

Re: [MOD] Additional inventory items on character creation

Post by Revv » 04 Mar 2015, 04:27

Seems this isn't working since last update for me and I can't figure out why. Server just won't run with it anymore

Return to Game mods