Page 1 of 1

[solved] Homing projectiles problem

Posted: Wed Aug 24, 2016 10:47 pm
by apriori
How to avoid projectiles from spitters and worms? If I teleport an entity away from enemy's attack range, their "bullets" still persecute entity. How to make them miss an entity?

Re: Homing projectiles problem

Posted: Wed Aug 24, 2016 11:13 pm
by Supercheese
Hmm... temporarily set the entity to destructible = false?

Re: Homing projectiles problem

Posted: Wed Aug 24, 2016 11:43 pm
by Nexela
Total assumption here but if projectiles are entities destroy the projectile entity if it gets too close to the target entity?

Re: Homing projectiles problem

Posted: Thu Aug 25, 2016 8:40 am
by apriori
Do you guys answer my question or you ask your own ones? :lol: Each "answer" ends with question mark.

Re: Homing projectiles problem

Posted: Thu Aug 25, 2016 8:45 am
by Nexela
apriori wrote:Do you guys answer my question or you ask your own ones? :lol: Each "answer" ends with question mark.
both.. Maybe?

:)

Re: Homing projectiles problem

Posted: Thu Aug 25, 2016 8:51 am
by BlakeMW
There's a bulldozer mod which has a bulldozer blade which "eats" projectiles, might be useful.

Re: Homing projectiles problem

Posted: Thu Aug 25, 2016 9:15 am
by apriori
BlakeMW wrote:There's a bulldozer mod which has a bulldozer blade which "eats" projectiles, might be useful.
Nexela wrote:Total assumption here but if projectiles are entities destroy the projectile entity if it gets too close to the target entity?
Yes, it's entities.

Code: Select all

blockprojectiles = function(self,pos, area)
    for _, entity in ipairs(game.surfaces[1].find_entities_filtered{area = area, name="acid-projectile-purple"}) do
      entity.destroy()
    end
  end
Thanks.