Spawn object into empty marker?

Get help using Construct 2

Post » Thu Dec 17, 2015 5:16 pm

Solomon wrote:I want to create an apple if the apple is randomly chosen, from a family where all 3 - orange banana and apple are inside the family.

I think you can't..
you cant write... create family member with instance variable "apple"
but if I'm right this is going to do just that...
random_Pick="apple"
if c2 coose apple fom family..stop loop..everithig is ok..
else keep trying(create&destroy) until you find apple..then stop

Of course this does not make sense with "Random_Pick" variable,you dont need two times random pick..
(variable and family (already picking random))..but if you have variable "Specific_Pick"..
and set variable to specific fruit.. Specific_Pick="apple"..then you'll get apple :D

have you even tried this?
..maybe I'm wrong
Image
B
62
S
23
G
7
Posts: 1,469
Reputation: 10,729

Post » Thu Dec 17, 2015 5:40 pm

korbaach wrote:you cant write... create family member with instance variable "apple"


I want to create an instance variable "apple" from the family at random pick by setting up a variable text which will control and be linked to the names of the different sprites in the scene, more or less.

Well the problem is that the family variable instances cannot be directly called upon with an event in order to spawn that particular familly member, from what I have been trying to do and what the others have suggested. There is no way to connect the name of a particular sprite to a family instance variable from what I see. Giving a family member a family instance name the same as its sprite name does not work.

The way you have done it, it is going to work is if there are only apples in the family.

The family is not only apples, but its all the fruits. So apples oranges and bananas.
So if the system is going to check wether there is a fruit in the family instance variable per family object, it will find each kind of fruit to be there.

Besides I have other sprites of the same family in the scene, and in the loop the family is destroyed and that is why all the other family members in the scene will get destroyed too, which is something I dont want.
Brick by brick, stone by stone.
B
51
S
23
G
15
Posts: 273
Reputation: 11,538

Post » Thu Dec 17, 2015 10:16 pm

If you want to create an object by name this plugin will help:
plugin-nickname-behavior-nickname_t74522?&hilit=nickname

Personally though i'd either just add a event per type to create it or put them all into animations.
B
88
S
30
G
90
Posts: 5,113
Reputation: 60,837

Post » Thu Dec 17, 2015 10:19 pm

@R0J0hound

Yep, I ended up creating seperate events for all. Im trying to cutback on extra plugins and not use behaviours which all comes down to more control.
Brick by brick, stone by stone.
B
51
S
23
G
15
Posts: 273
Reputation: 11,538

Previous

Return to How do I....?

Who is online

Users browsing this forum: amaloneboys, jance0405, tetuan and 10 guests