Need help On_Crafting()

gintaras

Plugin Developer
Plugin Developer
Jan 10, 2017
68
138
8
How to change ingridients i dont undestand i tryed to get data from on crafting with this:

Code:
    def On_Crafting(self, CraftingEvent):
        if CraftingEvent.Player.Admin:
            ini2 = Plugin.GetIni("TestBase")
            ini2.AddSetting("Testas", "Amount",str(CraftingEvent.Amount))
            ini2.AddSetting("Testas", "ItemName",str(CraftingEvent.ItemName))
            ini2.AddSetting("Testas", "LastWorkBenchTime",str(CraftingEvent.LastWorkBenchTime))
            ini2.AddSetting("Testas", "RequireWorkbench",str(CraftingEvent.RequireWorkbench))
            i=0
            for key in CraftingEvent.Ingredients:
                ini2.AddSetting("Testas", str(i),str(key))
                i+=1
            ini2.AddSetting("Testas", "Ingredients",str(CraftingEvent.Ingredients))
            ini2.AddSetting("Testas", "ResultItem",str(CraftingEvent.ResultItem))
            ini2.AddSetting("Testas", "ResultItemNumber",str(CraftingEvent.ResultItemNumber))
            ini2.AddSetting("Testas", "StartTime",str(CraftingEvent.StartTime))
            ini2.Save()
i Got this:

Code:
Amount=1
ItemName=Camp Fire Blueprint
LastWorkBenchTime=0.0
RequireWorkbench=False
0=<BlueprintDataBlock+IngredientEntry object at 0x000000000000002B [BlueprintDataBlock+IngredientEntry]>
Ingredients=Array[IngredientEntry]((<BlueprintDataBlock+IngredientEntry object at 0x000000000000002B [BlueprintDataBlock+IngredientEntry]>))
ResultItem=Camp Fire (DeployableInventoryDataBlock)
ResultItemNumber=1
StartTime=964278
0x000000000000002B
what this mean?
Please help me to change ingridients on example "Camp Fire Blueprint"
 

Brain

Member
Member
Dec 29, 2016
71
7
8
50
Parts Unknown
How to change ingridients i dont undestand i tryed to get data from on crafting with this:

Code:
    def On_Crafting(self, CraftingEvent):
        if CraftingEvent.Player.Admin:
            ini2 = Plugin.GetIni("TestBase")
            ini2.AddSetting("Testas", "Amount",str(CraftingEvent.Amount))
            ini2.AddSetting("Testas", "ItemName",str(CraftingEvent.ItemName))
            ini2.AddSetting("Testas", "LastWorkBenchTime",str(CraftingEvent.LastWorkBenchTime))
            ini2.AddSetting("Testas", "RequireWorkbench",str(CraftingEvent.RequireWorkbench))
            i=0
            for key in CraftingEvent.Ingredients:
                ini2.AddSetting("Testas", str(i),str(key))
                i+=1
            ini2.AddSetting("Testas", "Ingredients",str(CraftingEvent.Ingredients))
            ini2.AddSetting("Testas", "ResultItem",str(CraftingEvent.ResultItem))
            ini2.AddSetting("Testas", "ResultItemNumber",str(CraftingEvent.ResultItemNumber))
            ini2.AddSetting("Testas", "StartTime",str(CraftingEvent.StartTime))
            ini2.Save()
i Got this:

Code:
Amount=1
ItemName=Camp Fire Blueprint
LastWorkBenchTime=0.0
RequireWorkbench=False
0=<BlueprintDataBlock+IngredientEntry object at 0x000000000000002B [BlueprintDataBlock+IngredientEntry]>
Ingredients=Array[IngredientEntry]((<BlueprintDataBlock+IngredientEntry object at 0x000000000000002B [BlueprintDataBlock+IngredientEntry]>))
ResultItem=Camp Fire (DeployableInventoryDataBlock)
ResultItemNumber=1
StartTime=964278
0x000000000000002B
what this mean?
Please help me to change ingridients on example "Camp Fire Blueprint"
Well I hope you don't change - and here to get easy CraftingEvent.Ingredients[int].Name
 

gintaras

Plugin Developer
Plugin Developer
Jan 10, 2017
68
138
8
Code:
            i=0
            for key in dir(CraftingEvent.Ingredients[0].Ingredient):
                ini2.AddSetting("Testas", str(i),str(key))
                i+=1
