(solved) Placing turret not over other turret

Get help using Construct 2

Post » Fri Aug 29, 2014 6:15 pm

EDIT: Changed attachment, wrong project

Hi,

im building a towerdefense game with pathwalking monsters and turrets. Nothing special, its my third day with C2 im a noob :)

I used the tutorial from Geometrix and made some changes... surely this is where i made the mistake.

When i placed a turret on the grid it works. But i can place another turret over it - wrong

Here ist the "code":

Image

I tried "Curser is not overlapping turret1" but doesnt helped me. I dont have a clue whats the Problem, plz help me.
________________________________________________________________________________

There is another Problem with the tutorial from Geometrix (sry for the bad words). There is a rule that a tower only searchs target if placed ("not Floating) via boolean instance variable. It works for the first turret. If first turret is placed, second turrets shoots when "floating". I have the same problem. Maybe anyone can fix this Problem?

Thank you!
You do not have the required permissions to view the files attached to this post.
Last edited by McBuzzzy on Sat Aug 30, 2014 10:16 pm, edited 1 time in total.
B
7
Posts: 16
Reputation: 315

Post » Sat Aug 30, 2014 12:13 pm

Maybe someone does anything similar with other Events? Any Idea for a workaround would be nice too.
B
7
Posts: 16
Reputation: 315

Post » Sat Aug 30, 2014 9:01 pm

@McBuzzzy

Try replacing the TiledBackground you build on with a Sprite and give it a boolean Instance Variable called Occupied that starts as false, when you go to build check that variable and set it to true once built.

As an example I've edited your capx giving the TiledBackground the variable and you'll see you can only build one turret on each TiledBackground instance.

TD_001.capx


Edit: Just changed it to fix the floating shooter issue

Set the Turret behaviour's Initial State to Disabled on the pre-placed turrets on the layout (so it's the default value for created turrets), and set it to Enabled once it's placed.
You do not have the required permissions to view the files attached to this post.
Last edited by OddConfection on Mon Sep 01, 2014 8:44 am, edited 1 time in total.
Vote for all the Construct 2 games on Steam Greenlight - Find them here
B
33
S
9
G
7
Posts: 450
Reputation: 6,778

Post » Sat Aug 30, 2014 10:10 pm

Thanks u did it!

It was so easy... but it didnt come into my mind :)

Thank u alot!
B
7
Posts: 16
Reputation: 315


Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, guannstar, marcinkowski, Yahoo [Bot] and 23 guests