Help: pathfinding and picking nth instance

0 favourites
  • 1 posts
From the Asset Store
Units do not overlap each other and use different ways if there are several free ways.
  • I am making a turret defense game where players can place a wall to make the enemies walk further. However, when I want to delete a specific instance that blocks the enemies' path entirely, all the commands I have tried destroy all instances of the wall instead of the one right in the path. I am still learning the C2 language and do not have the best organizational/grouping skills with the language either. I've spent hours trying different options, downloading other examples, looking at suggestions on the forums, and nothing has worked, which leads me to believe this is a pathfinding issue and not a pick instance issue.

    The method that I have made the most progress with is to create a global number that ticks everytime a wall is made along with and ID for each instance of a wall. Then I pick the last instance that was made and destroy.

    See image below.

    NumberOfDogwalls is the instance ID and NumberOfDogwallsGlobal is the global counter.

    The specific code I am referring to is at the bottom of the L1-1 event sheet. The capx link is below. Again, any help with this issue would be greatly appreciated. Thanks.

    dl.dropboxusercontent.com/u/103925639/CAPx/TDW.capx

    <img src="https://dl.dropboxusercontent.com/u/103925639/CAPx/Untitled.png" border="0" />

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)