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

Trigger squad concealment broken event on missions where bForceNoSquadConcealment flag is set #1351

Merged
merged 2 commits into from
Dec 16, 2024

Conversation

BlackDog86
Copy link
Contributor

@BlackDog86 BlackDog86 commented May 31, 2024

Fixes #1319

This is a preliminary fix for review & likely will need some changes but just creating a PR for review / conversation.

The code adjustment fixes the problem by starting the squad in concealment and then breaking it if the dark event / battledata flag bForceNoSquadConcealment is set, instead of not setting concealment on the squad in the first place. It works properly with phantom & reaper shadow but at the moment it creates a lot of flyovers on mission start which I suspect which looks a bit messy & I suspect will prevent this from being merged directly - I haven't sorted the comments out yet either!

Basically, on missions where the squad starts concealed and high alert is active you now get the following situation:
"High Alert Flyover"
"Concealed Flyover"
"Revealed Flyover"
(Optional if you have a ranger) "Phantom Ranger Concealed Flyover"

Normal mission start flyovers are not affected.

It would be ideal if we could come up with a way to suppress the visualiser when we use the SetSquadConcealment function but I don't really know how to do that at this point. Advice welcome!

@BlackDog86 BlackDog86 self-assigned this Aug 3, 2024
@BlackDog86 BlackDog86 added the waiting-on-author A pull request is waiting on changes from the author label Aug 3, 2024
@BlackDog86 BlackDog86 added this to the 1.29.0 milestone Aug 3, 2024
@Iridar
Copy link
Contributor

Iridar commented Sep 5, 2024

Since the issue is specifically with the mission, perhaps it's the mission that needs to be fixed? Perhaps changing the mission trigger from "XCOM breaks concealment" to "XCOM unit sighted". Either that or "or mission start if XCOM starts unconcealed". The latter is less friendly towards the player, but makes more sense with the mission narrative that goes "ADVENT already knows we're here".

The problem of course is mission logic is probably in kismet, and I'm not sure if we can fix it in CHL.

@BlackDog86 BlackDog86 force-pushed the 1319-Crate-Race-Fix branch 2 times, most recently from 40965ee to 829be86 Compare October 29, 2024 00:35
@BlackDog86
Copy link
Contributor Author

BlackDog86 commented Nov 30, 2024

Think I've found a workable solution to this - it seems the mission kismet which triggers the start of the crate pickup is set to trigger with the 'SquadConcealmentBroken' event, so we can simply get the event manager to fire off this event if the bForceNoSquadConcealment flag is set on the battle data (without running all the actual 'setsquadconcealment' functions which does a bunch of other stuff. Preliminary testing suggests this seems to work. Will update shortly!

@BlackDog86 BlackDog86 added ready-to-review A pull request is ready to be reviewed and removed waiting-on-author A pull request is waiting on changes from the author labels Nov 30, 2024
@Iridar
Copy link
Contributor

Iridar commented Dec 2, 2024

I'm gonna request some more testing done on this, specifically:

  1. Produce the issue
  2. Confirm the fix addresses the issue.
  3. Do a reasonable amount of testing to make sure the fix doesn't break other missions with the dark event / battle data flag present.

@Iridar Iridar modified the milestones: 1.29.0, 1.30.0 Dec 2, 2024
@Iridar Iridar added waiting-on-author A pull request is waiting on changes from the author and removed ready-to-review A pull request is ready to be reviewed labels Dec 2, 2024
…t in Battledata to fix supply extraction bug.
@BlackDog86
Copy link
Contributor Author

BlackDog86 commented Dec 8, 2024

  1. I can categorically confirm that without this fix & just CHL active, if you spawn the high alert dark event and attempt an Advent Supplies extraction, the AI will never collect any crates.
  2. I can also categorically confirm that triggering the 'SquadConcealmentBroken' event on mission start (or indeed by toggling concealment on & off via console command) fixes the problem and allows the mission to proceed normally (i.e. ADVENT starts marking crates immediately on the first turn. Obviously, this increases the difficulty of the mission but I think the argument that not triggering the start of crate collection with that DE active was an intentional design decision is a stretch!).
  3. Tested a good few mission types so far (Hack workstation, Gather survivors, Sabotage transmitter, Chosen Retal) - no adverse effects so far.

@BlackDog86 BlackDog86 added ready-to-review A pull request is ready to be reviewed and removed waiting-on-author A pull request is waiting on changes from the author labels Dec 8, 2024
Updated docs and code styling
@Iridar
Copy link
Contributor

Iridar commented Dec 10, 2024

I've updated the docs and code styling, please take a look and if you don't see anything objectionable, this is good to go.

@Iridar Iridar added waiting-on-author A pull request is waiting on changes from the author and removed ready-to-review A pull request is ready to be reviewed labels Dec 10, 2024
@BlackDog86
Copy link
Contributor Author

Happy with your adjustments :)

@BlackDog86 BlackDog86 added ready-for-merge the pull request was reviewed and is ready to be merged. and removed waiting-on-author A pull request is waiting on changes from the author labels Dec 14, 2024
@Iridar Iridar merged commit 2888ed3 into X2CommunityCore:master Dec 16, 2024
4 checks passed
@Iridar Iridar changed the title Properly trigger unit concealment loss when bForceNoSquadConcealment flag is set instead of not concealing in the first place. Trigger squad concealment broken event on missions where bForceNoSquadConcealment flag is set Dec 16, 2024
@BlackDog86 BlackDog86 deleted the 1319-Crate-Race-Fix branch January 7, 2025 03:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-basegame ready-for-merge the pull request was reviewed and is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ADVENT does not extract supplies from the Extract Supplies mission if XCOM starts unconcealed
2 participants