0 Favourites

(solved) Placing turret not over other turret

  • 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":

    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!

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • Maybe someone does anything similar with other Events? Any Idea for a workaround would be nice too.

  • 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.

    [attachment=0:2psptj6s][/attachment:2psptj6s]

    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.

  • Thanks u did it!

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

    Thank u alot!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
378 33,279
part12studios's avatar
part12studios
Unread hot topic Locked topic
115 17,218
Kyatric's avatar
Kyatric Construct Team Support
Unread sticky
83 102,312
gamearcad's avatar
gamearcad