Jump to content

R&D to Increase Squad Size


Beknatok

Recommended Posts

Yeah I got updateData too! This prompts me to find a way to adjust the UI.. the code has to be somewhere. Yeah DGC SKYRANGER = 6. That's the part I'm not very good at. Is documentation. lol

 

What I would like to see is 6 or 8 start soldiers then plus 2 or 3 on each upgrade with increased prices.

 

I'm not giving up the search.

 

The order of the soldiers still needs to be fixed too.

Edited by twinj
Link to comment
Share on other sites

  • Replies 429
  • Created
  • Last Reply

Top Posters In This Topic

Overlooked you got UpdateData too - deleted the code in previous post.

 

It's really confusing. Default code adds 6 items to m_arrFillOrderIndex and m_arrUIOptions and still there are 4 slots without OTS upgrades.

 

Like it is directed by m_iCurrentSelection = ((m_iMaxSlots == 6) ? 5 : 4). But then I would expect m_iCurrentSelection = 3 somewhere.

 

What happens, if you change >= to > in UpdateData()?

m_arrUIOptions[iOption].bUnavailable = iDropShipIdx >= m_iMaxSlots
m_arrUIOptions[iOption].bUnavailable = iDropShipIdx > m_iMaxSlots

And what about putting this at the start before the loop?

PanelInit(_controller, _manager, _screen)
bCanNavigate = bNav
m_arrFillOrderIndex.AddItem(0)

And != is for testing?

m_iCurrentSelection = ((m_iMaxSlots != 8) ? 6 : 7)

Link to comment
Share on other sites

m_arrFillOrderIndex.AddItem(0)

 

This array is only used as an indirect way to access the actual UI array where the soldiers and box's are stored. All this is for is changing the order in which the boxes display. I might even be able to rip out the code altogether, remove references to the FillORderIndex altoegther and just access the arrays directly should fix the order problem! In this fucntion al that would be needed is the addUiBox(8) once and its done. To fill the gaps created in the script from that you would probably need to make 6 useless assignments (let tokens) to iMax and 0 and 0b out the rest and just use the init code from other functions. I still have to find the code where the soldiers order is changed on screen and whether more soldiers can be displayed.

 

I originally changed the call order in the functions as I didn't understand jumps quite properly and the only way I could get it to reference as a while if loop was when I used the top position like other code. Order shouldn't make a difference as all that is being created by that function is really the display order.

 

The last call in the function is the one where its default is 6. 6 Ui box's. This is where extra boxes are added. there are always 6 in the default game. The hint is only displayed on the first and last box. Whether the OTS upgrades have been bought decides if a soldier can fill that box. That is the purpose of UpdateData().

 

This is where I got confused as the arrayFillOrderIndex either 4 or 5 pointed to the last and first box... need to look further.

 

m_iCurrentSelection = ((m_iMaxSlots != 8) ? 6 : 7) Yeah just something that happened in attempts to get the code page sizes correct when changing what is read. Whether I used 2C 06 or 25 or 26 or some other object reference actually makes a difference to the size of the script at loadtime which is why the code did not work. I am planning to explain this properly so others can change the code to the extreme I have in this function.

Link to comment
Share on other sites

Thanks for clarifying it, got it now, fill order and the rest. Persuaded myself, those boxes aren't there until OTS upgrades and now I'm surprised there are hints in them!

 

Too bad hidden boxes are off screen. Hope you'll find where can UI be tweaked to show them all.

Link to comment
Share on other sites

While looking further into this I thought of a workaround. Maybe I would be able to rotate the soldiers to select through the view somehow.

 

I think it would be possible to use the two end boxes with buttons and enable them to select next and previous thus showing the boxes in middle with new data!

Link to comment
Share on other sites

Progress Report and help request - getting difficult.

 

Functions working on:

 

 

 

 

This code makes it possible to add n amount of soldiers to the list! Ultimately the loop may be changed back to the default as it only takes care of the order soldiers are added in on screen. The need for this ordering may be removed altogether.

 

An extra int is added so I can use it later to keep track of the number of soldiers available while using the instance variable (from the class) m_imax for tracking the UI with my changes.

 

The code in Bold is the code which allows us to add more soldiers to selection in background.

 

