Problem with creating object on another object

Get help using Construct 2

Post » Mon Oct 21, 2013 12:59 pm

Hey!
I am making a shooter that invovles a little ship shooting aliens. I am right now working on upgrades for the ship and one of the upgrades that i want to include is a little automatic turret that helps the ship shoot aliens. I have ran into a slight problem tho.

I created a text that is going to work as a button to buy the turret and made the ship into a container for the turret. All of that works fine, but when i click the button it just spawns a second ship and a third if i click again and so on. They do have the turrets on their backs, but i dont want multiple ships flying around.



These are the events that i am using for the it all to work.
B
9
S
2
G
2
Posts: 18
Reputation: 1,415

Post » Mon Oct 21, 2013 1:00 pm

Pic didnt work. Here is a link https://dl.dropboxusercontent.com/u/168588892/Problem.JPG
B
9
S
2
G
2
Posts: 18
Reputation: 1,415

Post » Mon Oct 21, 2013 1:02 pm

I have also tried having the "Player" create the object, but i got the same result.
B
9
S
2
G
2
Posts: 18
Reputation: 1,415

Post » Mon Oct 21, 2013 1:40 pm

I can't find a problem with the code. Are there even any events that spawn player? Maybe they are interfering somehow.
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786

Post » Mon Oct 21, 2013 1:42 pm

When player and turret are in a container, creating one will automatically create the other.

Wouldn't it be much easier for the ship to spawn the turret when needed and pin the turrent to the ship on created?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Mon Oct 21, 2013 1:50 pm

Oh I didn't know about the container function. Interesting, new thing learned.
Visual Novel 'Engine' in 100 Events
if you ever have to choose between buying Construct 2 on scirra.com or on Steam, read this: Review
B
22
S
9
G
1
Posts: 787
Reputation: 3,786

Post » Mon Oct 21, 2013 1:54 pm

Oh i had no idea about that. Yes that would be a thousand times easier, thanks for the help!
B
9
S
2
G
2
Posts: 18
Reputation: 1,415

Post » Mon Oct 21, 2013 2:01 pm

If you do want to use the container, to make it easier to destroy all objects in the container in one event, you'd have to make all events regarding the turret in a group and have the turret be invisible at start. Then when the turret is set visible activate the group.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Return to How do I....?

Who is online

Users browsing this forum: ivanski1983 and 13 guests