Jump to content

R&D Modding first mission


Tycus

Recommended Posts

I recently have been using first mission quite a lot (the one you get for skipping tutorial) for testing my mod (using johnnylump's suggestion to idea of changing first mission aliens; original thread http://forums.nexusmods.com/index.php?/topic/957964-replacing-aliens/?hl=first+mission&do=findComment&comment=7730647).

And soon realized that this mission is handled differently, that any other mission in game (which should be obvious, but in previous versions of game first mission was different (in a way it doesn't differ much from any other abductions), so I was just not paying attention to changes to it).

 

So purpose of this thread is to collect all knowledge about this mission and how to modify it to any possible extent (for mod testing purposes or otherwise).

 

What I found out so far:

- AI is shackled on this mission on any difficulty (even if you unshackled AI in DGC.ini), ie if you engage more than 5 aliens at once, the rest will run and hide in fog of war.

- You cannot choose soldiers/or change their equipment for this mission (can someone share any clues on how to change load-out of those starting rookies? Also can be those soldiers changed? I know, that they are generated, but can template/procedure be changed specifically for them?);

- On this mission map would be again chosen randomly at the restart in case of failure (but not on normal restart); (haven't been restarting missions a lot, can anybody confirm if this is a normal behavior of the missions? obviously it is only mission that can be restarted on ironman impossible(maybe on other difficulties too, never played any other than impossible difficulty (in principle), so I don't know :wink:)

- Obviously, aliens (and their pods) are built through specific function 'DetermineFirstMissionSquad' in <XGStrategyAI> (and it allows assigning any types of aliens for that mission manually);

 

And I would like for somebody to confirm/correct my findings. I know, that this is not a lot (but it is a start), and as any new information becomes available, this post will be kept up-to-date;

 

Maybe also there is some other special rules acting on this mission, that I'm not being aware of (so anyone can shed some light on this?).

Edited by Tycus
Link to comment
Share on other sites

Soldiers are initially equipped using the function XGStorage.AutoEquip

function AutoEquip(XGStrategySoldier kSoldier)
{
    local TInventory kRookieLoadout;

    ReleaseLoadout(kSoldier);
    kRookieLoadout.iArmor = 57;
    kRookieLoadout.iPistol = 2;
    TACTICAL().TInventoryLargeItemsSetItem(kRookieLoadout, 0, 3);
    TACTICAL().TInventorySmallItemsSetItem(kRookieLoadout, 0, 85);
    LOCKERS().ApplySoldierLoadout(kSoldier, kRookieLoadout);
    //return;    
}

This equips each soldier with an Assault Rifle, Kevlar Armor, a Pistol and 1 Frag Grenade.

 

-----------------------

 

I used the DetermineFirstMissionSquad function to test a lot of the larger pod functionality since it was easy to explicitly define larger pods in a controlled way. One time I had a pod of 9 (Floater leader + 8 sectoids) and a pod of 5 (sectoid leader with increased HP + 4 sectoids). It definitely felt like there were more than 5 aliens engaged, but it's difficult to say for certain.

 

The primary function that appears to set active aliens is XGAIPlayer.UpdateActiveUnits

 

The two conditionals it uses to add/remove units from the active list are:

    if((m_arrActiveEngaged.Length - nDrones) > (GetMaxEngagedAI()))


    if(bCheckAllActive && m_arrActiveEngaged.Length < (GetMaxEngagedAI()))

Looking at GetMaxEngagedAI :

  • There are hard-coded max and min engaged aliens of 32 and 3 (recall max squad size is limited to 128 by the XGPlayer.m_kSquad array size)
  • Special missions (FC Missions I think) or any missions with a VIP automatically has the limit set to max
  • Otherwise it checks the DGC value (setting the value to -1 sets the value to the max of 32, so it's not technically unlimited ;) )

Didn't see anything about first missions or tutorial missions, but it doesn't mean that it's not there lurking about in some dark corner.

Link to comment
Share on other sites

I used the DetermineFirstMissionSquad function to test a lot of the larger pod functionality since it was easy to explicitly define larger pods in a controlled way. One time I had a pod of 9 (Floater leader + 8 sectoids) and a pod of 5 (sectoid leader with increased HP + 4 sectoids). It definitely felt like there were more than 5 aliens engaged, but it's difficult to say for certain.

Maybe function, that limits number of enemies engaged, launches itself only if you have revealed multiple pods at once, or count only specific types of enemies?

 

Soldiers are initially equipped using the function XGStorage.AutoEquip

function AutoEquip(XGStrategySoldier kSoldier)
{
    local TInventory kRookieLoadout;

    ReleaseLoadout(kSoldier);
    kRookieLoadout.iArmor = 57;
    kRookieLoadout.iPistol = 2;
    TACTICAL().TInventoryLargeItemsSetItem(kRookieLoadout, 0, 3);
    TACTICAL().TInventorySmallItemsSetItem(kRookieLoadout, 0, 85);
    LOCKERS().ApplySoldierLoadout(kSoldier, kRookieLoadout);
    //return;    
}

This equips each soldier with an Assault Rifle, Kevlar Armor, a Pistol and 1 Frag Grenade.

Do I correctly understand, that function above also autoequips soldiers in barracks? Would it be possible to change that to say, equip each soldier with an Assault Rifle, Kevlar Armor, a Pistol and 2 Frag Grenades (I'm using mod, that changes number of small items on Kevlar Armor). Also, different loadouts?

 

Didn't see anything about first missions or tutorial missions, but it doesn't mean that it's not there lurking about in some dark corner.

I have not seen it either, but what we did not see don't mean it doesn't exist.

Link to comment
Share on other sites

 

 

Do I correctly understand, that function above also autoequips soldiers in barracks? Would it be possible to change that to say, equip each soldier with an Assault Rifle, Kevlar Armor, a Pistol and 2 Frag Grenades (I'm using mod, that changes number of small items on Kevlar Armor). Also, different loadouts?

 

All that (in theory) needs to be done is to add another 'TACTICAL().TInventorySmallItemsSetItem(kRookieLoadout, 0, 85);' line to add a second frag grenade.

 

For Long War I've tried to make the default loadout a Frag Grenade + Ceramic Plate (+1 HP item). The practical difficulty is that there is no room in the function to add a second SmallItemSet function call.

 

And yes, this is the function that equips soldiers when they are created, whether at the start of the game, or when newly hired. It also is responsible for auto-equipping reward soldiers (they however are immediately given a class and then the SetClass function can override the original autoequip).

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...