simulated function Init(XComPlayerController _controller, UIFxsMovie _manager, UI_FxsScreen _screen, XGMission kMission, bool bNav)
{
   local XGShip_Dropship kSkyranger;

   PanelInit(_controller, _manager, _screen);
   bCanNavigate = bNav;
   m_iMaxSlots = 9;
   J0x47:
   // End:0x7a [While If]
   if(0 <= m_iMaxSlots)
   {
       m_arrFillOrderIndex.AddItem(m_iMaxSlots);
       -- m_iMaxSlots;
       // This is an implied JumpToken; Continue!
       goto J0x47;
   }
   m_arrFillOrderIndex.AddItem(10);
   kSkyranger = kMission.GetAssignedSkyranger();
   m_iMaxSlots = kSkyranger.GetCapacity();
   m_iCurrentSelection = ((m_iMaxSlots != 10) ? 4 : 5);
   [b]m_arrUIOptions.Add(10);   [/b]                                     
}

 

Use first 48 bytes to find in upk. Replace 260 from header start.

 

D4 16 00 00 A9 1F 00 00 00 00 00 00 CE 16 00 00
00 00 00 00 00 00 00 00 D4 16 00 00 00 00 00 00
39 00 00 00 24 07 00 00 15 01 00 00 C5 00 00 00
1B 55 21 00 00 00 00 00 00 00 D4 16 00 00 00 D3
16 00 00 00 D2 16 00 00 4A 16 14 2D 01 C6 16 00
00 2D 00 D0 16 00 00 0F 01 C4 16 00 00 2C 09 07
7A 00 98 25 01 C4 16 00 00 16 55 01 C7 16 00 00
0A 00 01 C4 16 00 00 16 A6 01 C4 16 00 00 16 06
47 00 55 01 C7 16 00 00 03 00 2C 0A 16 0F 00 CF
16 00 00 19 00 D1 16 00 00 0A 00 50 37 00 00 00
1B 8B 0E 00 00 00 00 00 00 16 0F 01 C4 16 00 00
19 00 CF 16 00 00 0A 00 E2 3D 00 00 00 1B AF 0E
00 00 00 00 00 00 16 0F 01 C9 16 00 00 45 9B 01
C4 16 00 00 2C 0A 16 02 00 2C 04 02 00 2C 05 54
01 C8 16 00 00 2C 0A 16 0B 0B 0B 0B 0B 0B 0B 0B
0B 0B 04 0B 53 00 00 00 02 01 02 00 FA 12 00 00
00 00 00 00

 

 

 

 

 

 

 

The purpose of this change to to invoke a different method so that everytime I change selection the whole row of soldiers is updated. For now it still retains the cursor changing up or down. In final I suspect best behaviour will be to remove this.

 

private final function SelectPrevAvailableSlot()
{
   local int iNewIndex;

   // End:0x12
   if(m_arrUIOptions.Length == 0)
   {
       return;
   }
   iNewIndex = m_iCurrentSelection;
   ++ iNewIndex;
   // End:0x4b
   if(iNewIndex >= 10)
   {
       iNewIndex = 0;
   }
   // End:0x25
   if(!m_arrUIOptions[iNewIndex].bUnavailable)
   	goto J0x25;
   m_iCurrentSelection = iNewIndex;
   UpdateData();    
}

 

Use first 48 bytes to find in upk. Replace 167 from header start.

 

EA 16 00 00 A9 1F 00 00 00 00 00 00 E9 16 00 00
00 00 00 00 00 00 00 00 EA 16 00 00 00 00 00 00
F7 00 00 00 31 1A 00 00 98 00 00 00 68 00 00 00
07 12 00 9A 36 01 C8 16 00 00 25 16 04 0B 0F 00
EA 16 00 00 01 C9 16 00 00 A5 00 EA 16 00 00 16
07 4B 00 99 00 EA 16 00 00 2C 0A 16 0F 00 EA 16
00 00 25 07 25 00 81 2D 35 B8 16 00 00 C3 16 00
00 00 00 10 00 EA 16 00 00 01 C8 16 00 00 16 0F
01 C9 16 00 00 00 EA 16 00 00 1B AB 2B 00 00 00
00 00 00 16 0B 04 0B 53 00 00 00 03 00 04 00 8A
23 00 00 00 00 00 00

 

 

 

 

 

 

 

Same as above but different select direction.

 

