Jump to content


Photo

GMSpriterAPI


  • Please log in to reply
53 replies to this topic

#1 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Global Moderators
  • 14385 posts
  • Version:GM:Studio

Posted 19 April 2012 - 04:47 AM

Summary
This adds support to load Spriter character animation files into your games.

Interface:

  • SpriterInit() Initializes the setup
  • SpriterLoadProject() Loads the SCML file. Supports multiple files
  • SpriterSetCharaterAnimation() Set the animation for the character
  • SpriterDrawCurrentFrame() Draws the animation frames
  • SpriterDebugMakeAnim() pops up a menu to create an animation from the characters available

NOTICE:
Included in the zip is the Spriter R1 and R3 character files, no harm intended, used for proof of concept

Limited support for R1 and R3

There are features in Spriter that could be supported... Collisions would need to be synchronized and I think there is hot point support to come in Spriter but the file did not have anything regarding the 2.

If you are interested, I can add support to fetch where an item is, like the sword in the animation so you can drop a collision enabled object at the location, so to detect sword hits. I could also provide support for compound characters where each sprite could possibly be linked to an instance.

Support
  • Spriter R1 files support
  • Spriter R3 files support
  • hot spot support (to us, x,y origins)
  • bounding box loading, no access

Issues:
  • The frame timing is slightly off (not noticeable though)
  • <charmap> section is ignored
  • <group> ignored

Please provide feedback... and I do have a donate link below in my sig :)


The Demo
It asks for the animation file when it starts
Right Click will show the characters available.
  • 5

#2 Arusiasotto

Arusiasotto

    GMC Member

  • GMC Member
  • 509 posts
  • Version:Unknown

Posted 19 April 2012 - 07:29 AM

Shiney. Good work Brosky.
  • 0

#3 D1g1talAli3n

D1g1talAli3n

    BoyGenius

  • New Member
  • 963 posts
  • Version:GM8

Posted 19 April 2012 - 07:37 AM

I think a lot of us don't know what "Spriter character animation files" are, so it would be great if you could clarify that.
  • 0

#4 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Global Moderators
  • 14385 posts
  • Version:GM:Studio

Posted 19 April 2012 - 07:40 AM

I think a lot of us don't know what "Spriter character animation files" are, so it would be great if you could clarify that.


http://gmc.yoyogames.com/index.php?showtopic=535410&st=0&p=3930853&fromsearch=1&#entry3930853
  • 0

#5 D1g1talAli3n

D1g1talAli3n

    BoyGenius

  • New Member
  • 963 posts
  • Version:GM8

Posted 19 April 2012 - 09:18 AM


I think a lot of us don't know what "Spriter character animation files" are, so it would be great if you could clarify that.


http://gmc.yoyogames.com/index.php?showtopic=535410&st=0&p=3930853&fromsearch=1&#entry3930853

Wow, that looks great! Thanks!

EDIT: This is actually very useful. I've been looking for a software like this but haven't managed to find one. If only I knew about it before I started my current game :dry: :tongue:

Edited by D1g1talAli3n, 19 April 2012 - 09:24 AM.

  • 0

#6 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Global Moderators
  • 14385 posts
  • Version:GM:Studio

Posted 19 April 2012 - 04:28 PM

EDIT: This is actually very useful. I've been looking for a software like this but haven't managed to find one. If only I knew about it before I started my current game :dry: :tongue:


We have a few tools like this on the GMC but most are a clumsy due to the nature of GM. GM's lack of GUI functions makes it hard to make things like this.

I was 3/4 done with mine when this came out. Now I'm not sure if I'll finish mine and risk being called a cloner. Seeing this in action, the 2 programs look like siblings separated a birth, one raised by Windows and the other raised by Ubuntu.
  • 0

#7 D1g1talAli3n

D1g1talAli3n

    BoyGenius

  • New Member
  • 963 posts
  • Version:GM8

Posted 19 April 2012 - 07:29 PM


EDIT: This is actually very useful. I've been looking for a software like this but haven't managed to find one. If only I knew about it before I started my current game :dry: :tongue:


We have a few tools like this on the GMC but most are a clumsy due to the nature of GM. GM's lack of GUI functions makes it hard to make things like this.

