How do I repeat an event for 100 different object without families?

0 favourites
  • 7 posts
From the Asset Store
This sound pack comes with 100 high quality, ready-to-use sound effects for all kinds of games.
  • Hi guys,

    following an example of my situation:

    I have 100 different objects (sprite, sprite2, sprite3, sprite4....sprite100). How do I apply to all objects these 2 events without using "Families"?

    For many reasons I can't use a single object with 100 frames or animations, so I have to work on 100 different object unfortunately.

    Could anyone suggest me a way to solve this issue?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • For many reasons I can't use a single object with 100 frames or animations, so I have to work on 100 different object unfortunately.

    Why not? And why can't you combine them into a family?

    It's not a good project organization when you have 100 similar but different objects, each with its own instance variables, behaviors etc.

    Even if you find a way to run an event for all of them (say, via a script), working with these objects will be very-very difficult. I strongly suggest to reconsider.

  • There is a saying in programming circles that Those that don't use (unix, TCP/IP, families) are doomed to rewrite them. To rewrite what a family does (partly) you can assign each and every single sprite in the game a variable (call it family_type). Then loop on all your sprites and those that have family_type = 4 do your two events.

  • > For many reasons I can't use a single object with 100 frames or animations, so I have to work on 100 different object unfortunately.

    Why not? And why can't you combine them into a family?

    It's not a good project organization when you have 100 similar but different objects, each with its own instance variables, behaviors etc.

    Even if you find a way to run an event for all of them (say, via a script), working with these objects will be very-very difficult. I strongly suggest to reconsider.

    Hi, I have the free versione of Construct...and I can't use families. Easy reason, I'm poor ,😅

  • You can try using multiple instances of a single object, I find myself doing that often for objects that are functionally mostly the same. You can always use instance variables or animation names/frames to differentiate between instances of the same object when necessary.

    Otherwise, copy and paste is not difficult, just a little time consuming.

  • simone15793 probably needs to read article on how families work. Also remember that you can operate family AND each member of family separately, and one object can be member of multiple families. There is nothing stopping you from using family I believe.

  • There is nothing stopping you from using family I believe.

    Except that families are not available in free version of Construct.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)