Page 1 of 1
Widget Request/(later)Reveal: Radar&Jammer vehicle follow.
Posted: 14 Jul 2008, 23:14
by Pendrokar
What I want is that when I order some group of units to Fight.. the units without weapons that is radar and jammer vehicles/kbots would follow(guard) units with the longest range.
Not that hard to do. Most likely I will do it after a while. But someone might do it more professionally.
Re: Widget Request/(later)Reveal: Radar&Jammer vehicle follow.
Posted: 15 Jul 2008, 04:35
by REVENGE
Hell, I'd be happy if they fixed stupid radar/jammer behavior: walking into a firefight with nothing but a radar dish.
Re: Widget Request/(later)Reveal: Radar&Jammer vehicle follow.
Posted: 15 Jul 2008, 08:37
by Hoi
REVENGE wrote:Hell, I'd be happy if they fixed stupid radar/jammer behavior: walking into a firefight with nothing but a radar dish.
Re: Widget Request/(later)Reveal: Radar&Jammer vehicle follow.
Posted: 15 Jul 2008, 09:49
by Pressure Line
iirc thats because BA jammers and radar vechs/bots have fake weapons (for whatever reason, damned if i know) this causes them to leap into the fray. id suggest putting them on hold-fire
Re: Widget Request/(later)Reveal: Radar&Jammer vehicle follow.
Posted: 15 Jul 2008, 10:07
by Hoi
Pressure Line wrote:iirc thats because BA jammers and radar vechs/bots have fake weapons (for whatever reason, damned if i know) this causes them to leap into the fray. id suggest putting them on hold-fire
what about canattack=0? i dont know if they will still be able to use radar/jammer but if they can then it would be a good idea(going to test....)
Re: Widget Request/(later)Reveal: Radar&Jammer vehicle follow.
Posted: 15 Jul 2008, 20:29
by KDR_11k
The dummy weapons are so they'll stop when given a fight command instead of ignoring enemies and just marching forward.
Re: Widget Request/(later)Reveal: Radar&Jammer vehicle follow.
Posted: 16 Jul 2008, 08:53
by Hoi
KDR_11k wrote:The dummy weapons are so they'll stop when given a fight command instead of ignoring enemies and just marching forward.
but when you use attack, they just rush in the enemy, thinking that ther radar beams can kill the enemy or something
Re: Widget Request/(later)Reveal: Radar&Jammer vehicle follow.
Posted: 16 Jul 2008, 14:50
by ginekolog
I use this widget so jamers dont charge enemeis:
unit_dontmove.lua
Re: Widget Request/(later)Reveal: Radar&Jammer vehicle follow.
Posted: 16 Jul 2008, 18:33
by Pendrokar
BTW does anyone think that this widget should work on moving order too?
Re: Widget Request/(later)Reveal: Radar&Jammer vehicle follow.
Posted: 16 Jul 2008, 18:58
by Pxtl
Hoi wrote:KDR_11k wrote:The dummy weapons are so they'll stop when given a fight command instead of ignoring enemies and just marching forward.
but when you use attack, they just rush in the enemy, thinking that ther radar beams can kill the enemy or something
Perhaps the range of the fake weapon is too short, or an LOS weapon? If it was slightly longer than arty range, they'd park outside of arty radius of their chosen impossible target.
I just wish there was a way to order a unit to maintain a minimum distance to target instead of a maximum one.
How about a Group Guard widget? That is, select group A and order it to guard all units in group B. They get a queue of guard orders that starts with a random unit and then continues to the next random unit in the group, so that if it dies. Wouldn't be useful for some things, but for basic radar-follow behaviour it would help - move your arty units into a group, order radars to group-guard the arties. I do this often with flakkers and my slowest units in a team, but usually I just task them all to one unit, so when it dies they all get lost.
Re: Widget Request/(later)Reveal: Radar&Jammer vehicle follow.
Posted: 16 Jul 2008, 20:24
by Pendrokar
Pxtl wrote:
How about a Group Guard widget? That is, select group A and order it to guard all units in group B. They get a queue of guard orders that starts with a random unit and then continues to the next random unit in the group, so that if it dies. Wouldn't be useful for some things, but for basic radar-follow behaviour it would help - move your arty units into a group, order radars to group-guard the arties. I do this often with flakkers and my slowest units in a team, but usually I just task them all to one unit, so when it dies they all get lost.
Well I ain't signing for that!
[EDIT] Though your idea actually isn't that hard to implement.

