Hard, hard problem.

This forum is currently in read-only mode.
From the Asset Store
Dynamic heavy and powerful hard rock tracks. 15 tracks, loops and more.
  • In my TD, you can place multiple turrets with different rate of fire/damage to kill the enemies. To attack, my event is like this.

    ---

    When turret[turret behavior] has target

    + Every turret[rate of fire]

    = Shoot "Bullet" toward enemy

    = Bullet[damage]=turret[damage]

    ---

    In this way, when the first turret attacks, and there's another near, and they have both the same target, the second turret mimics the first turret's rate of fire.

    I know the problem, Construct thinks that if two turrets have the same object as a target, they both shoot with the rate of fire of the first turret that saw the enemy.

    It's hard to explain, and I don't want to distribute the game yet. Can someone PM me, and request the .cap, if possible? Or else, if you get what I mean with this thread, post here.

  • Why don't you use the Turret movement's rate of fire feature? Set the rate of fire in milliseconds in the properties, and use the 'On Shoot' trigger to fire a bullet. This keeps the reload time independently for each turret saving you Every conditions and problems like these.

  • Yay, thanks!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Umm... After a few tries, there's still the same problem... How can I fix it?

  • They shouldn't do, each turret is storing an independent timer. Can you make an example .cap?

  • They shouldn't do, each turret is storing an independent timer. Can you make an example .cap?

    I can't reproduce it in another cap. In my TD, if I use the debugger, though, the values are always what they should be!

    Reload time is always 2 seconds, even if the turret shoots every 0.10 seconds!

  • Crap you beat me to replying.

    Anyhow, if the variables are different then that means theres something wrong with your events. You may have to loop through each turret and tell each individual one to shoot, as you may be getting the problem that one turret is using another's variable. Thus it could be a selection problem

    Anyhow, its REALLY not that hard a problem to fix

  • Crap you beat me to replying.

    Anyhow, if the variables are different then that means theres something wrong with your events. You may have to loop through each turret and tell each individual one to shoot, as you may be getting the problem that one turret is using another's variable. Thus it could be a selection problem

    Anyhow, its REALLY not that hard a problem to fix

    How to loop through all the turrets?

  • You shouldn't have to do anything like that. Each turret keeps its own timer and fires at an independent rate, like in the RTS tech demo. Therefore, either a bug exists in the Turret behaviour, or something in your events is specifically breaking that. I suspect the latter since you can't reproduce it; if you simply spawn a bullet in an 'On Shoot' trigger, it will work fine, is that what you're doing?

    For the record, though, you can loop through objects with 'For Each'.

  • You shouldn't have to do anything like that. Each turret keeps its own timer and fires at an independent rate, like in the RTS tech demo. Therefore, either a bug exists in the Turret behaviour, or something in your events is specifically breaking that. I suspect the latter since you can't reproduce it; if you simply spawn a bullet in an 'On Shoot' trigger, it will work fine, is that what you're doing?

    For the record, though, you can loop through objects with 'For Each'.

    It's probably my fault, but I can't find the cause of the problem.

    Here's the full cap.

    http://upload.namelezz.net/downloader.php?file=td16.cap

  • I looked through the cap for like an hour, but couldn't find anything. I tested stuff, I did lots of changes, but the problem is still there

  • I can't do anything about it. Debugging it reveals that the reload times and the variables are right, but the last placed turret shoots like the first placed one! I think it's Construct's fault, and my .cap could even be bugged D:

  • There's no way to fix this!

    If I do like this :

    ---

    Every Turret('Rate') ms = Shoot Stuff

    ---

    The turrets shoot at the same rate, because they're istances, not different objects.

    =======

    If I do like this :

    ---

    Turret, On Shoot = Shoot Stuff

    ---

    Construct doesn't recognize the istances, instead, when a turret shoots, the others do the same thing!

    I can't fix it, unless you suggest me a workaround, or Ashley makes the Turret behavior istance-friendly.

  • D:

    That sucks :/

  • Just a quick update, turns out there is in fact a Construct bug causing this, and it is on the mend. Hopefully fixed for next build.

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