piranha305's Forum Posts

  • I just want to chime in and agree with Overboy, better (signals / triggers / event Listeners, pub/sub support ... ie whatever you want to call it) would be really awesome for cases like this. and not just from the Addon SDK to event sheets, from the JS Side of things to the event sheet would also be great.

    something that does not necessarily go thru the trigger (condition overhead), but instead acts like a jump statement in way to a specific section of the event sheet (by tag). and having multiple consumer points would help with develop experiences, it will let us structure and organize the event sheet in a more maintainable way.

  • Ashley

    One of my main use cases for the Addon SDK, is portability and reuse of code. everything is packaged together nicely. a lot of things that can be done with JS is much more convenient to move to addon.

    And I think that stems from JS and event not having good interoperability.

    If I had some code I wanted to reuse across projects, I need to import the js file, then create functions in the event sheet to act as like some middle layer to properly invoke my JS code from the event sheet.

    setting up triggers or event from JS code to the event sheet is also pretty tedious.

    As where with the Addon SDK I can package all these things up nicely with a little bit extra boilerplate. but then my code is portable, and it's exposed in the scripting interface. triggers are easy. and even thought that is a bit more work the experience is much more seamless, and much more reusable.

    Maybe I am thinking about the SDK incorrectly, because while it can be used to integrate Third party services, I think the main use case is adding extra functionality in the engine.

  • If you already know Javascript chances are you aren't going to use C3, and if you use C3 to learn JS then you'll probably outgrow the engines limits and move on.

    As some one who knows javascript and work professionally as a software developer (not in game) I disagree with this take. I have used all the engines and keep coming back to construct. And those advanced scripting makes me want to invest more time In The engines.

  • If construct could get to the point where it had a tool to help author behaviors and plugins...So at least you could just write 1 file, and all you had to do was fill in the actual script functions (like tick), life would be much better. Sure you need to define ACEs, but doing them accross multiple files is a pita.

    not exactly 1 file, but this framework by skymen is pretty good, you define all the aces in one file, and then can forward the implementation to the instance

    github.com/ConstructFund/c3ide2-framework

    there is also a CLI here - github.com/ConstructFund/c3ide2-cli

    and also I definitely agree with the addon SDK as is very cumbersome to work with and there is a ton of boilerplate. it also feels very disconnected from the editor itself making eth develop experience suffer.

  • Currently object param in aces can have an optional allowedPluginIds property that filters the selection based on the plugin type?

    Is there an equivalent to this that filters the list on object that have attached a specific behavior?

    Like being able to pass in a behavior id and have the list only show objects that contain that specific behavior?

    Tagged:

  • One thing that could help is highlighting the awesome examples on social. There are some really sweet examples that would catch people eye with some gifs and draw attention to the engine.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I hope this is useful to somebody else other than Mikal (I doubt it :D)

    This is super helpful, thanks for this feature!

  • Is there currently a way for a behavior to draw stuff to the editor.

    Thinking of like helper gizmos

    To visualize thing in the editor?

    Tagged:

  • I was trying to emulate. the picking of object that were created on the same tick. like what happens when using "Spawn another object"

    on the SdkType for the Sprite, there are 2 functions BeforeRunAction(method), and AfterRunAction(method) which are essential to keep track of the instances.

    These function on the sdkTypes are called automatically by the framework for certain ActionTypes

    CallBeforeAfterHooks() { return this._actionType === 3 }

    Is there a way from the addon sdk to control, what type of action this is? or to trigger the hooks? I have been trying to reverse engineer this for a few hours, thought it might be better to ask?

    I know actionType === 1 is for User Scripts, but that is as far as i have gotten

    Tagged:

  • I've been holding off on exploring the custom actions, but what are the general pros and cons of custom actions vs. built-in functions?

    On the surface it "seems" like built-in functions but with copy-picked enabled.

    You get polymorphism with families. when different object types have the same custom action.

  • Recently a signal trigger condition was added to last beta. currently only way to emit signal is through the event sheet? Is there a possibility of adding this functionality to the JavaScript API?

    Currently we can work around this with creating an event sheet function that emits the signal and just call that function.

    Tagged:

  • I had made a video where I go over one of the use cases for this in a game I am working on. https://www.youtube.com/watch?v=MEQtDCqeDu4&t=43s&ab_channel=Piranha305

    the video is quite long but, in a nutshell, I had a color picker system that was used on multiple layouts and when a new color was selected, I would create and dispatch a color-changed event (I would attach the hex value to the event data)

    I did run into a few issues removing events, and getting unintentional duplicate events, so I created a manager class to ensure events would not be duplicated and cause issues and also to keep a function reference used to remove events.

    But to consume the events you just need to call addEventListener on the instance.

  • Subscribe to Construct videos now

    Been working on some card games prototypes recently, took some inspiration from Slay the Spire, for this one. I'm thinking is going be a rouge-like, where you need to rebuild you deck each run, and each character will start with specific cards. there are also equipment cards, that will modify the cards or give specific effects. what do you guys think? would you play something like this?

  • fingerskier Okay I think I might know what might be happening, so when you make changes to the addon code in c3ide, you need to click on the button that says (Compile Only)

    this process get ran when you click Test C3 Addon, that step is what create the actual files that will be served to construct. this is needed because the way c3ide handles the addons files differs from the final structure of the actual addon. its what combines all the aces into the ace.json/the lang.json/ and the actual implementations, so when you make changes in order for it to be reflected in files the web server is sending to construct you need to rerun this step. (you can leave the web server on while you run this process)

    Also There is a setting in options called Compile on Save (which will do this automatically when you save the project), so you can just start the web server, and when you make changes and save, it should good to go on the web server. i don't recall if you still need to restart construct, i don't recall if they cache the dev add when it loads?

  • fingerskier I just pushed out an update to c3ide to set "Cache-Control: no-store" header to all the responses, please let me know if you run into any issues!