I was 3/4 done with mine when this came out. Now I'm not sure if I'll finish mine and risk being called a cloner. Seeing this in action, the 2 programs look like siblings separated a birth, one raised by Windows and the other raised by Ubuntu.

That's quite a sticky situation you're in. If I were you though, I'd continue on. I'd say given your skill, you could probably come up with something that'll be great, and not only that, you'll be able to have it easily portable to GM. I'm not quite so sure which one is Ubuntu and which one is Windows though :sweat:
May I ask, are you using GM to create your animation software?

Edited by D1g1talAli3n, 19 April 2012 - 07:31 PM.

  • 0

#8 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Global Moderators
  • 14385 posts
  • Version:GM:Studio

Posted 19 April 2012 - 08:28 PM

That's quite a sticky situation you're in. If I were you though, I'd continue on. I'd say given your skill, you could probably come up with something that'll be great, and not only that, you'll be able to have it easily portable to GM. I'm not quite so sure which one is Ubuntu and which one is Windows though :sweat:
May I ask, are you using GM to create your animation software?


Mine looks like Windows. Yes, I'm using GM and WinApi 2 GEX. Originally, I started with VB but I had trouble with finding proper sprite support. As for being portable, the end result when loading the animation in the GM game is quasi identical; that is why it took only about 2 hours to make this, tweaked my setup to support the structure and the file format. It's just series of sprite references, position and styles.

I guess I'll keep going. One main thing is though, I tend to abandon a lot of things (I'm too strict on myself). so at least the community has this to help them out.
  • 0

#9 Cyahnidde

Cyahnidde

    GMC Member

  • New Member
  • 1 posts
  • Version:Unknown

Posted 19 April 2012 - 09:03 PM

I hate for my first post to be a (probably stupid) question instead of contributing something, but... I seem to be stuck.

First off, I'm new to the whole Game Maker scene (coming from using Flixel a lot) and am pretty interested in this stuff. I'm currently using Game Maker Studio so I can check out what Game Maker is all about.

So, Is it possible to use this on Game Maker Studio? If so, would you care to explain how to get this working? Thanks a lot!
  • 0

#10 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Global Moderators
  • 14385 posts
  • Version:GM:Studio

Posted 19 April 2012 - 10:12 PM

I hate for my first post to be a (probably stupid) question instead of contributing something, but... I seem to be stuck.

First off, I'm new to the whole Game Maker scene (coming from using Flixel a lot) and am pretty interested in this stuff. I'm currently using Game Maker Studio so I can check out what Game Maker is all about.

So, Is it possible to use this on Game Maker Studio? If so, would you care to explain how to get this working? Thanks a lot!



Right click the scripts treeview folder, click Add existing scripts, locate the gml file provided.

Oops, that's broken and it made one huge pile of crap script. Just make a new project and import the gmk form the first screen. You can export the scripts in studio format afterwards

In the controller
//this function not suported by Studio ATM. hard code the path and filename
var fname; fname = get_open_filename("Spriter Files (*.scml)|*.scml","");
if(fname !="")
SpriterLoadProject(fname);
else
game_end();
  • 0

#11 Spector_Slayor

Spector_Slayor

    GMC Member

  • New Member
  • 81 posts

Posted 20 April 2012 - 01:47 AM

  • Title: GMSpriterAPI Beta1.
  • Description: Support for Spriter files (SCML)
  • GM Version: :GM81: :GM8:
  • Registered: Yes
  • File Type: .zip (gmk, gmres, gml, animation project file and resources)
  • File Size: 333kb
  • File Link: http://www.host-a.ne...MSpriterAPI.zip

Can someone create an alternate DL link, prefferably from this site. Host-a doesn't want to load the page for some reason.
  • 0

#12 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Global Moderators
  • 14385 posts
  • Version:GM:Studio

Posted 20 April 2012 - 02:28 AM


  • Title: GMSpriterAPI Beta1.
  • Description: Support for Spriter files (SCML)
  • GM Version: :GM81: :GM8:
  • Registered: Yes
  • File Type: .zip (gmk, gmres, gml, animation project file and resources)
  • File Size: 333kb
  • File Link: http://www.host-a.ne...MSpriterAPI.zip

