spawn family member by index

Get help using Construct 2

Post » Tue May 29, 2012 2:18 pm

Hi, I would like to know if its possible to spawn a specific member of a family by its ... maybe family-index?

Example: family "Assets" contains the Sprites "Trap", "Fire", "Skull".

Then i would like to spawn Asset(0) for "Trap" and spawn Asset(2) for Skull.

If there are other ways of dynamically creating objects "by name" for example that would be also nice to know.

I need this for a MapEditor like the Super Meatboy one, where you can place assets with your mouse and swich through all of them with your mousewheel.
Fabian Schempp2012-05-29 14:34:11
B
18
S
3
G
3
Posts: 29
Reputation: 2,724

Post » Tue May 29, 2012 6:21 pm

Have you considered using different animations / frames in a single object?
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Tue May 29, 2012 7:34 pm

thanks for the anwer.
I will use this method for the tiles.
but i thought, since i have the logic for the other assets, already for the game, i could use this assets them selfs, instead of an other object representating them.
(With logic i mean assembling complex Assets OnCreate.
An easy example is an fire place, which is assambled from
"wood" sprite and a "flames" particlesystem)Fabian Schempp2012-05-29 19:35:29
B
18
S
3
G
3
Posts: 29
Reputation: 2,724

Post » Sun Nov 18, 2012 8:44 pm

Hmm.... I'm looking to do something similar. I have a "machine" that makes objects for you. I want to make a family for those objects, and have every object that "IsBuildable" to pop up on the screen for the user to choose. I need to look into how people are doing inventories. :-P
B
9
S
2
Posts: 7
Reputation: 1,715


Return to How do I....?

Who is online

Users browsing this forum: austinblackbelt, Timedoor Indones and 18 guests