Open TackerTacker opened 1 month ago
You can now use scripting to write your own behaviors. If you don't want to learn JS, you're missing out. It's no more difficult than learning how the event editor works. I'm sad that you don't use such a powerful tool as scripts.
Please stay on topic, your coding preferences isn't a valid argument against other peoples preferences. The logical conclusion to your argument is that we should get rid of Event Sheets in Construct because JS is more performant.
Reviewed guidelines
Checked for duplicate suggestions
Summary
Behaviors are a foundational building block of making any game in Construct, but we have no way of creating our own with event sheets.
I want to be able to write event sheet code that can be attached to Plugins like a Behavior.
Possible workarounds or alternatives
Developing your own Behavior as an addon, which is IMO out of reach for many Construct developer.
Proposed solution
I think a great way of implementing this from a UX standpoint would be if we could add an event sheet to Plugins as a Behavior. You would attach the Event Sheet Behavior to a Plugin and it would have 2 properties, an enable/disable boolean to enable or disable the behavior, and a drop down where you can select one of the available event sheets in the project.
There would be a new global ACE similar to
System
but with the nameBehavior
which is accessible everywhere but only does anything if that event sheet is attached to a Plugin as Behavior, as well asBehavior Variables
which are similar toGlobal Variables
but their scope is limited to the event sheet they are on and if the event sheet is attached as a Behavior thoseBehavior Variables
show up as properties ( This way the code is portable becauseBehavior
andBehavior Variables
never becomes invalid ).The new global ACE would add things like: CONDITIONS
Behavior.ready
triggers after the plugin the event is attached to was created and initialized, it's likeOn Start of Layout
but specific to this behavior.Behavior.tick
which is a trigger similar toevery tick
but it's triggered when the Behavior is ticked instead.Behavior.in_view
true if the plugin the event is attached to is within the viewport.ACTIONS
Behavior.X/Y/Z/Width/Height/Angle/Opacity/etc.
to set the position, rotation, size, etc. of the plugin the event sheet is attached toEXPRESSIONS
Behavior.X/Y/Z/Width/Height/Angle/Opacity/etc.
to get the position, rotation, size, etc. of the plugin the event sheet is attached toWhy is this idea important?
Because it would make Construct 1000 times more powerful and cooler 😎
Being able to create your own Behaviors with Events would allow us to write composition based code which is a lot more flexible. Basically any reason why Behaviors are great in Construct can be transferred 1:1 to why event based Behaviors would be great.
Additional remarks
I know this would be a year long development, but I also know this isn't a new idea to Scirra, Ashley talked about this a long time ago already. By making this an official feature request I hope to increase the chances for this to be considered again, I also hope that this will lead to a discussion in the comments on what people would want from this feature, what they would expect, flaws with my suggestion, anything that's unclear, and how they think things should be implemented, maybe my implementation idea isn't the best. I also suggested only a few ACE's, so I'm curious about your ideas, what are some Actions/Conditions/Expressions you think would be important?