Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / LoadSkeleton2DFromSpriterFile() crashes the program

Author
Message
Xaby
FPSC Reloaded TGC Backer
17
Years of Service
User Offline
Joined: 17th Apr 2007
Location: Berlin
Posted: 17th Nov 2018 21:17 Edited at: 17th Nov 2018 21:43
Can't say much

LoadSkeleton2DFromSpriterFile(1, "Anubis_FL_Tiny/Anubis_FL_Tiny.scon",1,0) // I can't upload the sprites itself (copyright-thingly)

//LoadSkeleton2DFromSpriterFile(1, "GreyGuy/GreyGuy_Spriter2018.scon",1,0) // from the Examples folder works

SetSkeleton2DPosition(1,300,300)


The little Anubis didn't shows up. I guess, it has something to do with sprites in folders and or not in folders, but can not re-do all the animations and also it is correctly shown in Spriter, so I guess, the problem is in AGK.


And I am really missing the "Atlas"-thingly

Attachments

Login to view attachments
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 17th Nov 2018 22:29
Does your throwing animation have an image/bone that is not in the other animations, like a stone, grenade or such?

This caused headaches for me a while ago and I sent Paul the files and this turned out to be the case, the fix was to add the image and bone to each animation and hide it, it fixed my crashing issue.

as a test, backup the file, delete the throwing animation and reload in AGK
Xaby
FPSC Reloaded TGC Backer
17
Years of Service
User Offline
Joined: 17th Apr 2007
Location: Berlin
Posted: 18th Nov 2018 10:40 Edited at: 18th Nov 2018 11:48
I will try it out. I guess, that's why you have the "Setup" in Spine. But Spine is not free and so it is easier to get Spriter-animations. Also the support for Spine is only the ground. No Mesh-deforming, no skin swapping, no on-the-fly change of items like changing a weapon with attachments ...

Thanks for the answer, I did forgot, how awkward the Spriter-concept itself is in some parts.

[ ... Edit ... ]

first I tried to insert a bone, I guess, I had to do it manualy every keyframe in every animation. Maybe it is easier in an text-editor or something like that.

But it didn't worked. So in the next step I erased the Slash-Image from every keyframe in every animation. And now it loads.

I guess, the problem in Spriter is the mixing-up between bones and images. You can transform images and also make them disapear, they have there own keyframes and also can have alpha and so on. Back then in 2013, I guess, Esoteric noticed that it is unpracticle and create Spine. And Spriter later implemented bones as well.
Also without the "Setup" at the beginning, Spriter is very confusing and a mess with larger animations, because you can't look into every keyframe for every possible picture popping up or not.

Because of that, I guess, it is easier to convert a Spine-file to Spriter. But if you have Spine, you wouldn't do it. But the other way arround would be a benefit, I guess. But the problem here is Spriter itself, you could read the XML and JSON, but how you interprete the images flying arround somewhere, you would create a bone for every image ...
And maybe this would be a mess in Spiner later also. Because you could do "Animations" on one bone in Spine. Multiple Sprites flipping.

So thanks for the hint. Puh, so I have some characters and I guess, they are all messed-up the same way
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 18th Nov 2018 15:22
The problem is they way AppGameKit implements Spriter, I have tried a good handful of .scon files from various sources and most do not work correctly in AppGameKit, my solution was to simply export scaled down versions in the form of sprite sheets and use those, not an ideal solution I know but a means to an end.

BTW you can insert an image into all keyframes:

Quote: "What if you've already created an entire
animation, with lots of key-frames, but then decide you should add something to the character...like
sunglasses for example? Spriter makes this easy. If you've animated your character with bones then
Spriter makes the solution simple. Simply go the the very first key-frame at time 0, add your sunglasses
image to the frame and perfect its position, scale, rotation etc to fit perfectly on the characters face. Then
assign that new sunglasses sprite to the head bone by selecting the head bone, holding B and then left-
clicking on the sunglasses sprite. You can test that the sunglasses are now firmly attached to the
characters face by rotating the head bone, and then pressing Cntrl+Z to undo the movement. Now that the
sunglasses are perfectly places and a child of the head bone, just select them, press Cntrl+C, then in the
menu, choose “edit/paste to all keys”, or by pressing Cntrl+Shift+V. Alternately you can do this entire
action in one step by selecting the object you want copied to all key frames and just hold Cntrl+d. After
perhaps a few seconds of processing, you can scroll through your time-line or play your animation to see
that the sunglasses are now properly positioned and attached to the head on all frames."


I actually find Spriter a joy to use, sure it has a learning curve but given my lack of graphical skills it gives me the power to animate, I never tried Spine so I can not comment but for Spriter there is a tonn of support out there and most obstacles are quickly overcome.
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 19th Nov 2018 16:37
Thanks for the scon file, it looks like it is crashing because some of the images aren't attached to a bone in some frames, I've attempted to handle this case although I don't know how it will look when it tries to draw such images. I've attached a new version of the player with this fix to see if it works.

Attachments

Login to view attachments
Xaby
FPSC Reloaded TGC Backer
17
Years of Service
User Offline
Joined: 17th Apr 2007
Location: Berlin
Posted: 25th Nov 2018 22:22 Edited at: 25th Nov 2018 22:24
Thanks for that.

Yes, it is possible in Spriter and the problem is also, I guess, that the Alpha-Setting is on the Image, not on the Bone.

Thanks to PartTimeCode, I used shortcuts, but I didn't get the slash sprite into the animation, also if it was on a bone, I guess, changing alpha does something wired

Maybe it is to late, but the Anubis was from that bundle
https://www.humblebundle.com/software/rpg-game-dev-bundle

https://www.gamedevmarket.net/asset/2d-game-art-bundle-2018/

Login to post a reply

Server time is: 2024-11-23 11:56:17
Your offset time is: 2024-11-23 11:56:17