But I don't know how to make a right interface for group to group guarding. Then again the Group Label/Grouping or what the widget was called with the 1/2/3/4... groups at a side bar would be useful.
Re: Widget Request/(later)Reveal: Radar&Jammer vehicle follow.
Posted: 17 Jul 2008, 09:34
by CarRepairer
Retreat + Autoretreat widgets in CA. Radar and jammer vehicles are automatically set to retreat at 90% health. If something dents them, they turn and run home.
Re: Widget Request/(later)Reveal: Radar&Jammer vehicle follow.
Posted: 17 Jul 2008, 10:55
by Hoi
CarRepairer wrote:Retreat + Autoretreat widgets in CA. Radar and jammer vehicles are automatically set to retreat at 90% health. If something dents them, they turn and run home.
fail they die before they retreated
Re: Widget Request/(later)Reveal: Radar&Jammer vehicle follow.
Posted: 22 Jul 2008, 11:46
by Pendrokar
This is how far I've gotten (non-Group Guard version)-
Code: Select all
local radarunitSet = {}
local jammerunitSet = {}
local unitArray = {}
unitArray["radarunitArray"] = {
--radar units
-----BA-----
"armseer",
"armmark",
"corvrad",
"corvoyr",}
unitArray["jammerunitArray"] = {
--jammer units
-----BA-----
"armaser",
"coreter",
"arm_jammer",
"core_spectre",
"armsjam",
"corsjam",}
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
function widget:Initialize()
if Spring.GetSpectatingState() or Spring.IsReplay() then
widgetHandler:RemoveWidget()
return true
end
for i, v in pairs(unitArray["radarunitArray"]) do
radarunitSet[v] = true
end
for i, v in pairs(unitArray["jammerunitArray"]) do
jammerunitSet[v] = true
end
end
function widget:CommandNotify(commandID, params, options)
local selUnits = Spring.GetSelectedUnits()
local count = #selUnits
table.foreachi(options,Spring.Echo)
if (count>1) and (commandID == CMD.FIGHT) then
local radarunittable = {}
local jammerunittable = {}
local offensiveunittable = {}
local countradars = 0
local countjammers = 0
local countoffensive = 0
for k,unitID in pairs(selUnits) do
local udef = Spring.GetUnitDefID(unitID)
local ud = UnitDefs[udef]
if (ud ~=nil) and (radarunitSet[ud.name]) then
--radar unit
countradars = countradars + 1
radarunittable[countradars] = unitID
elseif (ud ~=nil) and (jammerunitSet[ud.name]) then
--jammer unit
countjammers = countjammers + 1
jammerunittable[countjammers] = unitID
elseif (ud ~= nil) then
--other unit
local wd = ud.weapons[1]
if (wd ~= nil) then
local weaponDefID = wd.weaponDef
if (weaponDefID ~= nil) then
--offensive unit
if (WeaponDefs[weaponDefID].range ~= nil) then
table.insert(offensiveunittable,{ unitID, WeaponDefs[weaponDefID].range })
--Spring.Echo("U:",unitID,WeaponDefs[weaponDefID].range)
end
countoffensive = countoffensive + 1
end
end
end
end
if((countradars ~= 0) or (countjammers ~= 0)) and (countoffensive ~= 0) then
local aradar = 1
local ajammer = 1
table.sort(offensiveunittable, compRanges) --reversed sorting, compRanges is a function
for i in ipairs(offensiveunittable) do
unitID = offensiveunittable[i][1]
range = offensiveunittable[i][2]
if(aradar<countradars+1) then
Spring.GiveOrderToUnit(radarunittable[aradar], CMD.GUARD, {unitID},options)
--Spring.Echo("R",radarunittable[aradar], unitID)
aradar = aradar + 1
end
if(ajammer<countjammers+1) then
Spring.GiveOrderToUnit(jammerunittable[ajammer], CMD.GUARD, {unitID},options)
--Spring.Echo("J",jammerunittable[ajammer], unitID)
ajammer = ajammer + 1
end
-- issue called command
Spring.GiveOrderToUnit(unitID, commandID, params, options) -- for offensive units to move on with their order
-- if radars and jammers are more than offensive units they will still go forth with fight order
end
-- Override command issue process
return true
end
end
return false
end
function compRanges(a,b)
return a[2] > b[2]
end
Problems - Well it kinda works except that queue commands dont! So the offensive units just move on with the last command.
And the radars and jammers will stop if the unit they follow dies. (just haven't added)
Re: Widget Request/(later)Reveal: Radar&Jammer vehicle follow.
Posted: 22 Jul 2008, 12:47
by Hoi
@pendrokar
i might be wrong, but if you just add canattack=0 to the radars/jammers fbi they wont attack but wait, however this is a solution that creates other problems it would be best if the jammers stay in jamming range but dont attack and the radars in x radar range
Re: Widget Request/(later)Reveal: Radar&Jammer vehicle follow.
Posted: 22 Jul 2008, 14:58
by Pendrokar
Hoi wrote:@pendrokar
i might be wrong, but if you just add canattack=0 to the radars/jammers fbi they wont attack but wait, however this is a solution that creates other problems it would be best if the jammers stay in jamming range but dont attack and the radars in x radar range
Im not a dev of either BA, CA or NOTA(doubt other mods have set radars and jammers like that). So I'm the wrong person to whom you should say that. The radar and jammer guarding issue is a mods issue.
Re: Widget Request/(later)Reveal: Radar&Jammer vehicle follow.
Posted: 22 Jul 2008, 16:51
by Hoi
Pendrokar wrote:Hoi wrote:@pendrokar
i might be wrong, but if you just add canattack=0 to the radars/jammers fbi they wont attack but wait, however this is a solution that creates other problems it would be best if the jammers stay in jamming range but dont attack and the radars in x radar range
Im not a dev of either BA, CA or NOTA(doubt other mods have set radars and jammers like that). So I'm the wrong person to whom you should say that. The radar and jammer guarding issue is a mods issue.
i was just suggesting and if it would work i will ask the mod devs to add it
Re: Widget Request/(later)Reveal: Radar&Jammer vehicle follow.
Posted: 25 Jul 2008, 10:46
by yuritch
Fake weapons on radar units are leftovers from OTA times. Back then the AI didn't know how to use radar units, so they were often given a fake long-range weapon by modders to make the AI bring them closer to battle.
Re: Widget Request/(later)Reveal: Radar&Jammer vehicle follow.
Posted: 05 Aug 2008, 23:21
by Pendrokar
Ok I uploaded a 0.8 version at Spring Job Jol.
-
http://spring.jobjol.nl/show_file.php?id=1294
When ordering a group of units to fight, Any specified in the widget mobile radars or jammers will guard units that have the
longest range. If radars or jammers are more than other units then those will still go with the fight order,
Improvements
needed:
1) After having the Fight order pressed with shift the Fight cursor will change to Move! Need to fix
2) Radars and
Jammers to follow closest units that have the longest range. Right now they will guard a random unit withing the unit range
sort(Means even if there is a unit with the longest range in the group close to a radar unit the radar unit may guard some
other unit).
Re: Widget Request/(later)Reveal: Radar&Jammer vehicle follow.
Posted: 28 Sep 2008, 15:14
by Pendrokar
2) issue fixed. Though the offensive units are the ones making decisions of which closest radar/jammer to take!
-
http://spring.jobjol.nl/show_file.php?id=1294
When ordering a group of units to fight, Any specified in the widget mobile radars or jammers will guard units that have the
longest range. If radars or jammers are more than other units then those will still go with the fight order,
Improvements needed:
1) After having the Fight order pressed with shift the Fight cursor will change to Move! Need to fix