Detection of clear firing lines

Detection of clear firing lines

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
jseah
Posts: 42
Joined: 10 Jun 2008, 03:28

Detection of clear firing lines

Post by jseah »

From the ZK forum AA micro thread: http://zero-k.info/Forum/Thread/1076
I'm now considering the problem of firing lines.
Basically, I have no easy way of detecting if a tower can fire at a certain unit or if an ally/hill is in the way.
Spring engine does it apparently, since towers on fire at will always shoot if there is an unobstructed target, no matter how many obstructed ones there are.
You can easily show that this behaviour exists since spring can tell an LLT to shoot a peewee that can be shot, instead of shooting the peewee that's blocked by a cliff. (replace peewee with glaive if you're ZK)

Is there an easy way to call that function as a Lua Gadget? (ideally, I'd like a function that returns if a tower can fire at a certain point in space, which certainly does get a check since you can order towers to fire at spots they can't reach and they won't open fire...)
Post Reply

Return to “Lua Scripts”