X2CommunityCore / X2WOTCCommunityHighlander

https://steamcommunity.com/workshop/filedetails/?id=1134256495
MIT License
60 stars 68 forks source link

ADVENT does not extract supplies from the Extract Supplies mission if XCOM starts unconcealed #1319

Open Iridar opened 7 months ago

Iridar commented 7 months ago

I'm going on an extract supplies mission where you mark crates for Avenger to pick up before Advent gets them - lost city, fairly late game. As I hit the map I realize that one of the Dark Events is still active - the one where you start the mission without concealment.

My first thought is how is this going to work? Will the crates start getting marked and taken away after the first round? After I first encounter Advent? Normally it happens right after you break concealment and the fighting starts....

...but since I am not in concealment, there is no concealment to break, and Advent never marked any crates. I was able to take my time and get them all (even managed to lure a Sectopod away from the two crates he was standing next too before I blew him up). I guess its a combo of events that they never thought of when programming this mission type...

https://www.reddit.com/r/XCOM2/comments/1bgn9y1/well_thats_new_extract_supplies_mission/

BlackDog86 commented 5 months ago

I can confirm this happens in testing. Spawning the mission using spawnmission missionsource_supplyraid reward_none and activating the dark event via activatedarkevent darkevent_highalert creates the necessary conditions to break the crate-race mission (i.e. advent never collects any).

If I come up with any creative ways of fixing it I'll let you know :)

BlackDog86 commented 5 months ago

In X2TacticalGameRuleset, && !BattleDataState.bForceNoSquadConcealment can be removed, which will force the 'start of mission concealment' on irrespective of the battledata flag.

    // set initial squad concealment
    if( ActiveMissionSchedule.XComSquadStartsConcealed && !BattleDataState.bForceNoSquadConcealment)
    {
        foreach History.IterateByClassType(class'XComGameState_Player', PlayerState)
        {
            if( PlayerState.GetTeam() == eTeam_XCom )
            {
                PlayerState.SetSquadConcealment(true, 'StartOfMatchConcealment');
            }
        }
    }

Later in the function we can just trigger the concealment break directly by:

        If (BattleDataState.bForceNoSquadConcealment)
        {
        UnitState.BreakConcealment();
        }

I've tested this and it does fix the issue, but the visualization is not great - you get the initial start of mission "High alert" flyover, followed by the "Concealed" and "Revealed" flyovers coming from the set & break concealment functions & I'm not sure if/how those can be suppressed.

BlackDog86 commented 2 months ago

This PR is not ready to merge yet - further work is required