Potzero's Forum Posts

  • 11 posts
  • zatyka

    Thanks for the capx with your examples on moving an object or series of objects through an array. I implemented your design into my tower defense game as well, however, since I am new to construct 2 and programming in general, how do I call other objects to follow the saved path? Say you wanted hero1 and hero2 to both follow the path, but only hero1 to find the path. Do I copy all the events and just change hero1 to hero2? or is there an easier way. Any input or an example capx would be helpful. Thanks in advance.

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

  • my issue in the capx below is that when I place multiple pea shooter turrets and then try to upgrade them, they do not work properly. If I upgrade the first turret, it works fine. When I place more than one turret, I must upgrade the first, but then all turrets of the same type get the upgrade. (The upgrade is bullets that hit one hp harder). Any help on separating the upgrades so that each turret gets its own upgrade would be helpful, thanks.

    I've tried pick IID and UIDs but couldn't get any of it to work so I deleted all those commands.

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

  • I have been struggling with a pathfinding issue for days now. If you have played fieldrunners 2 or are familiar with tower defense games, I am trying to implement a feature which allows the player to place walls (named dogwall in game) to manipulate the enemies path. However, placement of the wall in the path sometimes prevents any enemies from moving at all or sometimes destroys all walls. Most of the dogwall functioning code is in event sheet "L1-1". The placement and HUD elements are in the event sheet "turrets". I have looked all through the faq and tried numerous attempts to get the code right. I did not leave all the attempts as the event sheet was getting very disorganized. As I am still learning, I am becoming frustrated. Any help or insight into the issue would be appreciated. The capx link is below. Thanks in advance.

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

  • Paradox, that was the first option I tried, but the enemy will not rotate as a turret and move along a path (while pathfinding) at the same time.

  • I am creating a tower defense game where the enemies shoot back at the turrets. I have spent multiple hours and tried multiple setups of code and none will perform the desired task. I have used the "pick nearest" command to target a box, and the box is always fixed on a turret. However, when the turret is destroyed (along with the box), the enemies fire at the second placed turret instead of the next CLOSEST turret. I can't find where I'm going wrong. If anyone has the time to look at this and lend advice I'd greatly appreciate it.

    The specific lines of code are at the bottom of the L1-1 Event Sheet.

    Here is the capx:

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

    If you run the layout, click the texts on the right to spawn a turret and the other icons are self explanatory.

    Thanks to anyone who has the time.

  • Thanks for the responses.

    Sulli -- that was a good sample. I liked the pick nearest command event. Didn't even know about that one. Thanks.

    pseudotropheus -- I apologize I missed it the first time, but your suggestion was right. It's hard for me to believe that a simple fix like that was all it took. I tried all kinds of things with UIDs and IIDs earlier, but moving the triggers to turret shooting event worked. Thanks so much!

  • Thanks for the responses.

    Sulli -- I have checked that list, but will check again for a solution.

    pseudotropheus -- thanks, that was an error on my part. I fixed some code and updated the capx. I still have the same problem unfortunately. Three bullets are supposed to come out of each spread turret, which does happen, tho after the first turret, the rest of the bullets are taking the first turrets' bullets' path. I cannot seem to get the code to set up separate paths for each series of bullets. I did create a container for each series of bullets to make it easier, but it didn't help the angle/direction problem.

    Heres the updated capx.

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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi peeps. I need some help and a fix for my issue. Im trying to learn the programming to make a tower defense game. As it stands, I want the "Spread" turret to shoot 3 bullets. However, if you place multiple Spread turrets, the other bullets refer to the 1st turret's angle. I do not know the correct commands to set it up so the bullet go in the correct direction. I currently have it set up so two bullets are 20 degrees offset from the middle. If there are some experienced construct 2 users, any help in this issue would be greatly appreciated. Thanks. Here is the capx.

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

  • thanks Jay, but unfortunately the capx is in version 120. i only have 119. is there a way you upload in this format? i appreciate it.

  • can someone please post a capx of this with multiple health bars...I am fairly new and I cant seem to get it working. thanx.

  • 11 posts