8DashP Posted March 26, 2014 Report Share Posted March 26, 2014 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? Thanks. Russell. Quote Link to comment Share on other sites More sharing options...
8DashP Posted March 27, 2014 Author Report Share Posted March 27, 2014 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? Quote Link to comment Share on other sites More sharing options...
Trixt0r Posted March 27, 2014 Report Share Posted March 27, 2014 Yes, it should. Just try and see if you get an index out of bounds exception or something like that. Quote Link to comment Share on other sites More sharing options...
8DashP Posted March 28, 2014 Author Report Share Posted March 28, 2014 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. Quote Link to comment Share on other sites More sharing options...
lucid Posted April 20, 2014 Report Share Posted April 20, 2014 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. Quote Link to comment Share on other sites More sharing options...
8DashP Posted April 20, 2014 Author Report Share Posted April 20, 2014 Thanks. Yep, figured all that. I'm using it as an optimisation technique to only load required images instead of all of them. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.