Page 1 of 1

Starter Equipment?

PostPosted: Thu Jan 22, 2015 8:19 pm
by Crazys
I've been trying to get start equipment to work on the newest SVN
@Leodagan did some big changes with it on 3421

Can you give me an example to test? Nothing I put into the fields seems to be starting with an item.
The Server Rules says True for free items... Something else i'm missing?

Re: Starter Equipment?

PostPosted: Thu Jan 22, 2015 8:34 pm
by Crazys
Code: Select all
15:32:38,011 - [3] - ERROR - DOL.GS.GameEvents.CreationStartupEquipment - Error while adding Startup Equipment to Ddffeevvxx - Exception: System.NullReferenceException: Object reference not set to an instance of an object. at DOL.GS.GameEvents.CreationStartupEquipment.<OnCharacterCreation>b__2(ItemTemplate it) in d:\MorganaI50\trunk\debug\scripts\startup\script\CreationStartupEquipment.cs:line 132 at System.Linq.EnumerableSorter`2.ComputeKeys(TElement[] elements, Int32 count) at System.Linq.EnumerableSorter`1.Sort(TElement[] elements, Int32 count) at System.Linq.OrderedEnumerable`1.<GetEnumerator>d__0.MoveNext() at DOL.GS.GameEvents.CreationStartupEquipment.OnCharacterCreation(DOLEvent e, Object sender, EventArgs args) in d:\MorganaI50\trunk\debug\scripts\startup\script\CreationStartupEquipment.cs:line 132 15:33:08,966 - [9] - ERROR - DOL.GS.GameEvents.CreationStartupEquipment - Error while adding Startup Equipment to Ddfeffeffe - Exception: System.NullReferenceException: Object reference not set to an instance of an object. at DOL.GS.GameEvents.CreationStartupEquipment.<OnCharacterCreation>b__2(ItemTemplate it) in d:\MorganaI50\trunk\debug\scripts\startup\script\CreationStartupEquipment.cs:line 132 at System.Linq.EnumerableSorter`2.ComputeKeys(TElement[] elements, Int32 count) at System.Linq.EnumerableSorter`1.Sort(TElement[] elements, Int32 count) at System.Linq.OrderedEnumerable`1.<GetEnumerator>d__0.MoveNext() at DOL.GS.GameEvents.CreationStartupEquipment.OnCharacterCreation(DOLEvent e, Object sender, EventArgs args) in d:\MorganaI50\trunk\debug\scripts\startup\script\CreationStartupEquipment.cs:line 132
I was finally able to get an error out of it

Re: Starter Equipment?

PostPosted: Wed Jan 28, 2015 9:46 am
by Leodagan
Could you give some examples of the records you try to enter in database for starter equipment ?

Re: Starter Equipment?

PostPosted: Fri Jan 30, 2015 7:11 pm
by Crazys
Could you give some examples of the records you try to enter in database for starter equipment ?
I've tried adding a few different pieces of jewelry,
with a specific class number listed.
all listed
0 as the number

I have not tried a piece of armor yet.
The Items i've tried adding have been realm 0 and realm of the class I was testing also failed.
I get nothing or get that error regardless of how I put in the item.
Can you give me a working example?

Re: Starter Equipment?

PostPosted: Sat Jan 31, 2015 7:50 am
by Leodagan
Well it's really simple :
Code: Select all
INSERT INTO `starterequipment` (`Class`, `TemplateID`) VALUES ('35;31;22;24;21;32;34;', 'bronze_studded_vest');
Only "Class" and "TemplateID" Field have any meaning, Class is a serialized list of Class ID separated by semi-colon, TemplateID is a Reference to ItemTemplate.Id_nb (it must be an existing Item in your ItemTemplate table...)

If you want to check your records
SELECT StarterEquipmentID, Class, TemplateID, Id_nb, Name FROM `starterequipment` LEFT JOIN ItemTemplate on TemplateID = Id_nb


WHERE Name IS NULL
If the Id_nb or Name Column return any "NULL" then you've done something wrong ;)

Re: Starter Equipment?

PostPosted: Sat Jan 31, 2015 7:51 am
by Leodagan
But I would really like that you provide the database record you use to trigger the error you have, this way I could update the code to Provide "Warning Message" or "Hints" about what the user did wrong ;)

Re: Starter Equipment?

PostPosted: Sun Feb 01, 2015 8:51 am
by Leodagan
Anyway,

Commit in Revision 3458 :

* Fix : Add some Error Checks and Warning Message when building Starter Equipment Cache, preventing exception from breaking the whole collection.

You should have more Warning Message when Data is wrong now ;)

Re: Starter Equipment?

PostPosted: Sat Feb 21, 2015 7:53 pm
by Eudes
Hello :)

Leo, what about this record?
"StarterEquipmentID" "Class" "TemplateID" "LastTimeRowUpdated"
"1" "52;35;14" "vagabond" "2000-01-01 00:00:00"
"vagabond" is the TemplateID from the npcequipment table, "1" because it is my first record and "52;35;15" to target the Fighter/Guardian/Viking classes.

