Jump to content

R&D to Increase Squad Size


Beknatok

Recommended Posts

Nice find!

Though I suspect that armory plinth code doesn't relate to the placement of pawns inside the hangar (i.e. squad selection) but to showing them in the armory (i.e. soldier loadout).

It's possible any pawns attached to slots >= 7 show up elsewhere in the barracks, as Amineri also noted - are there any cheats/console commands to maybe unlock the camera to in the hangar view to search around the rest of the base to confirm this?

In any case, if the unit pawns are actually placed somewhere it should be pretty straightforward to re-locate them into the hangar using SetLocation() at a suitable position in the code, somewhere around the original AddToLocation() call perhaps.

Link to comment
Share on other sites

  • Replies 429
  • Created
  • Last Reply

Top Posters In This Topic

If it helps, I noticed this with a seven-member squad:

 

Number the soldier positions in the dropship / hangar screen like this (I know they aren't coded this way)

 

12345678

 

Slot 1 is activated when you add a 7th soldier slot.

 

If slots 1 and 4 are empty, adding a soldier to 1 (the leftmost, half off the screen) will make the pawn appear in slot 4.

 

Then adding a solider to slot 4 will make that soldier's pawn overlap the soldier already there (with graphical weirdness).

 

Adding a soldier to slot 4 first, then to 1, does not cause the overlap or weirdness -- the slot 1 pawn does not appear anywhere.

Edited by johnnylump
Link to comment
Share on other sites

Time for another interface update, I've modified the soldier debriefing screen to arrange the soldier slots in a scrollable list:

http://i.imgur.com/vHx9TRB.jpg

Currently the list is hard-coded to contain up to 12 soldier slots, if there's need for more I can gladly make some modifications.

Making it truly dynamic without any hard-coded limits would be preferable, but I wanted to get it into a generally workable state first :smile:

 

Here's the complete modified flash binary file (archived due to file size limitations):

Paste its contents into command1.upk at offset 42,973,694 (0x28FB9FE), size is 330,346 (0x50A6A) bytes.

 

As soon as I get my notes sorted out I can post some details about the changes made.

Link to comment
Share on other sites

You all may be way ahead of me, but here's some of what seems to control the pawn in the hangar screen.

 

XGStrategySoldier >> SetHQLocation

       (partial code)
        m_iHQLocation = iNewHQLocation;
        // End:0x189
        if((m_iHQLocation == 1) && SlotIdx == -1)
        {
            // End:0x188
            foreach HANGAR().m_kSkyranger.m_arrSoldiers(kHangarSoldier, iIndex)
            {
                // End:0x187
                if(kHangarSoldier == self)
                {
                    SlotIdx = iIndex;
                    // End:0x188
                    break;
                }                
            }            
        }
        AddToLocation(Loc, SlotIdx);

AddtoLocation calls XComGame >> SeqEvent_HQUInits.AddUnitToRoomSequence

static function bool AddUnitToRoomSequence(string RoomName, XComUnitPawn UnitPawn, optional int SlotIdx)
{
    local SeqEvent_HQUnits UnitMap;

    SlotIdx = -1;
    UnitMap = FindHQRoomSequence(RoomName);
    // End:0x67
    if(UnitMap != none)
    {
        return UnitMap.AddUnit(UnitPawn, SlotIdx);
    }
    return false;
    //return ReturnValue;    
}

The HQUnits class may be where the magic happens, and it seems to be set up for 12 units.

Link to comment
Share on other sites

If it helps, I noticed this with a seven-member squad:

 

Number the soldier positions in the dropship / hangar screen like this (I know they aren't coded this way)

 

12345678

 

Slot 1 is activated when you add a 7th soldier slot.

 

If slots 1 and 4 are empty, adding a soldier to 1 (the leftmost, half off the screen) will make the pawn appear in slot 4.

 

Then adding a solider to slot 4 will make that soldier's pawn overlap the soldier already there (with graphical weirdness).

 

Adding a soldier to slot 4 first, then to 1, does not cause the overlap or weirdness -- the slot 1 pawn does not appear anywhere.

What seems to happen is that soldier 7 ends up in the first empty slot.

If slot 1 is taken soldier 7 ends up in slot 2, if that is also taken then slot 3, until all 6 visible slots are taken.

 

Soldiers who have an assigned slot does not respect taken slots and just go where they are told.

 

From that observation alone I think it can be concluded that FindHQRoomSequence (or whatever function finally does the SlotIdx-to-location lookup) can only find 6 slots since the 7th would have been given to soldier 7 otherwise, preventing him from grabing any free slot.

 

However when I experimented by assigning all pawns to a single slotID, all 7 of 7 were drawn in that slot.

 

So right now I think that may still be the best alternative to assign them all to a single slot and then use a loop to offset them from that location one by one.

 

The "only" things needed to figure out would be where to find space for the loop and relocation code, and to actually figure out how to offset the pawns after they have been drawn (or at least been assigned co-ordinates).

Link to comment
Share on other sites

What I can't figure out is where the slot translates into a screen position. Somewhere in here, maybe?

if(bAdded)
    {
        // End:0x54F
        if(CineDummy != none)
        {
            HumanPawn = XComHumanPawn(InUnit);
            // End:0x4AB
            if(HumanPawn != none)
            {
                HumanPawn.PrepForMatinee();
            }
            UnitPawn = XComUnitPawn(InUnit);
            UnitPawn.bSkipRotateToward = false;
            UnitPawn.SetBase(CineDummy);
            UnitPawn.SetPhysics(7);
            UnitPawn.ResetIKTranslations();
            UpdateMatinee();
        }
    }
    return bAdded;
    //return ReturnValue;    
}

(partial from AddUnit)

Link to comment
Share on other sites

I followed SetBase to Engine.upk (not one modders normally work in), and it's a native call in the Actor class:

native(298) final function SetBase(Actor NewBase, optional Vector NewFloor, optional SkeletalMeshComponent SkelComp, optional name AttachName);

And you're right; cinedummy never seems to get set, so I guess I'm really out of my depth in understanding how it works. I find nothing in engine.upk and only this in XComStrategyGame.XGBase

 

 

 

function SkeletalMeshActor GetCineDummy(name LevelPackageName)
{
local SkeletalMeshActor kSkel;

// End:0x95
foreach WorldInfo.AllActors(class'SkeletalMeshActor', kSkel)
{
// End:0x94
if((kSkel.GetPackageName() == LevelPackageName) && kSkel.Tag == 'CineDummy')
{
return kSkel;
}
}
return none;
//return ReturnValue;
}
Edited by johnnylump
Link to comment
Share on other sites

And you're right; cinedummy never seems to get set, so I guess I'm really out of my depth in understanding how it works. I find nothing in engine.upk and only this in XComStrategyGame.XGBase

I do see some kind of reference to a CineDummy property in Anim_Hangar.upk (among others), but I can't really make sense of it:

begin object name=CineDummy class=SkeletalMesh
    Sockets=/* Array type was not detected. */
    LODInfo=/* Array type was not detected. */
    ClothTearFactor=3.0
object end
// Reference: SkeletalMesh'CIN_Dummy.CineDummy'

Maybe UE Explorer isn't able to decipher it in detail?

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...