Can someone create an alternate DL link, prefferably from this site. Host-a doesn't want to load the page for some reason.

Try again. I think it was down for a few moments.
  • 0

#13 Research

Research

    GMC Member

  • GMC Member
  • 81 posts

Posted 20 April 2012 - 06:20 PM

Very promising.
Especially the fact that portable while using only GML scripts.

In the SpriterAddSprite the "removeback" is better to false.

Edited by Research, 20 April 2012 - 08:56 PM.

  • 0

#14 kabecao

kabecao

    GMC Member

  • GMC Member
  • 83 posts
  • Version:GM:Studio

Posted 20 April 2012 - 09:42 PM

This is great!

A file of R2 Spriter (not Save Beta) return a error and only R2 version is available for download (I think).

if HTMLNextTag() = "<hotspotarray>" {
    while true if HTMLNextTag() = "</hotspotarray>" break;
}
After "if(thetag != "<spriterdata>") {show_message("Error reading <spriterdata>"); return 0;}" solves the problem until the new feauters aren't supported.

Edited by kabecao, 20 April 2012 - 09:56 PM.

  • 0

#15 SLarouche

SLarouche

    GMC Member

  • GMC Member
  • 91 posts
  • Version:GM:Studio

Posted 20 April 2012 - 10:25 PM

Very nice work on the Spriter API!

I tried with GM8 this morning, and the idle animation was playing no problem.

But this evening I tried in GM8.1, and the game hangs on the init... Anyone had this problem too?

thank you,

Smon
  • 0

#16 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Global Moderators
  • 14385 posts
  • Version:GM:Studio

Posted 20 April 2012 - 11:10 PM

Very nice work on the Spriter API!

I tried with GM8 this morning, and the idle animation was playing no problem.

But this evening I tried in GM8.1, and the game hangs on the init... Anyone had this problem too?

thank you,

Smon


I just ran it in GM8.1. It's incredibly slow to load. I think gm8.1 reworked the string system and it's slow like molasse. Frack I hate xml files. It's a stupid format.

I'll see if I can work something out. Same for the added tag. but not tonight. It's party time.
  • 1

#17 SLarouche

SLarouche

    GMC Member

  • GMC Member
  • 91 posts
  • Version:GM:Studio

Posted 20 April 2012 - 11:30 PM

But not tonight. It's party time.


Amen.
  • 0

#18 Spector_Slayor

Spector_Slayor

    GMC Member

  • New Member
  • 81 posts

Posted 21 April 2012 - 12:48 AM



  • Title: GMSpriterAPI Beta1.
  • Description: Support for Spriter files (SCML)
  • GM Version: :GM81: :GM8:
  • Registered: Yes
  • File Type: .zip (gmk, gmres, gml, animation project file and resources)
  • File Size: 333kb
  • File Link: http://www.host-a.ne...MSpriterAPI.zip

Can someone create an alternate DL link, prefferably from this site. Host-a doesn't want to load the page for some reason.

Try again. I think it was down for a few moments.

No, still hangs on my PC. Can't DL it, can someone please upload here(no signup required/no ads/wait time) as a mirror?
edit: or any other hosting site, I seriously can't DL the file from Host-a. :mellow:

Edited by Spector_Slayor, 21 April 2012 - 06:44 PM.

  • 0

#19 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Global Moderators
  • 14385 posts
  • Version:GM:Studio

Posted 22 April 2012 - 01:33 AM

UPDATE Beta1.2 is up, same download.

Fixes GM8.1.
Faster loading
GM8.1 support

New R2 Spriter tags still not supported.

Will add R2 tags later.


@Spector_Slayor
Sorry about that. can you try with Firefox or EI or another browser? One should work. Having multiple files staggered around the web is not ideal for me, caused me a lot of trouble in the past when updating stuff, I forget to update all sources and someone gets the bad end of the stick.
  • 1

#20 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Global Moderators
  • 14385 posts
  • Version:GM:Studio

Posted 22 April 2012 - 03:25 AM

UPDATE Beta1.3 is up, same download.
Spriter R1 files support
Spriter R3 files support
hot spot support
bbox loading
group ignored
  • 1




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users