lucid's Forum Posts

  • Ashley got it. Thanks. In that case, I will hold off on this for now, until I have a little more time to fully focus on it. I would rather take advantage of the opportunity for some much needed refactoring, rather than rush through it.

  • captainsteff I asked Ashley a few specific questions. Depending on the response, I might be able to take another stab at this before putting it on the backburner for post Spriter2 release.

    tunepunk No there is no specific feature like that for Spriter. We do have a tutorial video on using guide images though :

    Subscribe to Construct videos now

    Also, don't forget you can resuse animations for multiple characters if they share the same skeleton, using character maps:

    Subscribe to Construct videos now

    These types of features are a strong possibility for Spriter 2, but probably not coming until after all the more essential animation features are complete.

  • Ashley

    What is the bare minimum needed to convert a C2 runtime plugin to a C3 runtime plugin? I tried looking through the plugin examples and the SDK docs, but I want to be sure I'm understanding this correctly.

    From what I can tell, the following is needed:

    ACES

    • All ACES moved from plugin.js to their respective files
    • ACES work slightly differently now and need to use return instead of SetRet

    Plugin

    • Boilerplate constructor code and such under plugin class such as cr.plugins_.MyCompany_MyPlugin = function(runtime) gets moved to plugin.js and adapted to the new format

    Type

    • Code for pluginProto.Type needs to be moved to type.js and boilerplate code like pluginProto.Type = function(plugin) adapted to the new format

    Instance

    • Anything that was previously instanceProto is now moved to instance.js.
    • Loading resources and drawing work very differently and require adaption.
    • As in the other sections, boilerplate code, constructors, etc need to be adapted.

    Aside from small changes like properties being passed to constructor, as opposed to being accessed via this/

    Is there anything I got wrong, or I'm missing? Also, the meat of the plugin and js methods should all function the same otherwise, or are there any additional requirements or restrictions for general code?

  • Thanks a lot lucid! We really are looking forward to your updates! 😃✨👍

    You still do plan to upgrade to the C3Runtime after the Custom Importer?

    Eventually yes. Unfortunately, after a quick glance at the C3 Runtime API, the documentation seems to be geared more toward starting from scratch than updating a C2 plugin - so unless there is an upgrade guide somewhere it's a bit much to unpack until I have more time to really dig into it. I'm assuming there's a quicker upgrade path, if I were just to know exactly what sections of code will and won't need to be changed. But I can't spend too much time at the moment trying to figure it out, because there's still a lot to do to meet our Spriter 2 beta release deadline.

    And also lucid, may I suggest posting future updates of the Spriter Plugin into the Official Construct 3 : Addons Page.

    Thanks for the suggestion. I had forgotten about that. I just uploaded the C2 addon there. When I finish the importer stuff I'll upload the C3 one as well. I still need to go around and find all of our links to the old location and update them as well.

  • Hello again everyone. Just a progress update. Nothing to report on the C3 runtime, and that will likely take a while to get to. But, I started working with the Custom Importer API, and there are a few cool things on that front.

    The new import process will be able to import your drag and dropped Spriter project whether you're using the Self-Drawing method or the classic separate sprite methods. It will automatically determine which type of project it is and import it correctly with no additional steps.

    This means that when importing atlased projects, it will automatically set the draw self and filename properties, as well as set the image up in the scml object. It will also automatically take the steps necessary for hybrid style importing, like creating collision boxes and importing sounds for draw-self projects.

    While it will be necessary to zip your Spriter projects to import them, it will no longer be necessary to save both an scml and a scon file when importing your project with separate sprites.

    Finally, once the events are working in the SDK, I believe it should also be possible to make it automatically set up the basic sound events for you as well when your project contains sounds.

    I have to wait on Ashley to fix and add a couple of things before I can complete and release the updated plugin version.

  • K. I had filed a bug report already. I'll update it with a demo addon.

    Edit: The bug report is updated with the demo addon.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks Ashley . That worked. I haven't tested sound yet, so the last question for now is:

    3) Every animation frame has its own origin, and the object itself separately has an origin. Sprites copy the animation frame origin to the object origin. It sounds like we need to make sure this happens when calling the SDK methods.

    Just to make sure, you mean this is something you need to fix in the SDK? Or is there some way for me to set the animation frame origin to the object origin?

  • 3) Just to be clear, you mean 'we' as in Scirra needs to make a change, or 'we' as in plugin developers using the SDK need to do an additional step to update the object to the animation frame pivot?

    4) I'm just trying to make the first frame of the first animation a blank frame of a specific size.

  • Thanks for the help.

    2) This is the code:

    const eventSheet = layoutView.GetLayout().GetEventSheet();
    const eventBlock = await eventSheet.GetRoot().AddEventBlock();		
    console.log(eventBlock);
    
    const systemType = eventSheet.GetProject().GetSystemType();
    eventBlock.AddCondition(systemType, null, "on-start-of-layout");

    which produces this output in the console:

    3) I misread the last sentence "Returns a promise that resolves when the image content" as "with the image content". I just re-fetched it from the array I got with IAnimation.GetFrames().

    There's a new issue though. I'll post it as a bug unless there's a step I'm missing. After changing the first frame with SetPivotX and SetPivotY, it shows up in the layout as if the pivot point is still in the center. If I double click the sprite, in the image editor the pivot point is in the place I had set. If I change the initial frame in the properties panel to something else and change it back, it corrects the pivot point placement.

    4) I meant specifically for the first frame. I can't find any way to remove an animation or a frame, and ReplaceBlobAndDecode only takes one parameter.

  • Ashley - thanks. I mistook that as edittime stuff similar to C2.

    I got almost everything working. The API is excellent and thorough. I did run into a few things I can't figure out:

    1. I can't find anything about creating families and adding object types to them. Is this supported yet?
    2. I'm getting TypeError: eventBlock.AddCondition is not a function. The same for AddAction. In fact, if I log an IEventBlock to the console, it looks like it doesn't contain any properties or functions not derived from its parent:
    3. I don't seem to be getting the 'promise'd IAnimationFrame from ReplaceBlobAndDecode. I need it to specify the pivot point on the first frame. I don't see an option to remove a frame either. This works: currentFrame = await firstAnim.AddFrame(imageBlob, fileWidth, fileHeight); But for this currentFrame is undefined: currentFrame = await currentFrame.ReplaceBlobAndDecode(imageBlob); I tried using a separate variable to hold the result just to be sure there wasn't anything strange happening, and it had the same result.
    4. I couldn't find a way to make the first blank frame of an animation a specific size. IObjectType.AddAnimation would let me specify the first frame size, but I don't see a RemoveAnimation. IAnimation.AddFrame is the same situation with no RemoveFrame.
    5. IWorldInstance has GetOpacity but no SetOpacity. Is there any way to set the opacity?
    6. I'm still getting a bunch of these errors, though everything seems to be working anyway. Is it safe to ignore or will it cause issues down the line?
    7. How would I get a blob from an entry to use with IProject.AddOrReplaceProjectFile(blob, filename, kind = "general") - say I started with: const entry = zipFile.GetEntry(fileName); Also, how would I create a subfolder in the project Files and place it in there?
    8. Any way to import sounds yet?
  • Ashley - finally got around to trying this out on the Spriter plugin. I had a couple of questions. First, is this documented anywhere aside from the CustomImporterPlugin in the sdk?

    Could you please provide a link if so? I wasn't able to find it in the sdk documentation.

    If not, I had a few specific questions.

    1. How would I go about making a blank frame in a sprite of a specific size?

    2. How would I add additional frames to an animation?

    3. Is it possible to add events yet, and if so how?

    4. I'm getting a bunch of errors like this:

     main.js:63 Error loading texture: Error: no content set
     at n.ǃIkK (main.js:80)
     at window.ǃISB.ǃIkG (main.js:80)
     at n.map (main.js:80)
     at Array.map (<anonymous>)
     at window.ǃISB.ǃIky (main.js:80)
     at window.ǃISB.ǃIkN (main.js:80)
     at window.ǃISB.ǃIkR (main.js:80)
     at window.ǃISB.ǃIki (main.js:80)
     at window.ǃISB.ǃIgS (main.js:80)
     at n.ǃIgS (main.js:80)

    when attempting to load images from the Spriter json format. I've confirmed with console logs that it is correctly retrieving valid filenames that exist within the zip. Any ideas?

    Thank you.

  • NetOne - I won't get to working on the plugin until after Spriter 2 1.0, which will be a while, but that's the idea, yes.

  • XpMonster - thank you. There will be a new runtime for Spriter 2.

  • sagispin - That isn't currently supported. I can't give an eta for that feature, but that is something I want to add.

    - indeed. Again, I can't give an eta, but I do plan on updating the runtime as soon as I can.

    Here's the latest Spriter 2 gif:

    A new way to animate

  • - You probably know about this already, but just making sure.