Code:
0=Combinations
1=CombineRecipe
2=CompareTo
3=ConstructItem
4=CreateInstance
5=CreateItem
6=Destroy
7=DestroyImmediate
8=DestroyObject
9=DoesLoseCondition
10=DontDestroyOnLoad
11=Equals
12=ExecuteMenuOption
13=Finalize
14=FindObjectOfType
15=FindObjectsOfType
16=FindObjectsOfTypeAll
17=FindObjectsOfTypeIncludingAssets
18=FindSceneObjectsOfType
19=GetHashCode
20=GetIconTexture
21=GetInstanceID
22=GetItemDescription
23=GetMatchingRecipe
24=GetMaxEligableSlots
25=GetMinUsesForDisplay
26=GetRandomSpawnUses
27=GetType
28=Ident
29=InstallData
30=Instantiate
31=IsSplittable
32=ItemCategory
33=LoadIconOrUnknown
34=LoadIconOrUnknownForced
35=LoadItem
36=LoadItemInterface
37=MemberwiseClone
38=OnItemEvent
39=PopulateInfoWindow
40=PostInstallJsonProperties
41=PreInstallJsonProperties
42=ReferenceEquals
43=RetreiveMenuOptions
44=SaveItem
45=SaveItemInterface
46=SecureHash
47=SecureWriteMemberValues
48=SetDirty
49=ToString
50=TransientMode
51=UseItem
52=UsedSound
53=__class__
54=__delattr__
55=__doc__
56=__eq__
57=__format__
58=__getattribute__
59=__hash__
60=__init__
61=__ne__
62=__new__
63=__reduce__
64=__reduce_ex__
65=__repr__
66=__setattr__
67=__sizeof__
68=__str__
69=__subclasshook__
70=_itemFlags
71=_maxCondition
72=_maxUses
73=_minUsesForDisplay
74=_spawnUsesMax
75=_spawnUsesMin
76=_splittable
77=category
78=combinedSound
79=cookHeatRequirement
80=cookable
81=cookedVersion
82=doesLoseCondition
83=doesNotSave
84=equippedSound
85=flammable
86=hideFlags
87=icon
88=iconTex
89=isRecycleable
90=isRepairable
91=isResearchable
92=itemDescriptionOverride
93=kUnknownIconPath
94=name
95=numToGiveCookedMax
96=numToGiveCookedMin
97=saves
98=transferable
99=transientMode
100=unEquippedSound
101=uniqueID
102=untransferable
This is hard core....
 

Brain

Member
Member
Dec 29, 2016
71
7
8
50
Parts Unknown
Code:
            i=0
            for key in dir(CraftingEvent.Ingredients[0].Ingredient):
                ini2.AddSetting("Testas", str(i),str(key))
                i+=1
Code:
0=Combinations
1=CombineRecipe
2=CompareTo
3=ConstructItem
4=CreateInstance
5=CreateItem
6=Destroy
7=DestroyImmediate
8=DestroyObject
9=DoesLoseCondition
10=DontDestroyOnLoad
11=Equals
12=ExecuteMenuOption
13=Finalize
14=FindObjectOfType
15=FindObjectsOfType
16=FindObjectsOfTypeAll
17=FindObjectsOfTypeIncludingAssets
18=FindSceneObjectsOfType
19=GetHashCode
20=GetIconTexture
21=GetInstanceID
22=GetItemDescription
23=GetMatchingRecipe
24=GetMaxEligableSlots
25=GetMinUsesForDisplay
26=GetRandomSpawnUses
27=GetType
28=Ident
29=InstallData
30=Instantiate
31=IsSplittable
32=ItemCategory
33=LoadIconOrUnknown
34=LoadIconOrUnknownForced
35=LoadItem
36=LoadItemInterface
37=MemberwiseClone
38=OnItemEvent
39=PopulateInfoWindow
40=PostInstallJsonProperties
41=PreInstallJsonProperties
42=ReferenceEquals
43=RetreiveMenuOptions
44=SaveItem
45=SaveItemInterface
46=SecureHash
47=SecureWriteMemberValues
48=SetDirty
49=ToString
50=TransientMode
51=UseItem
52=UsedSound
53=__class__
54=__delattr__
55=__doc__
56=__eq__
57=__format__
58=__getattribute__
59=__hash__
60=__init__
61=__ne__
62=__new__
63=__reduce__
64=__reduce_ex__
65=__repr__
66=__setattr__
67=__sizeof__
68=__str__
69=__subclasshook__
70=_itemFlags
71=_maxCondition
72=_maxUses
73=_minUsesForDisplay
74=_spawnUsesMax
75=_spawnUsesMin
76=_splittable
77=category
78=combinedSound
79=cookHeatRequirement
80=cookable
81=cookedVersion
82=doesLoseCondition
83=doesNotSave
84=equippedSound
85=flammable
86=hideFlags
87=icon
88=iconTex
89=isRecycleable
90=isRepairable
91=isResearchable
92=itemDescriptionOverride
93=kUnknownIconPath
94=name
95=numToGiveCookedMax
96=numToGiveCookedMin
97=saves
98=transferable
99=transientMode
100=unEquippedSound
101=uniqueID
102=untransferable
This is hard core....
now start visual studio and say - but the сraft you do not change!!!!
 

