piranha305's Forum Posts

  • So currently I am experimenting with having characters made up of different part (feet, hands, body head) and children of a main invisible sprite.

    using timelines I animated this character (walk, idle, attack)

    and this is where I am running into my first issue. my idea is to be able to reuse some of these animations with different characters (made of the same body part sprites)

    so i created a function, that given the UID of the main sprite would select its children and set it as the timeline instances for the given track. I tagged the timeline run for the character-uid & the animation-name (would have been easier in javascript but timeline is missing some interface functions like stop/unset)

    So my first issue is animation state management, every thing almost works fine, so all of the animation are marked as relative. which means each of the body parts move relative to where they are located when the animation is played .

    what happens is during the transitions the body parts might not be in the exact location relative to thier parent.

    for for example during idle lets say the head bobs up and down. when the play starts walking the new origin position of the head is the head position when he started walking, this might be unnoticeable at first, but all these micro movements add up making the head be in a different relative position during the idle animation.

    Okay cool, so before each new animation plays I have to stop all other timeline animations, and adjust all the body to their original relative position so when the new animation plays it plays correctly...

    the stop timeline animation needs an exact name, does not accept wildcards or regular expressions, so the more animation I have the more animations I have to stop, or I need to keep track of that character's current animation, and stop it. this is doable but minor inconvenience.

    setting all the body position back to the relative origin from the parent before the animation starts, this is janky. and adds undesirable stutter?

    Has anyone used the timeline to achieve something similar? Am I using the timeline for something it was not designed for? should I just bake the animations in something like Spriter or Spline? if that's the case the timeline has useful features, where I can tag keyframes and make events happen or add audio that lose with the baking solution, also if have many combinations of different body parts this gets hard to manage, and using timelines is more dynamic?

  • when you get an instance of the array object using runtime.objects.arrMainDeck.getFirstInstance();

    you are not getting a native js array, you are getting a construct object

    https://www.construct.net/en/make-games/manuals/construct-3/scripting/scripting-reference/plugin-interfaces/array

    I think construct arrays are always stored as 3d arrays, regardless of what dimensions you set, I don't think there is an exposed method to extract that 3d array data, you could do like you suggest and use GetAt to reconstruct the array.

    I usually tend to avoid array objects in construct, if I only need 1 dimensions (list)

    you could use a JSON object instead it has similar functionality to support arrays.

    but the advantage with json you can get the raw json value in js

    https://www.construct.net/en/make-games/manuals/construct-3/plugin-reference/json

    https://www.construct.net/en/make-games/manuals/construct-3/scripting/scripting-reference/plugin-interfaces/json

  • I have noticed the same thing since the last beta, my list is not updating as well

  • github.com/Scirra/Construct-Addon-SDK/blob/main/behavior-sdk/v2/basic-bullet/c3runtime/instance.ts

    in the c3runtime folder the function you're looking for is tick, the code in here is what makes the bullet move every tick.

  • Ashley

    Looking for some guidance on getting the typescript def files to generate corerctly.

    I am calling this in Behavior.js

    this._info.SetScriptInterfaceNames({ instance: "IAnimatedCounterBehaviorInstance" });

    this._info.SetTypeScriptDefinitionFiles(["c3runtime/IAnimatedCounterBehaviorInstance.d.ts"]);

    In the c3runtime folder I have the d.ts file (IAnimatedCounterBehaviorInstance.d.ts)

    the signature is

    declare class IAnimatedCounterBehaviorInstance<InstType> extends IBehaviorInstance<InstType>

    ... when creating a new typescript project and updating the typescript def files

    I see my d.ts file getting added correctly butwhen i look at the instanceTypes.d.ts

    The type of the instance is not set to my interface but my plugin id

    declare namespace InstanceType { class __TextBehaviors<InstType> { AnimatedCounter: C3.Behaviors.piranha305_animatedcounter.Instance<InstType>; } class Text extends ITextInstance { behaviors: __TextBehaviors<this>; } }

    If I manually change the type it is working perfect.

    class __TextBehaviors<InstType> { AnimatedCounter: IAnimatedCounterBehaviorInstance<InstType>; }

    is there a way to have construct generate the right type? maybe I missed something in the setup?

  • I wonder if official plug-ins should be versioned just like 3rd party one. And have some setting somewhere where you can choose a version of the the official plug-in to use for cases like this where bug fixes or changes might have unintended consequences

  • Sweet I thumbs up that one, but I think it's different because not even plug-ins support this param type. So it might need to be a new request. (your request has like 8 new features)

    I was just wondering if it existed and I just did not see it.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Nvm, the error was happening way before the addon got init, so scripting interface was not accessible.

    If an addon fails in the ctor the message did not bubble up to the console. It just set the reference to null. You can ignore this.

  • I have ported a few of my addons to sdkv2, but recently when loading them up I am getting an error message saying GetScriptInterfaceClass is null

    I thought on of the benefits of sdk v2 was that you did not need to explicitly define the script interface? did this change recently?

  • what is the param type to get a combo box with all the project files?

    I think the AJAX plugin has something like this? in the Request Project File action?

  • var emailObject = runtime.objects.EmailBodyInput.getFirstPickedInstance();

    var emailBody = emailObject.Text()

    you need to get an instance first.

  • Hey I would like work with on projects, if you have discord you can reach out piranha305#8396

    Here is my itch page, piranha305.itch.io

    I have also made several plug-ins and I'm pretty good with js/typescript

  • You do not have permission to view this post

  • i don't think this is intended behavior but with the grid layout the icons show up outside of the frame?

    are these meant to be confined to the panel?

  • you could potentially use it iterate thru a loop at different points and time. it could defer handling the next element.

    when you use it in a for each loop, I don't think there is an actual difference.

    but the generator has some methods like next() that lets you control when to handle the next item in the collection, here is a silly test

    drive.google.com/file/d/1CCLP2SWMNAX1xuDCV1B3vMrB2DwWe0_2/view

    where I have used these in the past, is for a card game, I have a deck data structure that had a generator function to return the elements, and i would just call deck.next() to get the next card. but this could also be accomplished using a stack or a queue with pop/dequeue,

    where generator excel is the value it returns is lazily evaluated so it's more memory efficient. instead of pulling the entire set in memory it only pull the elements its retrieved