How do I make variables and logic based on individual instances?

0 favourites
  • 4 posts
From the Asset Store
100 items casual and logic games. All icons are of a high quality.
  • Hey!

    I'm new to Construct and I've been having an issue with LOS and instance variables in a tank game I'm making.

    To put it short, if a tank see's you, a counter will start and when it reaches a certain value, it shoots and resets. I intended for it to not reset after it doesn't have LOS of the player tank anymore.

    The problems I'm having are:

    a) All of the tanks shoot when the counter is reached. I intended for each tank to have it's own counter and shoot individually.

    b) When only one tank has LOS, all of them look at you and they all start counting, even if there is a solid wall between you and the tank.

    I've tried using While, For each tank, disabling things that might conflict with each other and a couple more things, but they don't work. If I could have some help, I'd greatly appreciate it :)

    Game link:

    drive.google.com/file/d/1OJcNFhnqL69nDbmHO9Gp0pqrM7A0F8oR/view

  • I forgot to add, in the project go to "Level 1" and click play.

  • The problem is with the YellowTurret which doesn't associate to it's parent, the YellowTank. Look at event 3 there is no filter to pick which turret is own by a tank. The solution is to put the turret as container of the tank. By doing this you don't need to add extra condition nor action.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The problem is with the YellowTurret which doesn't associate to it's parent, the YellowTank. Look at event 3 there is no filter to pick which turret is own by a tank. The solution is to put the turret as container of the tank. By doing this you don't need to add extra condition nor action.

    Thanks!!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)