Jump to content

Storms over former XCOM members | Controlling abductions


Drakous79

Recommended Posts

For Long War I'm liking the idea of having just 1 Abduction mission per blitz early in the game, and increasing it to 2 and then 3 later in the game to put more pressure on both the interceptor fleet (trying to shoot down scouts and/or abductors) as well as the barracks (particularly when combined with the fatigue mechanic).

 

Since in Long War you can't send the same soldiers on the different abductions in a blitz (because of this fatigue system) it could mean some difficult choices about squad compositions in the later game.

 

I like increasing the number of abductions over time idea too.

 

Are you using SW blitz mechanic or rewritten GetNumAbductionSites in LW? With expand functions possibility, GetNumAbductionSites can be fine tuned.

Link to comment
Share on other sites

  • Replies 99
  • Created
  • Last Reply

Top Posters In This Topic

In Long War 2.12 (final) for EU the number of abductions per blitz was always just one, and the abduction timing was managed so that they didn't come in too close together or else 1 or more could be auto-failed. However if we can change it to not autofail abductions then we could use/expand on the abduction blitz concept.

 

I saw that the GetNumAbductionSites was pretty drastically trimmed for EW, to :

return 3
04 2C 03 
	
return ReturnValue
04 3A B2 4F 00 00 

EOS
53 

which is 10 bytes long. It's not even big enough to replace it with something like :

return helperFunction()
04 1B ## ## ## ## 00 00 00 00 16 

EOS
53 

which is 12 bytes long.

 

However GetNumAbductionSites is is only called twice, so if a helperFunction is created those two calls could be pointed directly to it.

 

I'm not sure what JL's take on this is, but I'm going to try and be as sparing as a I can with regard to the moving/resizing of functions. I haven't wrapped my head around all the ramifications of trying to maintain a large mod that might have dozens of such move/resize operations.

 

It may be okay but until I figure it out I'm going to be cautious :smile:

 

 

Edit:

Plus in EU Long War we'd already build a helper function to assist with scaling up the maximum pod size over time (it started at 2-4, then 3-6, and finally 4-8 , and that function is in XGStrategyAI also, so imagine the same function could serve for setting abduction sites.

Edited by Amineri
Link to comment
Share on other sites

Patching expanded function without moving again should be doable, if there is working size check. Going to post it into Expanding function size in UPK thread.

Link to comment
Share on other sites

Patching expanded function without moving again should be doable, if there is working size check. Going to post it into Expanding function size in UPK thread.

Well, if you comment out EXPAND_FUNCTION line you'll patch expanded function without a problem. But, of course, it is not safe and I will update PatchUPK utility as you suggested. Edited by wghost81
Link to comment
Share on other sites

  • 3 weeks later...

I've been looking at lot at this topic and this thread's discussion has been most informative. But after looking over XGStrategy there's a few enigmas that puzzle me:

function XGMission CheatTerrorMission()
{
	local XGMission_Terror kMission;

	kMission = Spawn(class'XGMission_Terror');
	kMission.m_kDesc = Spawn(class'XGBattleDesc');
	kMission.m_iCity = 4;
	kMission.m_iCountry = 0;
	kMission.m_iContinent = 0;
	kMission.m_iDuration = class'XGTacticalGameCore'.default.TERROR_TIMER;
	kMission.m_v2Coords = CITY(4).m_v2Coords;
	kMission.m_kDesc.m_kAlienSquad = DetermineTerrorSquad();
	return kMission;
}

Is this working?

