But this is obviously not scalable. Imagine that code with 50+ enemies. So I'd like something like this:
> var x = 2
> spawn(enemy with id x)
>
Is there anyway to do this on construct?
Currently no, since the create or spawn action in construct is forcing you to visually pick an object.
However if you really have multiple objects and the familly is just for the purpose of giving it 1 variable type of thing you can try instead of multiple sprites in 1 familly have 1 sprite in the familly, and multiple animations on that sprite named anim1,anim2,anim3, etc... and then when X = 3 spawn sprite at x y and set sprite animation to anim&X
thats the only way i can think of that this might work.
There is also this 2 year old post that kinda talks about the same problem, they seem to been solved it.