New to Spine--> Attachments

T

TaylorBramble

Guest
Hi all,
I don't usually want to waste people's time with my questions as I figure that's part of the learning process, but I had to join up here because I'm stuck. So hello all, first post!
I recently got Spine and have gotten animations and everything working great in game maker (I figured I would start step by step with basic import to a running animation to equipping a weapon, etc).
I have come across a problem that my searching through the forums doesn't seem to solve:
---------
I want to have my character switch between two weapons when you press a button, right now labeled BlueSword and YellowSword.
I use the 'if (skeleton_attachment_get(RightWeapon) != BlueSword) then set to blue sword, and when running the game, I see my character equip the sword.
However every time an animation ends, it reverts to the old attachment, which is just RightHand or nothing visible, I've tried both ways with similar results.
Does anyone know what I'm doing wrong? Is it not possible to update an animation in game like I'm doing, and game maker thinks I only want the attachment displayed til the animation loops?
Any help would be great, I've been plowing through spine tutorials like crazy and maybe my brains just burnt out lol.
 

rIKmAN

Member
When you open GM:S, go to the "Demos" tab and then "Completed Tutorials" and load "Skeletal_Animation_With_Spine"

This seems to do exactly what you are trying to do, so might help you figure out what you are doing wrong.

I installed the zip package of all demos & tutorials from here - just in case you don't have that particular demo.
 
T

TaylorBramble

Guest
Wow I had no idea these existed. Been working off of youtube tutorials forever now. Thank you so much. Time to get cracking :rolleyes:
 
In your particular case, I think the problem happens in your animation itself: I believe you (in the animation) is setting the attachment in the first frame, ie. it will reset it every time it arrives at that frame :)
Solutions: Either make sure your animations doesn't set the attachments you want to control manually OR set the attachments in the animation update event, so that they are set every time the animation updates ;)
 

rIKmAN

Member
Wow I had no idea these existed. Been working off of youtube tutorials forever now. Thank you so much. Time to get cracking :rolleyes:
No worries man, glad to help! :)
I had no demos or tutorials at all and couldn't seem to get the RSS feed working so ended up doing some Google-fu and finding those.

In your particular case, I think the problem happens in your animation itself: I believe you (in the animation) is setting the attachment in the first frame, ie. it will reset it every time it arrives at that frame :)
Yeah I think you are probably right - seems you are the regular GM+Spine expert around here so I'm sure I'll be seeing you around as I intend to use Spine Pro when I get my head around how GM works. Hopefully the Spine Runtime update mentioned by staff in the other thread will include the more advanced features, and at the very least events!
 
T

TaylorBramble

Guest
Hay Bales! :D I used your spine youtube tutorials to learn :p
Amazing, just like he said, sitting down there in the dope sheet was a little "attach right weapon" key. Took it out and it works perfectly. So much trouble for something so small.
And now I have tutorials for learning advanced surfaces too, you guys are the best :)
 
T

TaylorBramble

Guest
I've been working with GM for a few years, if you need any help I'll be glad to lend a hand :p
 
Top