Spriter/C2 - (9-16-2019 - bug fix)

From the Asset Store
Rotate & Animation for 16 Direction & Mouse Direction
  • lucid - looking forward to the update, sounds like you guys are really nailing down a lot of potential issues pretty quickly! would this potentially add the ability to use webgl effects?

  • lucid - looking forward to the update, sounds like you guys are really nailing down a lot of potential issues pretty quickly! would this potentially add the ability to use webgl effects?

    I thought we can always use it even from before?. I can easily use it on mine.

    Use the effects on the family members of the spriter object in the family section of C2. Not the object itself.

    Here's an example from my game

    You can see the effects at work if you play the demo of my game.

  • Sethmaster - interesting. So when you pick a specific instance of a spriter object, you're able to reference all those spriter sprites as well? is that because it's a container?

  • Sethmaster - this looks like it'll be a lot of tedious work to make sure I get every instance selected... but it's definitely a solution

  • Sethmaster - interesting. So when you pick a specific instance of a spriter object, you're able to reference all those spriter sprites as well? is that because it's a container?

    You got it right

    Sethmaster - this looks like it'll be a lot of tedious work to make sure I get every instance selected... but it's definitely a solution

    If you use it in a function, you only need to do it once, tedious and all, and then reference it whenever you want it to be used.

  • > My thinking was that the new pictures would take on the custom pivot point because they were all the same size as the original art. Regardless, I'll just start over using the bones exclusively. Thanks for your help and all your work on the plugin.


    > -Ben


    You likely don't need to start over. There's a fast way to copy your pivot points to images of same name and same size. (if they are in a different sub-folder as the original images.)

    look here : https://brashmonkey.com/spriter_manual/ ... ffects.htm

    At the bold text just before step 3


    -Mike at BrashMonkey

    lucid and I checked out the link provided and it seemed like it was the steps for creating a new Character Map and didn't mention carrying over the new default pivot points.

    Regardless, I did another test and edited the pivot points on the layout (which is actually my preferred way of working) and not by double clicking the objects and setting before importing. The new test worked perfectly so that is how I will do it. I wasn't too far into the animations so I can just start over.

    Thanks for your help. I'm looking forward to getting it finished and up for people to use.


  • Hello,

    Just wanted some clarification—Spriter supports animated hitboxes, sound effects, and most if not all other features when importing into C2? Meaning I don't have to manually add in sound effect timing etc. in Construct? (Sorry if this has been answered before—couldn't find a clear answer after 20 minutes or so and I figured asking would be easier than searching this entire thread...)

    Thank you~

  • BBaller1337, here you go

    Subscribe to Construct videos now
  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • EDIT: If your project was created with an older version of the plugin, and you want to continue to use the old mode for the plugin, you will get an error when you launch C2. Please download this version of the plugin if you don't plan to convert your project to the new mode. I am checking into whether there is a way to get the edittime to load without errors even without converting, and if I can find a way, I will update the plugin accordingly.

    thanks BBaller1337, yes it supports all non-experimental features (everything except deformation), though sub-entities currently have a manual import process I can repost here if you need it.

    everyone - the performance mode/self drawing update is here

    It requires the new version of Spriter Pro (or auto-update your current version)

    The download for the plugin is here.

    Again, consider the new mode to be in a beta state, until it's had some time to get tested more extensively by the Scirra community.

    To use the new direct drawing mode. Use the following steps:

    • In Spriter, make sure your project is already saved normally.
    • Go to File|Generate spritesheets for project images
    • Select a different folder from your current Spriter project folder to save your spritesheeted project
    • Make sure 'padding' is set to at least 1 pixel or C2's linear smoothing will cause images to bleed into eachother
    • Make sure 'save spritesheeted project' is checked
    • Make sure 'save as scon' is checked
    • Make sure 'embed spritesheet info in project file' is checked
    • Make sure you keep the 'multiple spritesheets' setting to 'Never generate multiple spritesheets' (default setting)
    • All of the above settings (with the exception of the output folder) will be saved after the first time you use them
    • Create a new project with C2
    • Add an scml object in the same way you would any other C2 object (do not drag the scml file into your layout)
    • When the image dialog pops up (or double click the scml object to open it), choose the generated spritesheet image from the output folder you selected
    • In C2's project pane, right-click on 'Files', and select 'Import Files', and choose the scon file from the output folder you selected
    • Select the scml object, and in the object properties pane, for SCML file, type in the filename of your scon file
    • Set 'draw self' to 'true'
    • Run your project, and report any issues or bugs to this thread.

    To change your existing project to use the new direct drawing mode:

    • Follow all of the above steps until you get to the part where you would start a new C2 project.
    • Remove all the sprite objects associated with your Spriter object from the project
    • Remove the previously generated initialization event from your project
    • Remove the previously imported scml and scon file from your project
    • Start from the step above where you double click your scml object to choose the spritesheet image
    • If your project was started with the previous version of the plugin you will most likely get an error when you run it. This has to do with the previous version of the plugin having no image. To fix this, simply save your project, and reload it.

    Enjoy! Hope this comes in handy.

  • lucid - hey man, this works great. you also forgot to add that weg gl effects work also those weird extra sprites that were showing up in the corner of the level are gone too. nice work guys!

    I did run in to an issue when I was trying to convert an existing spriter object over to the new format. I seemed to narrow the problem down to when I loaded the sprite sheet in. here are some screenshots of the two errors I got (in chrome):

    since I'm using families for my enemies, I was just able to create a new object and follow the steps and everything worked fine. it's not a huge issue for me to work around it this way, but either way I hope this helps!

  • lucid - one more quick question, every time I edit my scml files, do I need to edit the non-spritesheet versions and then save them as sprite sheet projects each time?

  • mudmask - Thanks, I will look into those bugs. And yes, you do have to edit the non-spritesheet versions and save as spritesheeted each you want to reimport.

  • Thanks for the earlier response, I've been playing around and got a lot of things to work, and it's great so far. Unfortunately I have run into some concerns.

    f?i?r?s?t?,? ?n?o?t?e? ?t?h?a?t? ?I? ?s?e?n?t? ?a?n? ?e?-?m?a?i?l? ?a?b?o?u?t? ?t?h?i?s? ?t?o? ?s?u?p?p?o?r?t? ?a?l?r?e?a?d?y?,? ?j?u?s?t? ?p?o?s?t?i?n?g? ?a? ?b?i?t? ?i?n? ?a? ?p?u?b?l?i?c? ?m?a?n?n?e?r?.? ?T?h?e? ?p?l?u?s?-?s?i?d?e? ?i?s? ?t?h?i?s? ?c?o?u?l?d? ?h?e?l?p? ?o?t?h?e?r?s? ?o?r? ?I? ?c?o?u?l?d? ?g?e?t? ?o?t?h?e?r? ?p?e?o?p?l?e?'?s? ?f?e?e?d?b?a?c?k?,? ?t?h?e? ?d?o?w?n?-?s?i?d?e? ?i?s? ?t?h?a?t? ?i?t?'?s? ?a? ?p?r?i?v?a?t?e? ?p?r?o?j?e?c?t? ?w?i?t?h? ?c?o?n?f?i?d?e?n?t?i?a?l? ?i?n?f?o? ?a?n?d? ?a?r?t? ?s?o? ?I? ?c?a?n?'?t? ?s?h?a?r?e? ?t?h?e? ?C?A?P?X?.? OK, apparently I can't get help through private channels, so I have to go off messy explanations since I cannot publicly share screenshots or the CAPX or anything.

    Anyway, I'm trying to figure out how to set up enemies in my 2D action game. In it, you can attack with one character and hit an enemy. I figured having a family for all enemies with common instance variables and behaviors would be a good idea, so I did that. For the object, I set it to the SCML one. Probably I'll do it so that each enemy has its own scml file, for about 20 different enemy types (including bosses).

    The issue is that the SCML objects have their own collision box and this is used by Construct 2 for:

    • general collision detection, of course
    • shadows (shadow light object + shadow caster behavior)
    • interactions between solid objects

    When checking interactions between two objects with the "solid" behavior, C2 uses the collision mask of the object with the behavior. I can adjust this slightly by linking the scml to another object and changing said object, but in the end its collision mask is not going to match every frame of every animation--it's just going to be something static. So... what am I supposed to do if an enemy is say, lying down on the ground or in some other pose where their shape changes dramatically and a single rough & static collision mask won't fit the object?

    Shadow issue is basically the same thing from what I can see, just a different application. It's using the SCML object (or in the player character's case, the sprite object that is pinned to the SCML object) and using that to draw shadows.

    I tried maaaaany different things and did hours of researching or I wouldn't bother rambling about my problem here. There were issues with putting the shadow caster behaviors on many different places (such as the sprites) and I think it's just going to be difficult to handle this when it's not integrated into the Spriter object behavior and I don't fully understand how exactly the Spriter object does what it does.

    I could do without shadows, but objects not having solid behaviors would just look and function oddly. As for the collisions, it's extremely confusing and I'm not sure what to do but at least I have control over the interactions, unlike the Solid behavior.

    Thanks for any advice/help anyone can offer.

    UPDATE: After a ton of thinking, research, and coding, I managed to work around the collision boxes issue by using families, containers, and some crazy code and as of right now I think I've got everything working, though it needs more testing. I still haven't fixed the issue with the solid or shadow caster behaviors though.

    I also have some issues with Spriter I'd like report... hopefully it's just me being bad, which it usually is.

    Spriter Issues

    Sometimes renaming files at the top-left doesn't work, if I try to like, rename something and then rename another thing. I haven't been able to figure out what exactly causes or fixes the issue but it can be somewhat inconvenient when I keep double-clicking and it won't rename. Maybe there is some trick to it I'm missing or maybe it's a bug, I don't know.

    Meta data: when I adjust basically anything in the timeline, the existing meta data I have (just tags for now, but I want to try out variables in C2 as well, since I haven't found anything on how they work) just disappears. The key frames for them or whatever disappear and I have to re-add them, which is... well, obviously not cool.

    I feel like I'm doing something wrong in adjusting the tags, but I can't figure out what. :

    As always, thanks for any help.

    Update 2: Meta tags just... aren't working for me. Aside from being glitchy in Spriter, after several hours and various code tests I cannot get the different tags to function correctly in C2 either. I checked the JSON file and it seems like it's right (though I couldn't tell you confidently without a little more info about the format) but I'm just having no luck.

  • BBaller1337, I'll look into everything you mentioned.

    mudmask, we were able to replicate the issue. The issue was from projects created with the previous version of the plugin. The simple fix is to save your project (to a new filename just to make sure), and then close it, and reload it. After saving and reloading, it should work fine.

  • lucid Thanks for the update.

    I've been doing almost nothing but trying to fix this since, here's my end:

    I managed to get shadows working by adding the shadow caster object to the sprite objects, having it disabled by default, and then enabling it when an animation was active (I used a "IsVisible" check for this to keep things super simple; I'm not sure how well this would have worked in the long-run). However, I ultimately didn't like the result and opted for a very different (and less costly) implementation of shadows.

    EDIT: I originally said I got the solid behavior working but I spoke too soon and was wrong about getting a solution to the solid behavior functionality. It's actually still not working. Worst-case scenario it's super glitchy and the main character goes flying around, lol. I guess the next paragraph doesn't apply as much since said solution doesn't work but.....

    The downside to this solution is that A) it's time-consuming to make sure everything is set up and functioning correctly and B) it'd probably be more efficient and less prone to glitching if the SCML objects inherently used the collision or hurt boxes of the animations its loading, so if you have any suggestions or anything, I'd appreciate it.

    Also, quick question: what does changing the .scml extension to .scon for the SCML object actually do? I've forgotten to do it a few times but haven't noticed anything. Thought it might be the cause of some issues but after going and back and double-checking I didn't see any differences.

    As a note, I still couldn't get tags to work in C2 and gave up for a while—I did eventually look into it but couldn't find an issue in the plugin's runtime code. Then again, I didn't understand the code super well or anything, so I'll leave it to the pros... especially since the Spriter issue with the disappearing key tags isn't really work-aroundable

    EDIT2: Got around to testing triggers and they work perfectly and it felt great. I just used those as a substitute for tags since they can basically do the same things, they're just maybe slightly less convenient or efficient.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)