#Sniper fight command
1 messages · Page 1 of 1 (latest)
can you please provide a replay?
You have manuver/roam enabled and Mammoth is retreating?
Standard behaviour is to 'chase' a retreating unit to keep it in range.
Hold pos fixes your issue.
You can have different move states per unit type. Type /widgetselector and filter 'pref states' make that green, then click sniper and ctrl-click manuver/roam to hold pos, you now made snipers permanently hold pos when been built.
is that not in game settings
if so never ever tell people to go to /widgetselector
as they may brick something\
Ive not seen it in settings at least. But ya you can ctrl-click manuver/roam first and see if text pops up at the top saying its been changed. If it does pref states already enabled.
thats a bug report then
widget selector has resulted in a number of people bricking something in their game
which is why i gave the warning
Fair fair ure right
There is also a setting 'default units to hold pos' or something like that, which makes all ground unit buildings set to hold pos and units being built copies this state.
Set a reminder in 10 hours from now (<t:1724081291:f>)
View reminders with the reminders command
Reminder for @stuck plank
bug report this
roughly 29 mins into this replay: https://bar-rts.com/replays/eebcc266541f66d32f95fdc9baffbcf5
Live, dynamic data such as replays, leaderboards and live battles for the RTS game Beyond All Reason
I'm not sure why they defaulted to hold fire, but i had target set on all the mammys and used fight command and they just kept walking
Its hold pos that stops em from moving on their own
they we on hold pos and hold fire. But I did set target on mammys then used fight command behind the mammys thiinking they'd chase but stop if in range to shoot
https://youtu.be/HMrB_IlaRUI
Relevant moment from that replay.
That's not what I expected to happen with those commands too.
anything on hold fire does that
its a feature probablyt
Ya drivver is right, hold fire + fight command is simply a move command, set target doesnt make units pause in range
Fire at will + set target (priority targets) + hold pos + fight command
I understand you wanna have a smart AI here not firing ticks, but that would make snipers very strong.
when you tell something to fight, it should override hold fire and fight
or at least stop where it would have otherwise stopped
I do think fight command should be consistent regardless of firing states, but alas
this may be part of my larger frustration with hold fire seemingly randomly engaged on different units like janus and sniper. I want fire at will on all units always and not sure there's a simple way to default that. I can still make snipers fairly op by targeting units when on fire at will
but thanks all for looking into this
Floris has enlightened me before
function widget:GetInfo()
return {
name = "Auto Fire at Will",
desc = "Automatically sets all units to fire at will mode",
author = "YourName",
date = "2024-08-19",
license = "GPLv2",
layer = 0,
enabled = true -- loaded by default?
}
end
local spGetMyTeamID = Spring.GetMyTeamID
local spGetTeamUnits = Spring.GetTeamUnits
local spGiveOrderToUnit = Spring.GiveOrderToUnit
local CMD_FIRE_STATE = CMD.FIRE_STATE
function widget:UnitCreated(unitID, unitDefID, teamID)
local myTeamID = spGetMyTeamID()
if teamID == myTeamID then
spGiveOrderToUnit(unitID, CMD_FIRE_STATE, {2}, 0)
end
end
function widget:UnitGiven(unitID, unitDefID, oldTeamID, newTeamID)
local myTeamID = spGetMyTeamID()
if newTeamID == myTeamID then
spGiveOrderToUnit(unitID, CMD_FIRE_STATE, {2}, 0)
end
end
function widget:GameFrame(frame)
if frame % 30 == 0 then -- Check every second (30 frames)
local myTeamID = spGetMyTeamID()
local units = spGetTeamUnits(myTeamID)
for _, unitID in ipairs(units) do
spGiveOrderToUnit(unitID, CMD_FIRE_STATE, {2}, 0)
end
end
end
looks alright from a glance
that's insane - so how do I use that
#❓|how-to-install-mods message
once you verify it works (because I didn't aside from reading it), post it in #1113845509891829810 , because those are the rules.
Sorry last q - how to turn that code into a lua file