private final function SelectNextAvailableSlot()
{
   local int iNewIndex;

   // End:0x12
   if(m_arrUIOptions.Length == 0)
   {
       return;
   }
   iNewIndex = m_iCurrentSelection;
   -- iNewIndex;
   // End:0x4b
   if(iNewIndex < 0)
   {
       iNewIndex = 9;
   }
   // End:0x25
   if(!m_arrUIOptions[iNewIndex].bUnavailable)
   	goto J0x25;
   m_iCurrentSelection = iNewIndex;
   UpdateData();                
}

 

Use first 48 bytes to find in upk. Replace 170 from header start.

 

EC 16 00 00 A9 1F 00 00 00 00 00 00 EB 16 00 00
00 00 00 00 00 00 00 00 EC 16 00 00 00 00 00 00
0C 01 00 00 C0 1B 00 00 9B 00 00 00 6B 00 00 00
07 12 00 9A 36 01 C8 16 00 00 25 16 04 0B 0F 00
EC 16 00 00 01 C9 16 00 00 A6 00 EC 16 00 00 16
07 4B 00 96 00 EC 16 00 00 25 16 0F 00 EC 16 00
00 2C 09 07 25 00 81 2D 35 B8 16 00 00 C3 16 00
00 00 00 10 00 EC 16 00 00 01 C8 16 00 00 16 0F
01 C9 16 00 00 00 EC 16 00 00 1B AB 2B 00 00 00
00 00 00 16 0B 0B 0B 0B 04 0B 53 00 00 00 03 00
04 00 89 23 00 00 00 00 00 00

 

 

 

 

 

 

 

The purpose of the change here is to enable the UI to load each UI box with new data based on the current selection.

 

This function has been a pain it has many jumps, many indexes and lots of strings. This is my first 'working' version. It is WRONG but shows that the UI can be slightly manipulated to bend to ones will.

 

My logic is probably incorrect to create a UI that rotates through all soldier's. The soldier showing in its respective position seems unchangeable for now.

 

protected simulated function UpdateDisplay()
{
   local int iSlot;

   Invoke("clear");
   m_arrFillOrderIndex[10] = m_iMaxSlots;
   iSlot = 0;
   J0x34:
   // End:0x3a1 [While If]
   if(iSlot < 6)
   {
       m_iMaxSlots = m_iCurrentSelection + iSlot;
       m_iMaxSlots = m_iMaxSlots % 10;
       // End:0x2b3
       if(!m_arrUIOptions[m_iMaxSlots].bUnavailable)
       {
           // End:0x24a
           if(!m_arrUIOptions[m_iMaxSlots].bEmpty)
           {
               AS_SetAddUnitText(iSlot, "", "", "");
               AS_SetUnitInfo(iSlot, m_arrUIOptions[m_iMaxSlots].iStatus, m_arrUIOptions[m_iMaxSlots].strName, m_arrUIOptions[m_iMaxSlots].strNickName, m_arrUIOptions[m_iMaxSlots].classDesc, m_arrUIOptions[m_iMaxSlots].classLabel, m_strBackpackLabel, m_arrUIOptions[m_iMaxSlots].item1, m_arrUIOptions[m_iMaxSlots].item2, ((m_arrUIOptions[m_iMaxSlots].bPromote) ? m_strPromote : ""));
           }
           // End:0x2b0
           else
           {
               AS_SetUnitInfo(iSlot, -1, "", "", "", "", "", "", "", "");
               AS_SetAddUnitText(iSlot, m_strAddUnit, "+", class'UI_FxsGamepadIcons'.static.GetAdvanceButtonIcon());
           }
       }
       // End:0x393
       else
       {
           // End:0x393
           if(m_arrUIOptions[m_iMaxSlots].bHint)
           {
               AS_SetUnitInfo(iSlot, -1, "", "", "", "", "", "", "", "");
               // End:0x37a
               if(UISquadSelect(screen).GetMgr().HQ().HasFacility(12))
               {
                   AS_SetAddUnitText(iSlot, "", "", "");
               }
               // End:0x393
               else
               {
                   AS_SetAddUnitText(iSlot, "", "", "");
               }
           }
       }
       ++ iSlot;
       // This is an implied JumpToken; Continue!
       goto J0x34;
   }
   m_iMaxSlots = m_arrFillOrderIndex[10];
   RealizeSelected();
   Show();                                                                                    
}

 

Use first 48 bytes to find in upk. Replace 735 from header start.

 

