Gadget: Area Attack for ground units

Gadget: Area Attack for ground units

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

Moderator: Moderators

User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Gadget: Area Attack for ground units

Post by KDR_11k »

This gadget allows adding an area attack command to ground units. It's mostly intended for using artillery to attack suspected enemy positions outside of LOS and hitting a wide area without requiring the arty to have inaccuracy.

For a unit to get the command you have to add

Code: Select all

[customParams] {
    canAreaAttack=1;
}
to the unit's FBI.
Attachments
areaattack.zip
Updated for some minor changes
(868 Bytes) Downloaded 41 times
Last edited by KDR_11k on 26 Jan 2008, 19:43, edited 1 time in total.
ZellSF
Posts: 1187
Joined: 08 Jul 2006, 19:07

Re: Gadget: Area Attack for ground units

Post by ZellSF »

So without lua, bombers are hardcoded to the the only units to have area attack? I've always figured artillery not having area attack was intentional...
User avatar
lurker
Posts: 3842
Joined: 08 Jan 2007, 06:13

Re: Gadget: Area Attack for ground units

Post by lurker »

Is this a gadget with an fbi tag so it doesn't get spammed on units that would look stupid area attacking or other practical reason, or because you think it shouldn't be a widget? Because all I need to set up a manual area attack is 5-10 seconds of completely brainless micro.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Gadget: Area Attack for ground units

Post by KDR_11k »

It could be a widget but 1. I'm not good at widgets :P and 2. Area Attack really doesn't make sense on most things.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Gadget: Area Attack for ground units

Post by Argh »

Thanks much, I will use this.
User avatar
LOrDo
Posts: 1154
Joined: 27 Feb 2006, 00:21

Re: Gadget: Area Attack for ground units

Post by LOrDo »

Cool! Im hoping this gets implemented, always thought more units should have area attack...
User avatar
NOiZE
Balanced Annihilation Developer
Posts: 3984
Joined: 28 Apr 2005, 19:29

Re: Gadget: Area Attack for ground units

Post by NOiZE »

Thanks!
[Krogoth86]
Posts: 1176
Joined: 23 Aug 2007, 19:46

Re: Gadget: Area Attack for ground units

Post by [Krogoth86] »

Nice! Will try it out right now... :-)
smokingwreckage
Posts: 327
Joined: 09 Apr 2005, 11:40

Re: Gadget: Area Attack for ground units

Post by smokingwreckage »

This totally makes sense for artillery.
[Krogoth86]
Posts: 1176
Joined: 23 Aug 2007, 19:46

Re: Gadget: Area Attack for ground units

Post by [Krogoth86] »

It still has a problem though. When you go ahead and make your area attack circle and then the mechanism chooses a point which is out of range (what can happen as you don't see the max range when drawing the circle) the unit doesn't try to close in but just holds its position with an attack order it can't complete and does nothing...

At least that's a situation I had - didn't try to reproduce it yet...
User avatar
NOiZE
Balanced Annihilation Developer
Posts: 3984
Joined: 28 Apr 2005, 19:29

Re: Gadget: Area Attack for ground units

Post by NOiZE »

[Krogoth86] wrote:It still has a problem though. When you go ahead and make your area attack circle and then the mechanism chooses a point which is out of range (what can happen as you don't see the max range when drawing the circle) the unit doesn't try to close in but just holds its position with an attack order it can't complete and does nothing...

At least that's a situation I had - didn't try to reproduce it yet...

I did, and indeed the problem occurs :(
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Gadget: Area Attack for ground units

Post by KDR_11k »

Strange, just tested it with a pointer in KP and that thing does close in. Maybe it's because I tested with SVN...

EDIT: Hm, no, works with 76b1 too.
User avatar
NOiZE
Balanced Annihilation Developer
Posts: 3984
Joined: 28 Apr 2005, 19:29

Re: Gadget: Area Attack for ground units

Post by NOiZE »

tried with multiple units?
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Gadget: Area Attack for ground units

Post by KDR_11k »

Yep, works with multiple units too.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Gadget: Area Attack for ground units

Post by Argh »

Tried it out. Works well, very cool. I don't suppose you could make a "line attack" variation, so that people could very deliberately set up barrages to block a chokepoint? That'd be cute...
[Krogoth86]
Posts: 1176
Joined: 23 Aug 2007, 19:46

Re: Gadget: Area Attack for ground units

Post by [Krogoth86] »

Well I now also tried to reproduce it and it worked on the first try. So here comes the video proof (Divx Avi):
http://www.file-upload.net/download-639 ... k.avi.html

You'll see 6 Lugers being given an area-attack order at pretty much their max range (you'll see it in the video). Then you'll see three of em "shut down" with an attack order pretty much exactly at the range border. Well as I still have the raw video in a high resolution here comes a snapshot:
Image

But it becomes even more serious:
When recording (i.e. "playing" this as I taped this from the replay) only two of em dismalfunctioned and it also were different ones. When playing the one to the very left and the one to the very right didn't fire - not so in the replay. This way there have to be some issues. It also is unlikely to be map dependent because I this time chose another map than the one where I noticed it first (-> Charlie in the Hills)...
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Gadget: Area Attack for ground units

Post by Argh »

Hmm. Well, it could get the max ranges of every weapon of every Unit being given the order, and not allow the user to issue a command past the max range of the farthest Unit from the target.

Or, the quick-and-dirty way is to just re-randomize the attack orders faster, and if any Units cannot hit any of the circle at all, then drop them.
[Krogoth86]
Posts: 1176
Joined: 23 Aug 2007, 19:46

Re: Gadget: Area Attack for ground units

Post by [Krogoth86] »

Besides that I think it has to just calculate some random spots to attack and "handle them over" to the engine so that they are constant even in replays. I don't really know how to achieve that but the way it is it's a replay killer as for example a Commander you killed in your game stays alive in the replay causing lots of confusion...
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Gadget: Area Attack for ground units

Post by Argh »

Lol... I brought up this indeterminacy issue awhile back... that's a new wrinkle...
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Gadget: Area Attack for ground units

Post by KDR_11k »

Argh wrote:Hmm. Well, it could get the max ranges of every weapon of every Unit being given the order, and not allow the user to issue a command past the max range of the farthest Unit from the target.

Or, the quick-and-dirty way is to just re-randomize the attack orders faster, and if any Units cannot hit any of the circle at all, then drop them.
You know, I could just tell them to move into range first.

Being able to desync a replay is a SERIOUS issue but AFAIK not the scope of lua, it's probably an engine issue. I wonder what happens if area attack is used online, maybe the lua random function isn't as synced as we thought?

The lock up seems strange to me, what happens if the map is flat (looked to me like they were on a hill)? Can you get the same result with a regular attack order when given to the same position?

EDIT: Updated the gadget to make the units move in range
Attachments
areaattack.zip
(1.01 KiB) Downloaded 35 times
Post Reply

Return to “Lua Scripts”