Jump to content

R&D to Increase Squad Size


Beknatok

Recommended Posts

Yes in linear fillorder it works because soldier 0-5 ends up in slot 0-5.

But if that was not true then I am pretty sure we would end up in the scenario I described, so yes I agree that the first six soldiers need to be in the first six slots [snip]

I think you are on the wrong track here. When using the staggered fill order I posted here the 6 pawns are aligned with the their slot sprites. The proposed hex basically translates to

m_arrFillOrderIndex.AddItem(6);
m_arrFillOrderIndex.AddItem(5);
m_arrFillOrderIndex.AddItem(7);
m_arrFillOrderIndex.AddItem(4);
m_arrFillOrderIndex.AddItem(8);
m_arrFillOrderIndex.AddItem(3);
m_arrFillOrderIndex.AddItem(9);
m_arrFillOrderIndex.AddItem(2);

and it works flawlessly (save for the fact that only 8 of 12 slots are mapped, but this doesn't have any bearing on the pawns).

I suggest you simply try to implement the [6, 5, 7, 4, 8, 3, 9, 2, 10, 1, 11, 0] fill order and see for yourself :smile:

 

I thought about that idea as well, but I assume it is ten times more difficult to implement there than in the upk...

Edit: And what implications it would have on scalability.

Actually, implementing this via ActionScript would be pretty straightforward, I was already toying around with the idea of dynamically adding slot sprites to the squad list instead of statically defining them in their parent sprite. That way you'd only need to hex-edit a single value to get different numbers of slot sprites attached to the list, inserting a different fill order there would be quite trivial :)

Edited by XMarksTheSpot
Link to comment
Share on other sites

  • Replies 429
  • Created
  • Last Reply

Top Posters In This Topic

Did you try this experiment?

http://forums.nexusmods.com/index.php?/topic/804076-rd-to-increase-squad-size/?p=8670598

 

I'm not trying to be stubborn intentionally, even if that often is the result... :smile:

 

Edit: I suspect that it seems to work but on closer examination places the topmost on-mission-soldier in the barracks in the rightmost slot... But I promise I will do additional testing tomorrow and if you are correct I will stop being stubborn about it :smile:

 

Oh wait, no it should place the first soldier in the first available pawn location which will then be shared by an additional soldier I think... defintively need to sleep :tongue:

 

The results from my previous testing was posted here: http://forums.nexusmods.com/index.php?/topic/804076-rd-to-increase-squad-size/?p=8683951

Edited by Bertilsson
Link to comment
Share on other sites

Actually, implementing this via ActionScript would be pretty straightforward, I was already toying around with the idea of dynamically adding slot sprites to the squad list instead of statically defining them in their parent sprite. That way you'd only need to hex-edit a single value to get different numbers of slot sprites attached to the list, inserting a different fill order there would be quite trivial :smile:

Definitively worth doing as plan B when you get tired of waiting for me to fix the upk or if we simply never get to an agreement about what would be right :D

Link to comment
Share on other sites

Did some testing and finally got it.

XMarksTheSpot was correct all the time.

 

As long as the fill-order array is only populated with existing slotnumbers there is no problem.

And if implemented the way he suggested to begin with then that will always be true.

 

On skyranger capacity = 6 it will populate 0-5 slots like vanilla.

On skyranger capacity = 8 it will populate 0-7 slots with 2 pawnless in slot 7 and 0.

On skyranger capacity = 10 it will populate 0-9 slots with 4 pawnless in slot 9,0 and slot 8,1

 

And this would be the fillorder each skyranger max capacity:

1 = [0]
2 = [1, 0]
3 = [1, 2, 0]
4 = [2, 1, 3, 0]
5 = [2, 3, 1, 4, 0]
6 = [3, 2, 4, 1, 5, 0]
7 = [3, 4, 2, 5, 1, 6, 0]
8 = [4, 3, 5, 2, 6, 1, 7, 0]
9 = [4, 5, 3, 6, 2, 7, 1, 8, 0]
10 = [5, 4, 6, 3, 7, 2, 8, 1, 9, 0]
11 = [5, 6, 4, 7, 3, 8, 2, 9, 1, 10, 0]
12 = [6, 5, 7, 4, 8, 3, 9, 2, 10, 1, 11, 0]
And... no I still got it wrong for the odd max capacity where second soldier would end up on the left side of the first instead of the right side...
Edited by Bertilsson
Link to comment
Share on other sites

Did some testing and finally got it.

Cool! I'm glad that one got sorted out :)

 

Next up would be finding a way to get additional pawns to show up in a more controlled fashion, hm? :)

Maybe adding in something similar to what you did for the soldier spawn locations in the tactical game would be a good start, like putting in slotIdx % 2 somewhere downstream of LoadSoldierIntoSlot() perhaps.

Link to comment
Share on other sites

Well, sort of got it, I still had a few miles to go before figuring out the correct values for odd capacity numbers which must be this: :smile:

1 = [0]
2 = [1, 0]
3 = [1, 0, 2]
4 = [2, 1, 3, 0]
5 = [2, 1, 3, 0, 4]
6 = [3, 2, 4, 1, 5, 0]
7 = [3, 2, 4, 1, 5, 0, 6]
8 = [4, 3, 5, 2, 6, 1, 7, 0]
9 = [4, 3, 5, 2, 6, 1, 7, 0, 8]
10 = [5, 4, 6, 3, 7, 2, 8, 1, 9, 0]
11 = [5, 4, 6, 3, 7, 2, 8, 1, 9, 0, 10]
12 = [6, 5, 7, 4, 8, 3, 9, 2, 10, 1, 11, 0]
Edited by Bertilsson
Link to comment
Share on other sites

Next up would be finding a way to get additional pawns to show up in a more controlled fashion, hm? :smile:

Maybe adding in something similar to what you did for the soldier spawn locations in the tactical game would be a good start, like putting in slotIdx % 2 somewhere downstream of LoadSoldierIntoSlot() perhaps.

I think that replacing Unit6 with Unit0, Unit7 with Unit1... in SeqEvent_HQUnits.AddUnit will have that result.

It should be relatively easy to test... I will do that after fixing the fillorder tonight.

 

Edit: But putting soldiers on top of each other isn't really desirable until someone figures out how to offset them from that location.

 

Edit2: And on second thought, addUnit is probably never fed slot ID's above 5 so it will probably never reach case 6 where unit6 is assigned... So well... somewhere earlier in the chain is probably a better choice... Getting them on screen is in any case not a big problem, placing them outside the fixed locations is...

Edited by Bertilsson
Link to comment
Share on other sites

Edit: But putting soldiers on top of each other isn't really desirable until someone figures out how to offset them from that location.

 

Edit2: And on second thought, addUnit is probably never fed slot ID's above 5 so it will probably never reach case 6 where unit6 is assigned... So well... somewhere earlier in the chain is probably a better choice.

I think as soon as you get your hands on a soldier pawn reference (and after it has been placed initially) you should be able to call Move() on it to offset its position.

 

Edit: SetRelativeLocation() seems like a viable candidate, too, in case the soldier pawn is attached to some other actor (plinth?) via SetBase().

Edited by XMarksTheSpot
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...