I also have activated the "enable_free_starter_equipment" in the serverproperty table.

When entering the game, my character is well identified as Viking or Fighter but there is nothing in its inventory. No starter equipment.

What am I doing wrong?

Thanks.

Re: Starter Equipment?

PostPosted: Sun Feb 22, 2015 8:07 am
by Leodagan
Could you provide the ItemTemplate record for "vagabond" ?

Do you use any other StarterEquipment Record ?

Are you using "Start as base class" property ?

Re: Starter Equipment?

PostPosted: Sun Feb 22, 2015 8:31 am
by Eudes
I'm using "enable_free_starter_equipment" to True in the serverproperty table and yes, "start_as_base_class" as True.

No, this is my first and only record in starterequipment.

Here is the npcequipment for Vagabond:
Code: Select all
"TemplateID" "Slot" "Model" "Color" "Effect" "Extension" "Emblem" "LastTimeRowUpdated" "NPCEquipment_ID" "vagabond" "25" "683" "0" "0" "0" "0" "2015-02-21 19:15:17" "7d9aa040-3f58-43c2-a294-e20e80f65550"

Re: Starter Equipment?

PostPosted: Sun Feb 22, 2015 9:38 am
by Leodagan
npcequipment ?

This table is for Mobs displayed armor/weapon, npcequipment won't link to any "real" items, it's just records that server use to send Model ID of mobs/npc's amor/weapon...

ItemTemplate table is the one containing real items that can be displayed inside player inventory :)

Re: Starter Equipment?

PostPosted: Sun Feb 22, 2015 11:32 am
by Eudes
I thought that it could be possible to use a npcequipment as the TemplateID required in the starterequipment is also in that table.

Ok, I'm going to modify that point and let you know if it works better :)

Re: Starter Equipment?

PostPosted: Sun Feb 22, 2015 6:19 pm
by Eudes
So, I have created an itemtemplate as follow (I just need the torso):
Code: Select all
"Id_nb" "TranslationId" "Name" "ExamineArticle" "MessageArticle" "Level" "Durability" "MaxDurability" "IsNotLosingDur" "Condition" "MaxCondition" "Quality" "DPS_AF" "SPD_ABS" "Hand" "Type_Damage" "Object_Type" "Item_Type" "Color" "Emblem" "Effect" "Weight" "Model" "Extension" "Bonus" "Bonus1" "Bonus2" "Bonus3" "Bonus4" "Bonus5" "Bonus6" "Bonus7" "Bonus8" "Bonus9" "Bonus10" "ExtraBonus" "Bonus1Type" "Bonus2Type" "Bonus3Type" "Bonus4Type" "Bonus5Type" "Bonus6Type" "Bonus7Type" "Bonus8Type" "Bonus9Type" "Bonus10Type" "ExtraBonusType" "CanUseEvery" "SpellID" "Charges" "MaxCharges" "SpellID1" "Charges1" "MaxCharges1" "ProcChance" "ProcSpellID" "ProcSpellID1" "PoisonSpellID" "PoisonCharges" "PoisonMaxCharges" "IsPickable" "IsDropable" "CanDropAsLoot" "IsTradable" "Price" "MaxCount" "IsIndestructible" "PackSize" "Realm" "AllowedClasses" "Flags" "BonusLevel" "LevelRequirement" "PackageID" "Description" "ClassType" "SalvageYieldID" "LastTimeRowUpdated" "ItemTemplate_ID" "habit_vagabond" "" "Haillons" "" "" "45" "80" "100" "0" "75" "100" "75" "45" "5" "0" "0" "32" "25" "0" "0" "0" "100" "683" "0" "5" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "0" "1" "0" "0" "0" "0" "1" "0" "1" "0" "0" "0" "0" "0" "" "" "" "0" "2015-02-22 17:55:48" "3d857a95-17d7-4888-a66e-66fb3720075f"
I try to use "Id_nb" (habit_vagabond) or "ItemTemplate_ID" (3d857a95-17d7-4888-a66e-66fb3720075f) to fill in the "TemplateID" field in starterequipment. Nothing works at the moment. I do not have any item in the inventory or worn by the character.

Sorry to not be able to find how to proceed, I do the best I can...

Re: Starter Equipment?

PostPosted: Mon Feb 23, 2015 6:25 am
by Leodagan
No problem, I wasn't making fun of you ;)

I just need these records to test them myself on a development shard...

For items the "key" is always "id_nb"

I'll update you when I run some test, did you try creating this item in your "Admin" Inventory using command :

/item create habit_vagabond

It's a good start to be sure the item is valid (I remember Starter Equipment is doing a lot of checks that target character can equip the starter items...)

Re: Starter Equipment?

PostPosted: Mon Feb 23, 2015 6:49 pm
by Eudes
Yes, I did try with a fighter and the item is ok, I can even equip it.

I know you're not making fun of me :) I'm just disappointed not to be able to use something looking so simple...

Anyway thanks for taking the time to help me/us :)