Jump to content

Objectinfo name & file/folder uniqueness issue


Recommended Posts

I've come across another dilemma. Everything works wonderfully when only a single copy of a sprite part is used, and I can use the folder/file I'd combo to identify my part. However, when multiple copies of the same part are used, the folder/file is no longer sufficient to identify which part I am using, as multiple different objectInfo names point to the one folder/file Id, but each copy can have different runtime values.

I therefore need to store each instance separately, including the image data. This is where I have a problem. The SpriteTimelineKeys only use the file/folder combo to identify the object being operated on. I see though, that the timeline name seems to match the objectInfo name.

Can we assume that the timeline name can be used to match the object instance name it is operating on? As a backup plan, the mainline reference also refers to the objectInfo name, which could be passed down to the timeline functions, if the mainline were a match, but the timeline wasn't for some reason.

Do either of these sound like viable options for applying timeline values to the correct object instance, rather than the base file/folder objects?



Link to comment
Share on other sites

As a follow up. I'm thinking the "obj' attribute in the Timeline element in an index value into the array of loaded "obj_info" attributes. Is that correct? So the Timeline name matches the "obj_info" name, but the "obj" number also matches the obj_info attributes?

Link to comment
Share on other sites

Yes, it should. Just try and see if you get an index out of bounds exception or something like that.

Well it was working fine on the lightning sample, but when I tried doing my own sprite today, with image swaps, I found a flaw in the theory. For just image swaps, the obj number and the name match the obj_info name and index, but that in't sufficient, as image swaps index into the data. So it looks like I'll have to rework the methodology.

Problem is, it's a many to many relationship. Each obj_info can point to many image files, and each image file can have multiple obj_info references. Urgh, never a good sign when that happens.

Link to comment
Share on other sites

  • 4 weeks later...

Hi 8DashP. I'm sorry for the extremely late reply.

The ObjectInfo's are extra data that is not required for an implementation, but may be useful when making plugins for game authoring tools, like Construct 2, or GameMaker Studio where the authoring tool already has a level editor, and it's own concept of a sprite.

You enable this information to be saved in the Save Options dialog:


The separate structure found at the beginning of a file shows you every file needed by the project:


The object_info tags have a list of every image used by a particular object. So if your "head" object in Spriter was on 3 different animations, and used 'head_front.png' thirteen times, and 'head_middle.png' twenty times, and 'head_right.png' once, all in no particular order- it would list each of those images once. The point of this information is if your game engine has a concept of a 'sprite' with 'animation's and 'frame's already, you can have a minimum set of images listed for you that would be needed for each 'sprite' object.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...