SphereCommunity
Standard leather armor consumes custom hides - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: Standard leather armor consumes custom hides (/Thread-Standard-leather-armor-consumes-custom-hides)



Standard leather armor consumes custom hides - Artyk - 09-12-2014 09:22 AM

Hi everyone,
first of all a presentation, since is a couple of months that I started working on sphere again after ~10 years and it's my first post since the old forum Shock
I'm really happy to be part of the community again, hoping that i will be usefull for someone (when i'll get used again xD).

Going to the matter:

I've created new hides carved from some npc to make alternative leather armor

Code:
[ITEMDEF i_hide_rat]
ID=i_hide
TYPE=t_hide
NAME=Rat Hide

CATEGORY=Items by Professions
SUBSECTION=Tailoring
DESCRIPTION=Rat Hide

ON=@CREATE
COLOR=color_rat_hide

Code:
[ITEMDEF i_studded_sleeves_rat]
DEFNAME=i_studded_sleeves_rat
NAME=Rat Studded Sleeves
ID=i_studded_sleeves
TYPE=t_armor_leather
ARMOR=60
REQSTR=10
RESOURCES=12 i_hide_rat
SKILLMAKE=tailoring 50.0, t_sewing_kit

CATEGORY=Provisions - Armor - Leather
SUBSECTION=Rat
DESCRIPTION=Rat Studded Sleeves

ON=@Create
    HITPOINTS={35 80}
    COLOR=color_ratto

It works fine, the matter came out when i tested the skillmenu
I saw that using the sawing kit on the hides, on the menu i can see standard leather armor menu, studded, ecc.. trying to make one of them, it consumes the custom hide and creates the item
I link the tested item with the relative skillmenu

Code:
[ITEMDEF 013c7]
DEFNAME=i_leather_gorget
TYPE=t_armor_leather
FLIP=1
//ARMOR=13
VALUE=32
WEIGHT=1.0
RESOURCES=4 i_hide
SKILLMAKE=Tailoring 53.9,t_sewing_kit,Armslore 10.0
CATEGORY=Provisions - Armor
SUBSECTION=Leather Armor
DESCRIPTION=Leather Gorget
TAG.NotGargoyle=1
TAG.REQSTR=20
TEVENTS=t_equipitem
ON=@Create
   HITPOINTS={36 48}
   TAG.RESCOLD=3
   TAG.RESENERGY=3
   TAG.RESFIRE=4
   TAG.RESPhysical=2
   TAG.RESPOISON=3

Code:
[SKILLMENU sm_leather_armor]
Leather Armour

ON=i_LEATHER_GORGET <name> (<resmake>)
MAKEITEM=i_LEATHER_GORGET
.
.
.

What am i missing?

Thanks in advance


RE: Standard leather armor consumes custom hides - Extreme - 09-12-2014 11:48 AM

Did you target the custom hides or the normal hides?
Yeah, it's a bug which don't happens with blacksmith.


RE: Standard leather armor consumes custom hides - Extreme - 09-12-2014 02:40 PM

Did you cut the custom hide? Transforming it to leather?
I tested here and its ok.
Custom gumps open when targeting custom hide and standard gump opens when targeting normal leather (not hide).
For this, you have to cut the normal hide to get the normal leather gump...

I made this fix to prevent cutting custom hide.
This will prevent you cut the custom hides.
PHP Code:
[TYPEDEF T_SCISSORS]
ON=@TARGON_ITEM
IF (<ARGO.TYPE> == T_HIDE) && (!STRMATCH(I_HIDE,<ARGO.BASEID>))
 RETURN 
1
ENDIF 



RE: Standard leather armor consumes custom hides - Artyk - 09-12-2014 09:55 PM

Results of the tests :
Sewing kit on normal hides => fires gump, but i can't see custom armor on menu, making the item consumes the normal hides if enough then custom ones
Sewing kit on normal cut leather => same as 1st
Sewing kit on custom hides => i can see custom and normal armor on menu and both consumes custom hides
Scissors on custom hides => creates i_hides_cut with the custom hide color

If there isn't a way to fix it, i think i will make a script for t_sewing_kit to stop harcoded behavior and open a gump based on the item targetted


RE: Standard leather armor consumes custom hides - Extreme - 09-13-2014 01:00 AM

No, you are wrong.

Sewing kit on custom hides => opens only custom armor gump
Scissors on custom hides => opens normal gump because the leather now is the normal, only colored!!! you can check using .xshow baseid on the cut leather and you will see that you lose your custom hides!

Did you tried my fix for the scissors?


RE: Standard leather armor consumes custom hides - Ben - 09-13-2014 03:10 AM

You can set TDATA1 of the custom hide to specify a custom leather to turn into if cut.
You should also try to set EF_Item_Strict_Comparison in sphere.ini since when it comes to resources, if this is not set, any items of type t_leather or type t_hide can be interchangeable when it comes to crafting.


RE: Standard leather armor consumes custom hides - Artyk - 09-15-2014 06:52 AM

Sorry if i'm replying only now, thanks both guys, that flags is what i was looking for and Extreme's fix saves me from create cut leather for each custom hide Tongue