Hi.
I want to change weapons and other equipments for hero.
Can I somehow influence to this (from code):
Hi.
I want to change weapons and other equipments for hero.
Can I somehow influence to this (from code):
Yes.
You will use the skin functionality in Spine and then change skin with code.
go.set( "#spine_component", "skin", "name_of_skin" )
I know about the skins.
But what if I have (for example) “first sword”, “second sword” and so on, “first shield”, “second shield” …
Сan I combine them?
(first sword, third shield, without helmet, …)
(without sword, first shield, second helmet, …)
…
As in conventional RPG.
I watched tutorials and people use skins for other targets.
I may be mistaken
As Spine doesn’t support multiple layers of skins Defold doesnt do that either.
I would solve it in a slightly different way. You do have access to all the bones by name in Defold using spine.get_go(url, bone_id)
Eg. You could create a weapon gameobject with a sprite that you can change animation on depending on weapon. and hook that weapon gameobject on the hand spine bone.
Do this for all art on character that is changeable.
Restrictions for this would be that weapon cannot be drawn within the spineobject itself. Only above or below the spineobject. Eg. A chestplate would be hard to do this way as you want it to be drawn above naken chest but below front arm if character is a shown from side.
I understood. Thanks!