Brain

Member
Member
Dec 29, 2016
71
7
8
50
Parts Unknown
Code:
            i=0
            for key in dir(CraftingEvent.Ingredients[0].Ingredient):
                ini2.AddSetting("Testas", str(i),str(key))
                i+=1
Code:
0=Combinations
1=CombineRecipe
2=CompareTo
3=ConstructItem
4=CreateInstance
5=CreateItem
6=Destroy
7=DestroyImmediate
8=DestroyObject
9=DoesLoseCondition
10=DontDestroyOnLoad
11=Equals
12=ExecuteMenuOption
13=Finalize
14=FindObjectOfType
15=FindObjectsOfType
16=FindObjectsOfTypeAll
17=FindObjectsOfTypeIncludingAssets
18=FindSceneObjectsOfType
19=GetHashCode
20=GetIconTexture
21=GetInstanceID
22=GetItemDescription
23=GetMatchingRecipe
24=GetMaxEligableSlots
25=GetMinUsesForDisplay
26=GetRandomSpawnUses
27=GetType
28=Ident
29=InstallData
30=Instantiate
31=IsSplittable
32=ItemCategory
33=LoadIconOrUnknown
34=LoadIconOrUnknownForced
35=LoadItem
36=LoadItemInterface
37=MemberwiseClone
38=OnItemEvent
39=PopulateInfoWindow
40=PostInstallJsonProperties
41=PreInstallJsonProperties
42=ReferenceEquals
43=RetreiveMenuOptions
44=SaveItem
45=SaveItemInterface
46=SecureHash
47=SecureWriteMemberValues
48=SetDirty
49=ToString
50=TransientMode
51=UseItem
52=UsedSound
53=__class__
54=__delattr__
55=__doc__
56=__eq__
57=__format__
58=__getattribute__
59=__hash__
60=__init__
61=__ne__
62=__new__
63=__reduce__
64=__reduce_ex__
65=__repr__
66=__setattr__
67=__sizeof__
68=__str__
69=__subclasshook__
70=_itemFlags
71=_maxCondition
72=_maxUses
73=_minUsesForDisplay
74=_spawnUsesMax
75=_spawnUsesMin
76=_splittable
77=category
78=combinedSound
79=cookHeatRequirement
80=cookable
81=cookedVersion
82=doesLoseCondition
83=doesNotSave
84=equippedSound
85=flammable
86=hideFlags
87=icon
88=iconTex
89=isRecycleable
90=isRepairable
91=isResearchable
92=itemDescriptionOverride
93=kUnknownIconPath
94=name
95=numToGiveCookedMax
96=numToGiveCookedMin
97=saves
98=transferable
99=transientMode
100=unEquippedSound
101=uniqueID
102=untransferable
This is hard core....
C#:
public static void RpgCraft(CraftingEvent e)
        {
            int ItemCount = e.Ingredients.Count();
            for (int i = 0; i <= ItemCount; i++)
            {
                e.Player.MessageFrom("ItemIngredients", "Item " + e.Ingredients[i].Ingredient.name + " amount " + e.Ingredients[i].amount);
            }
        }
 

gintaras

Plugin Developer
Plugin Developer
Jan 10, 2017
68
138
8
Code:
      if CraftingEvent.ItemName=="Wood Planks Blueprint":
         if CraftingEvent.Ingredients[0].Ingredient.name=="Wood":
           CraftingEvent.Ingredients[0].amount=20
works
any idea is it possible to show in crafting how much it costs?
 
Last edited:

Brain

Member
Member
Dec 29, 2016
71
7
8
50
Parts Unknown
Code:
      if CraftingEvent.ItemName=="Wood Planks Blueprint":
         if CraftingEvent.Ingredients[0].Ingredient.name=="Wood":
           CraftingEvent.Ingredients[0].amount=20