F4 16 00 00 A9 1F 00 00 00 00 00 00 F3 16 00 00
00 00 00 00 00 00 00 00 F4 16 00 00 00 00 00 00
6A 01 00 00 3E 26 00 00 E4 03 00 00 A0 02 00 00
1B AD 13 00 00 00 00 00 00 1F 63 6C 65 61 72 00
4A 4A 16 0F 10 2C 0A 01 C7 16 00 00 01 C4 16 00
00 0F 00 F4 16 00 00 25 07 A1 03 96 00 F4 16 00
00 2C 06 16 0F 01 C4 16 00 00 92 01 C9 16 00 00
00 F4 16 00 00 16 0F 01 C4 16 00 00 AD 01 C4 16
00 00 2C 0A 16 07 B3 02 81 2D 35 B8 16 00 00 C3
16 00 00 00 00 10 01 C4 16 00 00 01 C8 16 00 00
16 07 4A 02 81 2D 35 B9 16 00 00 C3 16 00 00 00
00 10 01 C4 16 00 00 01 C8 16 00 00 16 1C 2F 17
00 00 00 F4 16 00 00 1F 00 1F 00 1F 00 16 1C 20
17 00 00 00 F4 16 00 00 35 BB 16 00 00 C3 16 00
00 00 00 10 01 C4 16 00 00 01 C8 16 00 00 35 C1
16 00 00 C3 16 00 00 00 00 10 01 C4 16 00 00 01
C8 16 00 00 35 C0 16 00 00 C3 16 00 00 00 00 10
01 C4 16 00 00 01 C8 16 00 00 35 BF 16 00 00 C3
16 00 00 00 00 10 01 C4 16 00 00 01 C8 16 00 00
35 BE 16 00 00 C3 16 00 00 00 00 10 01 C4 16 00
00 01 C8 16 00 00 01 CA 16 00 00 35 BD 16 00 00
C3 16 00 00 00 00 10 01 C4 16 00 00 01 C8 16 00
00 35 BC 16 00 00 C3 16 00 00 00 00 10 01 C4 16
00 00 01 C8 16 00 00 45 2D 35 BA 16 00 00 C3 16
00 00 00 00 10 01 C4 16 00 00 01 C8 16 00 00 09
00 01 CE 16 00 00 02 00 1F 00 16 06 B0 02 1C 20
17 00 00 00 F4 16 00 00 1D FF FF FF FF 1F 00 1F
00 1F 00 1F 00 1F 00 1F 00 1F 00 1F 00 16 1C 2F
17 00 00 00 F4 16 00 00 01 CD 16 00 00 1F 2B 00
12 20 B4 FE FF FF 0A 00 46 FA FF FF 00 1B 76 0E
00 00 00 00 00 00 16 16 06 93 03 07 93 03 2D 35
B7 16 00 00 C3 16 00 00 00 00 10 01 C4 16 00 00
01 C8 16 00 00 1C 20 17 00 00 00 F4 16 00 00 1D
FF FF FF FF 1F 00 1F 00 1F 00 1F 00 1F 00 1F 00
1F 00 1F 00 16 07 7A 03 19 19 19 2E B3 16 00 00
01 12 FB FF FF 0A 00 86 16 00 00 00 1B 91 0F 00
00 00 00 00 00 16 0A 00 A0 00 00 00 00 1B 5C 11
00 00 00 00 00 00 16 0C 00 F9 32 00 00 00 1B 0D
11 00 00 00 00 00 00 2C 0C 16 1C 2F 17 00 00 00
F4 16 00 00 1F 00 1F 00 1F 00 16 06 93 03 1C 2F
17 00 00 00 F4 16 00 00 1F 00 1F 00 1F 00 16 A5
00 F4 16 00 00 16 06 34 00 0F 01 C4 16 00 00 10
2C 0A 01 C7 16 00 00 1C 22 17 00 00 4A 16 1B 82
24 00 00 00 00 00 00 16 0B 0B 0B 0B 0B 0B 0B 0B
0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 0B 04 0B 53
00 00 00 02 01 08 00 B0 2B 00 00 00 00 00 00

 

 

 

 

There are some tweaks in some other functions that would be part of the final package I have excluded them as not required for functionality.

Edited by twinj
Link to comment
Share on other sites

  • 3 weeks later...
Forgot to report that I came very close to getting this... The above code has been more optimised but I hit another brick wall. Have not updated new code. I could not refresh the UI soldiers list and screen when scrolling through the boxes.
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...