Page 1 of 1
Can't attack garrisoned unit FIXED
Posted: Thu Jan 27, 2022 10:31 pm
by b2198
So, I'm playing a 4 player FFA match where 2 of the players were kicked (due to being afk for a week or maybe more), and I'm advancing against the remaining player, and in that match I encountered this situation:
Where I just can't attack what's inside the TC, even in the following turn:
My opponent can't make peasants yet (due to research), didn't have a priory, monastery, roman garrison nor any mines, so I don't think it's related to that random unit bug, and that TC got empty a few turns ago after a builder was produced in it, so I have no clue on what could be happening here...
Re: Can't attack garrisoned unit
Posted: Fri Jan 28, 2022 6:19 am
by Endru1241
I encountered the same with map editor unit (couldn't target enemy inside tc) - precisely trainee 2attack - and other 2 units in range didn't have any problems with targeting.
So I was trying to crack why this particular unit cannot attack.
Definitely nothing different with valid targets.
None of AoS units should have any limitations on what they can target (I only used valid targets field for effect applied property changer action jsons), so it's not very unexpected.
But I checked if maybe something could explain the difference.
I haven't found any differences in json.
So something with unit state in game must be the reason.
But I have no idea what.
It's best to find some way this bug could be replicated, because otherwise I have no idea if it could be fixed.
Re: Can't attack garrisoned unit
Posted: Fri Jan 28, 2022 8:47 am
by godOfKings
U can use a spy to search inside the tc and figure out the problem
Re: Can't attack garrisoned unit
Posted: Fri Jan 28, 2022 10:39 am
by Endru1241
godOfKings wrote: ↑Fri Jan 28, 2022 8:47 am
U can use a spy to search inside the tc and figure out the problem
But the problem occurs with the same unit inside TC only for one my units.
I'll try to create situation as identical as possible in map editor, but I am afraid it may be not related to what unit is inside, as two units - one capable of attacking and one not have identical valid targets (none specified, so all normal targets) and specs.
Re: Can't attack garrisoned unit
Posted: Fri Jan 28, 2022 11:47 am
by phoenixffyrnig
Cracked it. It's a stealth unit in the first slot. ie, we are seeing the TC is occupied, but not being able to see the unit to target it
https://ibb.co/QQWPgZs
In these TCs i put a spy, assassin, ranger and ninja inside. Curiously, as an experiment, I put a spearman in the second and fourth TCs behind the stealth unit (the pictured scenario), and it still wouldn't allow any targeting.
Re: Can't attack garrisoned unit
Posted: Fri Jan 28, 2022 11:58 am
by phoenixffyrnig
In fact, further testing shows a mêlée unit adjacent to a TC with a stealth unit in first slot cannot attack either, even though in open play this would reveal the stealth unit.
In other words, what an effective way of defending your TCs... who'd have thought a one turn spy could hold back an army

Re: Can't attack garrisoned unit
Posted: Fri Jan 28, 2022 12:24 pm
by phoenixffyrnig
But it seems that abilities (tested with Cretin archer) can target the stealth unit, so it's not a totally impossible situation to work around until fixed.
They also receive area damage for attacks focused on adjacent tile, so it seems purely to do with them not being registered as a valid target for actions
Re: Can't attack garrisoned unit
Posted: Fri Jan 28, 2022 5:28 pm
by b2198
Oh, nice finding phoenix, I'll try that.
Re: Can't attack garrisoned unit
Posted: Fri Jan 28, 2022 5:59 pm
by godOfKings
Wat if there is enemy scout unit near tc? Will stealth unit still stay invisible and impossible to target inside tc?
Re: Can't attack garrisoned unit
Posted: Fri Jan 28, 2022 6:45 pm
by phoenixffyrnig
Nah, that makes no difference. I guess it needs a unit with the "sees into carriers" tag (or what used to be, it's now "lurks carriers" which isn't correct - to lurk is to hang around in a way that isn't completely hidden but isn't totally obvious either).
Re: Can't attack garrisoned unit
Posted: Fri Jan 28, 2022 7:51 pm
by Endru1241
phoenixffyrnig wrote: ↑Fri Jan 28, 2022 12:24 pm
But it seems that abilities (tested with
Cretin archer) can target the stealth unit, so it's not a totally impossible situation to work around until fixed.
They also receive area damage for attacks focused on adjacent tile, so it seems purely to do with them not being registered as a valid target for actions
Don't be so harsh towards this poor guy.
Endru1241 wrote: ↑Fri Jan 28, 2022 6:19 am
I encountered the same with map editor unit (couldn't target enemy inside tc) - precisely trainee 2attack - and other 2 units in range didn't have any problems with targeting.
So I was trying to crack why this particular unit cannot attack.
Definitely nothing different with valid targets.
None of AoS units should have any limitations on what they can target (I only used valid targets field for effect applied property changer action jsons), so it's not very unexpected.
But I checked if maybe something could explain the difference.
I haven't found any differences in json.
So something with unit state in game must be the reason.
But I have no idea what.
It's best to find some way this bug could be replicated, because otherwise I have no idea if it could be fixed.
Endru1241 wrote: ↑Fri Jan 28, 2022 10:39 am
godOfKings wrote: ↑Fri Jan 28, 2022 8:47 am
U can use a spy to search inside the tc and figure out the problem
But the problem occurs with the same unit inside TC only for one my units.
I'll try to create situation as identical as possible in map editor, but I am afraid it may be not related to what unit is inside, as two units - one capable of attacking and one not have identical valid targets (none specified, so all normal targets) and specs.
My mistake - what I experienced was leftovers from my own tests and actually was all in unit jsons.
phoenixffyrnig wrote: ↑Fri Jan 28, 2022 11:47 am
Cracked it. It's a stealth unit in the first slot. ie, we are seeing the TC is occupied, but not being able to see the unit to target it
https://ibb.co/QQWPgZs
In these TCs i put a spy, assassin, ranger and ninja inside. Curiously, as an experiment, I put a spearman in the second and fourth TCs behind the stealth unit (the pictured scenario), and it still wouldn't allow any targeting.
Great find.
We now know what to look for to fix it.
Re: Can't attack garrisoned unit
Posted: Fri Jan 28, 2022 9:15 pm
by phoenixffyrnig
Don't be so harsh towards this poor guy.
Haha, 10 points to Endru Eagle-eye. Auto-correct decided to go for the word I used the most, I decided to leave it that way to see if anyone would clock it... Of course he did!

Re: Can't attack garrisoned unit
Posted: Sat Jan 29, 2022 4:43 pm
by Stratego (dev)
i have a possible fix on this.
earlier there was a report from AOW/AOMW that a plane on a bridge can not be targeted by AA guns and such problems.
so i made that the unit that is carried should only be checked by "targetability" but this affected TC-s too.
so now i made that change to work only for bridges nothing else (TC, vikingship and so on)
uos already