Anyway to spawn a <variable_name> Sprite? Family context

Get help using Construct 2

Post » Fri Apr 20, 2018 2:44 pm

Hello there!

Firstly, i actually know that i can "spawn another object" and pick the sprite i intend to spawn, while spawning the family itself, the sprite spawned will be random.
My question is actually how to manage many sprites and it's spawns. Example:

Suppose 80 enemies at 1 enemy family. The way im doing to have a function that receives a code (or "tag") respective to an enemy and then i check its value to know which sprite i should spawn. Like a switch/case.
Theres anyway to spawn a <variable_name> sprite? Because with that, i could just pass the name by parameter and could even implement some randomness within choose() etc.


Edit: found something related; basically C2 can't do this natively (plugin-nickname-behavior-nickname_t74522)
B
19
S
7
G
4
Posts: 184
Reputation: 4,198

Post » Fri Apr 20, 2018 2:51 pm

I think it's possible in C3, but not in C2.
The best you can do is a bunch of events like this:
If variable=x then spawn object x
If variable=y then spawn object y
etc.
B
19
S
9
G
158
Posts: 2,393
Reputation: 84,413

Post » Fri Apr 20, 2018 3:56 pm

Yeah dop, from what i read (after posting this thread, my bad) its native on C3. WIth C2 u need some third party or the way you stated (thats how im doing, but encapsulated in a function).
B
19
S
7
G
4
Posts: 184
Reputation: 4,198


Return to How do I....?

Who is online

Users browsing this forum: DarthPapalo666, quevsal, TheRubberMeep and 1 guest