Possible to inherit actor groups via hierarchy?


  • *
  • Posts: 48
For instance we have two behaviors.
one affects the group 'object', the other affects the group 'players'

Is there a way to define the group 'players' as part of the group 'objects' also?

Would the actor group attribute cover this scenario and is there a very simple way of setting up the kind of hierarchy of inheritance i'm describing?

Or is this not something Stencyl has any way of handling with built in functions and will require blocks/code?


  • Posts: 121
From my experience I havnt seen any ways of stencyl being able to do this , but one of the more experienced guys on here might know of a work around to mimic inheritance or even polymorphism.


  • Posts: 2691
You can assign mirrored collision shapes to animations that have different collision groups, but beyond that I don't think there is a way to get real inheritance like what you want. You still have to assign a single group for the actor to belong.

Generally speaking, I would make a different actor group that more or less acts on behalf of both groups. You have to assign event handlers separately for it, but it is one way to do it and still theoretically keep things coherently organized. As a note, when I have to have multiple collision handlers for different groups, I sometimes have all of them jump to a function call that contains the shared functionality. It makes modifications later much simpler and less error-prone.
Do NOT PM me your questions, because I likely will not respond. If I have replied to your question on the forum, keep using that topic. Thanks!


  • *
  • Posts: 48
Alright thanks guys I appreciate both responses.

It isn't necessarily the collision i'm after specifically, just being able to inherit according to some sort of grouping. Was just curious if it could be handled by stencyl's built in 'groups'.

Thanks Photon I will keep that in mind as I try a few different methods. It'd just save a lot of work and allow me to re-use a lot of material by using some form of inheritance.

I feel like this is something which should be worked on for future releases. It seems to me to be a natural progression in thought once you understand the basics and as I understand it imitates proper coding methods. Which would seem like a bonus for stencyl; to help develop the kind of thinking which is applicable to true coding.