Accessing Item properties #169
-
|
Context: An RPG game with crafting mechanics that generate random bonus effects on items. Having taken a liking to this addon for it's crafting system mostly, I've been prototyping a simple RPG with a crafting mechanic that adds small bonus effects to crafted items, things like "+10% fire dmg". So here's my question: Is there a way to access the Item's instance so already present properties/stats can be edited at run time? I believe being able to do that would lead to being able to add these post-crafting effects. |
Beta Was this translation helpful? Give feedback.
Answered by
scriptsengineer
Jan 7, 2025
Replies: 1 comment
-
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
a-magno
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Yes, there is a way, but this is currently limited to each stack. Check the example for the durability of an axe or pickaxe. In this case, there is sample code (res://addons/inventory-system-demos/fps/use_items_example.gd) that changes a dynamic property of the item when used. In the editor, there is a checkbox to define that this property is dynamic and linked to the item as soon as it is crafted.