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.
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
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....)
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.
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.
Last edited by Pendrokar on 17 Jul 2008, 16:23, edited 1 time in total.
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.
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.
This is how far I've gotten (non-Group Guard version)-
Code:
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)
@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
@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.
@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
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.
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).
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
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum