piranha305's Forum Posts

  • 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?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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

  • One of the main challenges I encounter, especially in Construct, is maintainability. As projects evolve, you often discover better ways to implement systems or need to tweak your ideas, requiring a refactor of your logic. I find this process quite tedious in Construct. While changes are possible, the effort required to modify your logic seems to grow exponentially, compared to general programming languages where there are more tools to manage complexity, like layers of abstraction, code reuse through inheritance, and composition.

    In Construct, your options are more limited. You can use families to group logic, bundle it into addons, or subclass through JavaScript, but it's not as flexible. Personally, I've been relying more on TypeScript to define functionality, and I hook into game lifecycle events like "on layout start" and "on created" to manage game flow.

    I really wish the integration between events and the JavaScript API was more seamless. There have been improvements like signals and instance signals, which are great, but I think in an ideal world you would not need a separate SDK, you should be able to define Plugins and Behaviors directly in construct.

    I already know of at least one easy way to hack around the sdk2 limitations and expand the api to include whatever internal calls I want anyway - its just "slightly" more bothersome than just installing a plugin - until someone releases tool to automate it. At which point, poor little Timmy IS going to use that hack.

    It's probably best not to do this, this could incite more stricter changes to the API's which would not help anyone, and just create a worse ecosystem for construct, and create a worse relationship between addon devs and the folks making the engine.

    I think there is plenty of time, to migrate and test, and request api changes. before v1 gets sunset. I worry statement like these will just antagonize the dev's instead of bringing positive change.

    Ashley

    I Added a feature request, those event sheet classes have function to manipulate the SOL, maybe those are not needed verbatim, but some interface into the SOL would be a good use case

    github.com/Scirra/Construct-feature-requests/issues/359

    Instead of manipulating the SOL from event sheet classes, it might make more sense to do that per object class instead.