Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The first out out of four enemy phrases about counter attack may play #78

Open
SurDno opened this issue Nov 27, 2018 · 11 comments
Open

Comments

@SurDno
Copy link
Contributor

SurDno commented Nov 27, 2018

No description provided.

@SurDno SurDno changed the title The first out out of four enemy phrases about counter attack may play even if no counterattack is planned The first out out of four enemy phrases about counter attack may play Nov 27, 2018
@SurDno
Copy link
Contributor Author

SurDno commented Nov 27, 2018

I do not know if it's really related to the fact if any counter-attack is planned. I did not get an according quest, though an enemy squad headed to the newly captured point.
I've encountered this several times through my playthrough.

@SurDno
Copy link
Contributor Author

SurDno commented Aug 24, 2019

Okay, it’s two out of four. Happened at least a few more times. It’s just like the game plans a counter attack and then decides to actually start none. Are there different requirements for every phrase in the set or are they just playing one after another?

@Decane
Copy link
Owner

Decane commented Aug 25, 2019

The audio for counter-attacks is initiated in function CCaptureSmartTask:check_task(tm) in task_objects.script.

Let 'S' denote the smart terrain to capture; let 'D' denote the defending faction; let 'A' denote the attacking faction, i.e. the faction that gave the 'capture' task. Then the logic is roughly:

  • If/once S is owned by A:
    • If use of the counter-attack feature is permitted for D:
      • Start playing pre-counter-attack sounds (e.g. 'Anyone there?', 'Come in!', etc.)
      • If/once the pre-counter-attack sounds have finished or 15 real seconds have elapsed since they started playing:
        • If a squad of D is stationed at a neighboring smart to S and it's 'safe' to send them to S:
          • Play 'counter-attack launched' sound
          • Send the squad (only one if there are several) at the neighboring smart to S
        • Otherwise, finish the task

The 15-second timeout is a work-around added by the SRP to prevent the 'capture' task from never finishing. For some reason, the pre-counter-attack sounds sometimes never register as finished in vanilla.

I haven't looked into what determines how many pre-counter-attack sounds are played before the game registers them as finished or the 15-second timeout is reached.

@Decane
Copy link
Owner

Decane commented Aug 25, 2019

@SurDno What do you think is the problem here? The fact that a counter-attack isn't always executed even if you hear pre-counter-attack sounds? As explained above, a counter-attack is only launched if a suitable enemy squad is found at a neighboring smart terrain.

@SurDno
Copy link
Contributor Author

SurDno commented Aug 25, 2019

According to logic you provided, everything is working as intended. Just the scenario of pre-counter-attack sounds happening but the faction not sending any squads to actually counter attack was rare enough it seemed to be a bug to me.

If the only requirement for pre-counter-attack sound is being owned by enemy faction and being suitable for counter-attack, why does it sometimes play no sounds at all and other times it’s playing the first two without initiating the counter-attack, even on the same point? For example, I’ve seen both described behaviors at Pump Station.

@Decane
Copy link
Owner

Decane commented Aug 25, 2019

why does it sometimes play no sounds at all [...] without initiating the counter-attack, even on the same point?

That sounds like a bug; pre-counter-attack sounds should always play, as long as the previous smart terrain owner uses the counter-attack feature (mutants, mercs, and monolith don't).

@SurDno
Copy link
Contributor Author

SurDno commented Aug 25, 2019

It should always play “Anyone there?” on any point getting captured, or do I not get something?

@Decane
Copy link
Owner

Decane commented Aug 25, 2019

It should always play “Anyone there?” on any point getting captured [...]?

For any point that is the target of a 'capture' task and whose previous owner uses the counter-attack feature, yes.

@SurDno
Copy link
Contributor Author

SurDno commented Jul 3, 2020

@Decane I know it's late, but what do you mean by 'safe' in following quote?

it's 'safe' to send them to S

@Decane
Copy link
Owner

Decane commented Jul 3, 2020

@SurDno 'Safe' was a poor choice of wording. I meant by it: 'the squad of D stationed at the neighboring smart to S either doesn't have a scripted target or has S as its scripted target'.

So basically, any squad of the defending faction that is stationed at a neighboring smart is available for sending to the capture target except one that has a scripted target that is not also the capture target.

@SurDno
Copy link
Contributor Author

SurDno commented Jul 3, 2020

Got it, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants