Hi,
I'd like to create a turret / Artillery that can only fire at spawners. (So not enemy units)
How would I go about accomplishing this?
Thanks.
Thanks.
Only Fire on/Target Spawners
Re: Only Fire on/Target Spawners
Still need some help here please.
If it's not possible to just target spawners, would it be possible to make it so that the turret can't be placed if there is no spawner in the firing range?
Order of preference:
1 - can only fire at Spawners.
2 - can't be placed, unless there is a spawner in range of were you want to place it.
3 - you can place it, but the range will be 0 and you'll get a message saying there was no spawner in range. (Something like: "You need a spawner in range to calibrate firing, as a result your turret rage is 0"
I think option 3 is relatively easy (To a programmer), Just a test to see if there is a spawner in rage, something to do with find entity filter blah blah blah...
I'd appreciate the help!
Thanks.
If it's not possible to just target spawners, would it be possible to make it so that the turret can't be placed if there is no spawner in the firing range?
Order of preference:
1 - can only fire at Spawners.
2 - can't be placed, unless there is a spawner in range of were you want to place it.
3 - you can place it, but the range will be 0 and you'll get a message saying there was no spawner in range. (Something like: "You need a spawner in range to calibrate firing, as a result your turret rage is 0"
I think option 3 is relatively easy (To a programmer), Just a test to see if there is a spawner in rage, something to do with find entity filter blah blah blah...
I'd appreciate the help!
Thanks.
Re: Only Fire on/Target Spawners
How would 3 then shoot the spawner (and not a biter that is likely nearer)? Only idea I have is to fake it entirely since your talking about a small number of turrets, projectiles and targets. Make a non-turret building, then write a lua script to spawn "bullet" entities above your turret object that moves towards the nearest spawner, at which point delete the bullet entity and damage the spawner.
I created a thread for Turret targeting API yesterday, this would be another use case.
I created a thread for Turret targeting API yesterday, this would be another use case.
Re: Only Fire on/Target Spawners
You're right, option 2 & 3 will both be able to target units. My workaround would have been to make the projectiles go very slow. So units wold be missed, but stationary targets like spawners would eventually be hit. Not ideal, but...that's what you get when you cant get option 1SyncViews wrote:How would 3 then shoot the spawner (and not a biter that is likely nearer)?
Interesting idea. Will have to think how to write this code.SyncViews wrote:Only idea I have is to fake it entirely since your talking about a small number of turrets, projectiles and targets. Make a non-turret building, then write a lua script to spawn "bullet" entities above your turret object that moves towards the nearest spawner, at which point delete the bullet entity and damage the spawner.
Re: Only Fire on/Target Spawners
I don't think slow projectiles will work. I am pretty sure that all projectiles are homing and will exceed the max range if the unit moves away. Also the game tracks how much damage it expects an entity to take, so once a biter has a slow "death orb" chasing it, no other turret will shoot that biter (which also prevents thing like shotgun turrets really working, because the expected damage calculation is wrong).
Re: Only Fire on/Target Spawners
You don't make it a turret. Just create a box and intermittently check whether it's time to shoot and use other entities to play animation and spawn projectiles with lua. It's not like all that will burden the game engine much since it don't really need to be checked often.
I do mods. Modding wiki is friend, it teaches how to mod. Api docs is friend too...
I also update mods, some of them even work.
Recently I did a mod tutorial.
I also update mods, some of them even work.
Recently I did a mod tutorial.
Re: Only Fire on/Target Spawners
You make it sound so easy... and for you it probably is just basic code!Adil wrote:You don't make it a turret. Just create a box and intermittently check whether it's time to shoot and use other entities to play animation and spawn projectiles with lua. It's not like all that will burden the game engine much since it don't really need to be checked often.
I get the don't use turret, container switch-out. Speedy Brain's Supreme Warfare does something like that.
So I guess what's needed is a search for spawner in radius every x ticks and if found send a projectile to it...
Still could use some help to actually accomplish this