works
any idea is it possible to show in crafting how much it costs?
If you make changes , they will not be visible from the players - at least what you will get is hate the players and the issues why I have never crafted
 

gintaras

Plugin Developer
Plugin Developer
Jan 10, 2017
68
138
8
The description does not change - like items for crafting - need to touch the client part
PearlJ Version: 1.0 BETA I tried this plugin, really good. I modified MaxUses, MaxClipAmmo and weapons recoil without problems.
But you can't reload your weapon if has more ammo of standard value.
Example: if you set MaxClipAmmo of P250 to 13, you can't reload if you have more than 8 ammo (standard value) in gun.
maybe it possible are you sure 100%?
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,093
4,784
113
At your house.
github.com
Code:
            i=0
            for key in dir(CraftingEvent.Ingredients[0].Ingredient):
                ini2.AddSetting("Testas", str(i),str(key))
                i+=1
Code:
0=Combinations
1=CombineRecipe
2=CompareTo
3=ConstructItem
4=CreateInstance
5=CreateItem
6=Destroy
7=DestroyImmediate
8=DestroyObject
9=DoesLoseCondition
10=DontDestroyOnLoad
11=Equals
12=ExecuteMenuOption
13=Finalize
14=FindObjectOfType
15=FindObjectsOfType
16=FindObjectsOfTypeAll
17=FindObjectsOfTypeIncludingAssets
18=FindSceneObjectsOfType
19=GetHashCode
20=GetIconTexture
21=GetInstanceID
22=GetItemDescription
23=GetMatchingRecipe
24=GetMaxEligableSlots
25=GetMinUsesForDisplay
26=GetRandomSpawnUses
27=GetType
28=Ident
29=InstallData
30=Instantiate
31=IsSplittable
32=ItemCategory
33=LoadIconOrUnknown
34=LoadIconOrUnknownForced
35=LoadItem
36=LoadItemInterface
37=MemberwiseClone
38=OnItemEvent
39=PopulateInfoWindow
40=PostInstallJsonProperties
41=PreInstallJsonProperties
42=ReferenceEquals
43=RetreiveMenuOptions
44=SaveItem
45=SaveItemInterface
46=SecureHash
47=SecureWriteMemberValues
48=SetDirty
49=ToString
50=TransientMode
51=UseItem
52=UsedSound
53=__class__
54=__delattr__
55=__doc__
56=__eq__
57=__format__
58=__getattribute__
59=__hash__
60=__init__
61=__ne__
62=__new__
63=__reduce__
64=__reduce_ex__
65=__repr__
66=__setattr__
67=__sizeof__
68=__str__
69=__subclasshook__
70=_itemFlags
71=_maxCondition
72=_maxUses
73=_minUsesForDisplay
74=_spawnUsesMax
75=_spawnUsesMin
76=_splittable
77=category
78=combinedSound
79=cookHeatRequirement
80=cookable
81=cookedVersion
82=doesLoseCondition
83=doesNotSave
84=equippedSound
85=flammable
86=hideFlags
87=icon
88=iconTex
89=isRecycleable
90=isRepairable
91=isResearchable
92=itemDescriptionOverride
93=kUnknownIconPath
94=name
95=numToGiveCookedMax
96=numToGiveCookedMin
97=saves
98=transferable
99=transientMode
100=unEquippedSound
101=uniqueID
102=untransferable
This is hard core....
key.name is what you are looking for.

It's useless to provide C# solutions for a py platform.
 

gintaras

Plugin Developer
Plugin Developer
Jan 10, 2017
68
138
8
key.name is what you are looking for.

It's useless to provide C# solutions for a py platform.
i found how to change how much it needs
But there is bigger problem how to show new crafting req in crafting i changed wood plank to 20 but users see 10 ofcouse they cant craft with 10
I need solution to show how much it needs in crafting table
 

Brain

Member
Member
Dec 29, 2016
71
7
8
50
Parts Unknown
i found how to change how much it needs
But there is bigger problem how to show new crafting req in crafting i changed wood plank to 20 but users see 10 ofcouse they cant craft with 10
I need solution to show how much it needs in crafting table
This must be done with the help of the customer! I have long made....
 

DreTaX

Probably knows the answer...
Administrator
Jun 29, 2014
4,093
4,784
113
At your house.
github.com
i found how to change how much it needs
But there is bigger problem how to show new crafting req in crafting i changed wood plank to 20 but users see 10 ofcouse they cant craft with 10
I need solution to show how much it needs in crafting table
Might be allowed when I will setup the client side scripting.