PlaneShift

Development => Development Deliberation => Topic started by: Donari Tyndale on January 18, 2007, 05:26:10 pm

Title: Creating a new object and importing it into PS
Post by: Donari Tyndale on January 18, 2007, 05:26:10 pm
I have created a new item, a banana (category weapons), but now I am wondering how to import it into one\'s local server without overwriting existing objects?
Title: Re: Creating a new object and importing it into PS
Post by: Ralleyon on January 18, 2007, 05:48:50 pm
If you mean you created the mesh for it and then added it in the food.zip folder, all you have to do is:

- edit common_strings table and put the name of the mesh in there
- edit item_stats table and add everything about the item in there

You should be good to go to summon it up after that in your inventory with the /item command

Title: Re: Creating a new object and importing it into PS
Post by: Holdan on January 18, 2007, 05:51:49 pm
A banana... a weapon...

whats someone gonna do slip on it's peal, fall down and break their leg?
Title: Re: Creating a new object and importing it into PS
Post by: Ralleyon on January 18, 2007, 05:57:51 pm
/me laughs heartily

That reminds me of someone who said that one fought armed with a carrot.

All you have to do then is put it in the weapons.zip folder and tweak item_stats a little and make the most vicious banana in the world!!!!!
Title: Re: Creating a new object and importing it into PS
Post by: ThomPhoenix on January 18, 2007, 06:19:56 pm
Yup, something like:
"INSERT INTO common_strings VALUES("222","/planeshift/food/banana.dds");
Put the Banana in /planeshift/art/things/food in that case.
And into item_stats:
INSERT INTO `item_stats` VALUES (4817,'B','Banana',7,5,100,0,'BULK LEFTHAND RIGHTHAND','MELEEWEAPON',0.1,0,-1,-1,'0','0','0',0,0,0,4,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0.2,0.2,0.2,0,0,0,0,0,0,0,0,0,0,0,0,222,162,0,0,0,'Sabre',1,150,'SWORD','',0,'',0,'0',0,0,0,0,0,0,0,1,'0','nosound',50,'','',NULL);

Should give you a somewhat workable item, I think. I didn't test it :P
Title: Re: Creating a new object and importing it into PS
Post by: Donari Tyndale on January 18, 2007, 06:37:55 pm
INSERT INTO common_strings VALUES("222","/planeshift/food/banana.dds");
Shouldn't it be Banana.spr?
And no, it does not work. Where do I find a list for all these parameters?
Title: Re: Creating a new object and importing it into PS
Post by: Ralleyon on January 18, 2007, 07:04:38 pm
There is no such list, it's a try and guess thing. As for the lines... just go by example:

INSERT INTO common_strings VALUES("2000","items#banana");                --> this is the name of the .spr file
INSERT INTO common_strings VALUES("2001","/planeshift/food/banana_icon.dds");


And do not forget to match the cstr_id_gfx mesh (-> 2000) and cstr_id_gfx_icon (->2001) with the number in the common_strings table.

Code: [Select]
INSERT INTO `item_stats` VALUES (4817,'B','Banana',7,5,100,0,'BULK LEFTHAND RIGHTHAND','MELEEWEAPON',0.1,0,-1,-1,'0','0','0',0,0,0,4,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0.2,0.2,0.2,0,0,0,0,0,0,0,0,0,0,0,0,2000,2001,0,0,0,'Sabre',1,150,'SWORD','',0,'',0,'0',0,0,0,0,0,0,0,1,'0','nosound',50,'','',NULL);


If you don't have an icon for it (it shows in the inventory), you can use another just as well. Instead of 2001 in the line above use 37 for example.
Title: Re: Creating a new object and importing it into PS
Post by: Donari Tyndale on January 18, 2007, 09:18:51 pm
I just copy and pasted ... made sure the .spr file was correctly placed and linked claymore_icon as icon.

Still not working though... :(

Edit:
Found the answer  :D
You need to set the database again, just repeat the following steps from the compiling guide:
Quote

cd c:\development\planeshift\src\server\database\mysql\
mysql -u planeshift -pplaneshift

mysql> use planeshift;
mysql> source create_all.sql;
mysql> quit

But he doesn't take my icon  :'(
Quote
INSERT INTO common_strings VALUES("2001","/planeshift/food/banana_icon.dds");
I made sure the link in Item_stats was set and the file was in the food folder (64*64 pixels). Any ideas what to do about it?
Title: Re: Creating a new object and importing it into PS
Post by: Donari Tyndale on January 20, 2007, 04:31:53 pm
No one got any idea?
Title: Re: Creating a new object and importing it into PS
Post by: Induane on January 25, 2007, 04:54:11 pm
Try installing phpmyadmin.  It will let you administer teh planeshift database in a visual fashion.  It might help you see exactly what fields you need and also compare it to other weapons so you know good values to use. 
Here is a shot of the web interface.  Its really quite nice:

http://vaalnor.mine.nu/Screenshot.png (http://vaalnor.mine.nu/Screenshot.png)
Title: Re: Creating a new object and importing it into PS
Post by: novacadian on January 31, 2011, 05:02:49 pm
INSERT INTO common_strings VALUES("2001","/planeshift/food/banana_icon.dds");

Is common_strings table no longer in use? It is not included in the *.sql files provided with the server release.

- Nova
Title: Re: Creating a new object and importing it into PS
Post by: weltall on January 31, 2011, 09:10:38 pm
it's generated automatically
Title: Re: Creating a new object and importing it into PS
Post by: novacadian on February 01, 2011, 02:33:48 am
it's generated automatically

Thanks, as always, weltall. With that in mind mention of it was tracked down in upgrade_schema.sql, planeshift_db.xml and drop.sql.  ;)

- Nova

Title: Re: Creating a new object and importing it into PS
Post by: Earowo on February 01, 2011, 03:46:13 am
A banana... a weapon...

whats someone gonna do slip on it's peal, fall down and break their leg?
Naa, but I do remember a long while back, I drunkily 'Mugged' and ulbernuat if you know what i mean