function AddUFOs(int iNumUFOs, out array<XComGame.XGGameData.ECountry> arrVisible)
{
	local int iMonth, iUFO;
	local array<int> arrDates;
	local array<TUFO> arrUFOs;

	FillDatePool(arrDates);
	iMonth = GetMonth();
	// ObjectIndex:17065 BlockSize:0
	switch(iMonth)
	{
		// End:0xa1
		case 0:
			AIAddNewObjective(0, 0, HQ().GetCoords(), arrVisible[0]);

Does the last line add any UFO mission?

Link to comment
Share on other sites

Is this working?

 

Yes, it is, but with console commands in strategic layer of the game. Attack is always in Chicago and happens on defined or random map.

  • CreateTerrorAlert - random map
  • ForceMission - defined map (console commands below)
// ForceMission_URB_Bar_Terror
// ForceMission_URB_CommercialAlley_Terror
// ForceMission_URB_CommercialRestaurant
// ForceMission_URB_CommercialStreet_Terror
// ForceMission_URB_ConvenienceStore_Terror
// ForceMission_URB_Highway1
// ForceMission_URB_HighwayFallen
// ForceMission_URB_MilitaryAmmo
// ForceMission_URB_PoliceStation
// ForceMission_URB_StreetHurricane_Terror
// ForceMission_URB_OfficePaper_Terror
// ForceMission_URB_PierA_Terror

Most of this stuff is in XComStrategyGame.upk, class XComHeadquartersCheatManager.

exec function CreateTerrorAlert()
{
    GEOSCAPE().AddMission(AI().CheatTerrorMission()); // random map
}

exec function ForceMission_URB_Bar_Terror()
{
    ForceTerrorMission("URB_Bar_Terror (Art Placement Complete Urban Bar Terror)"); // defined map
}

function ForceTerrorMission(string strMapName)
{
    AI().CheatTerror(strMapName);
}

------

 

There are also commands like:

  • CreateAlienBaseAlert, CreateTempleShipAlert
  • ForceMission_URB_Bar (more maps in the class; uses ForceAbductionMission function)
  • ForceMission_CAbductor_Cliffside (more maps in the class; uses ForceCrashedUFOMission function)
  • ForceMission_LAbductor_FarmOutskirts (more maps in the class; uses ForceLandedUFOMission function)
  • ForceMission_URB_LiquorStore_Extraction (more maps in the class; uses ForceCovertOpsMission function)
  • ForceFCSatellite, ForceFCShipTransfer (FC requests; use in mission control room)
  • ForceMission_HQAssault (seems not working)

 

Does the last line add any UFO mission?

 

I think it creates XCOM HQ :smile:

Edited by Drakous79
Link to comment
Share on other sites

  • ForceMission_HQAssault (seems not working)

 

Have you noticed this?

function GetEvents(out array<THQEvent> arrEvents)
{
	local int iObjective, iLastMission;
	local XComGame.XGGameData.EMissionType eMission;

	// End:0x33 Loop:False
	if(m_iCouncilCounter > 0)
	{
		AddAIEvent(9, m_iCouncilCounter / 2, 0, arrEvents);
	}
	iObjective = 0;
	J0x3e:

	// End:0x2d4 Loop:True
	if(iObjective < m_arrObjectives.Length)
	{
		// End:0x85 Loop:False
		if(m_arrObjectives[iObjective].m_bComplete)
		{
		}
		// End:0x2c6
		else
		{
			eMission = 0;
			// ObjectIndex:8397 BlockSize:0
			switch(m_arrObjectives[iObjective].m_kTObjective.eType)
			{
				// End:0xdb
				
				case 4:
					eMission = 5;
					// End:0x18c
					break;
				// End:0x161

Objective 4 seems to be Destroy Satellite and eMissionType 5 is called HQAssault on eMission at XGGameData. Now if I'm looking at this right it seems that atfer a Satellite was destroyed you'd get a Base Defense mission at some point but this feature was removed.

 

 

I think it creates XCOM HQ :smile:

 

 

XCOM HQ or the first ground mission? AIAddNewObjective seems to be used to create targets for the AI.

Link to comment
Share on other sites

I think it creates XCOM HQ :smile:

 

XCOM HQ or the first ground mission? AIAddNewObjective seems to be used to create targets for the AI.

 

You are right. It creates Small Scout. Should be the first ship in starting month. My head read HQ and was quickly done with it.

case 0:
    // AIAddNewObjective(eObjective_Recon, int iStartDate, Vector2D v2Target, int iCountry)
    AIAddNewObjective(0, 0, HQ().GetCoords(), arrVisible[0]);
    // -1 UFO
    iNumUFOs -= 1;
    // MakeUFO(eShip_UFOSmallScout, eObjective_Scout)
    AddUFOToPool(MakeUFO(4, 1));

------

 

  • ForceMission_HQAssault (seems not working)

 

Tried the command and HQ assault didn't start. Its unclickable entry appeared in Mission Control though.

------

 

Objective 4 seems to be Destroy Satellite and eMissionType 5 is called HQAssault on eMission at XGGameData. Now if I'm looking at this right it seems that atfer a Satellite was destroyed you'd get a Base Defense mission at some point but this feature was removed.

 

Would be fun in case of having more than one XCOM base. But now losing HQ Assault mission counts as lose condition.

 

Anyway, I am not sure XGStrategyAI.GetEvents is called in regular game. It seems like debug helper.

XGMissionControlUI.UpdateEvents()
{
    m_kEvents.arrEvents.Remove(0, m_kEvents.arrEvents.Length);
    m_kEvents.arrOptions.Remove(0, m_kEvents.arrOptions.Length);
    LABS().GetEvents(m_kEvents.arrEvents);
    ENGINEERING().GetEvents(m_kEvents.arrEvents);
    GEOSCAPE().GetEvents(m_kEvents.arrEvents);
    HQ().GetEvents(m_kEvents.arrEvents);
    if((PSILABS()) != none)
    {
        PSILABS().GetEvents(m_kEvents.arrEvents);
    }
    // here it comes
    if(XComHeadquartersCheatManager(GetALocalPlayerController().CheatManager) != none)
    {
        if(XComHeadquartersCheatManager(GetALocalPlayerController().CheatManager).bDebugAIEvents)
        {
            AI().GetEvents(m_kEvents.arrEvents);
        }
    }
Link to comment
Share on other sites

 

I think it creates XCOM HQ :smile:

 

XCOM HQ or the first ground mission? AIAddNewObjective seems to be used to create targets for the AI.

 

You are right. It creates Small Scout. Should be the first ship in starting month. My head read HQ and was quickly done with it.

case 0:
    // AIAddNewObjective(eObjective_Recon, int iStartDate, Vector2D v2Target, int iCountry)
    AIAddNewObjective(0, 0, HQ().GetCoords(), arrVisible[0]);
    // -1 UFO
    iNumUFOs -= 1;
    // MakeUFO(eShip_UFOSmallScout, eObjective_Scout)
    AddUFOToPool(MakeUFO(4, 1));

 

The interesting bit is that it is the only UFO with a Reconnaissance mission that is generated from what I've seen.

 

I'm just a noob on this things but XGStrategyAI.GetEvents was a bit weird to figure out its role during the regular game since it seemed to replicate another function.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...