<!--quoteo(post=151209:date=Jun 16 2006, 01:02 AM:name=Hook)--><div class='quotetop'>QUOTE(Hook @ Jun 16 2006, 01:02 AM) [snapback]151209[/snapback]</div><div class='quotemain'><!--quotec-->
The line that sets crew.quantity to boarding_player_crew was added, probably by Maximus, in the June 11 2006 update. I think it was an attempt to reduce your crew by the losses you incurred in boarding, but boarding_player_crew isn't where these losses are recorded. I'm still searching for where they are.
<!--QuoteEnd--></div><!--QuoteEEnd-->
As far, as I can see, they are not recorded directly. There are two relevant variables:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->
// The amount of crewmembers boarding on each deck
boarding_player_crew
// A factor for calculating ship.crew.quantity after boarding
boarding_player_crew_per_chr
<!--c2--></div><!--ec2-->
Her are the relevant code-pieces:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->
void LAi_StartBoarding(int locType, ref echr, bool isMCAttack)
{
...
// ship.crew.quantity of PChar
int mcrew = GetCrewQuantity(mchr);
...
// ship.crew.quantity of enemy
int ecrew = GetCrewQuantity(echr) + 1;
...
float curplayercrew = mcrew;
...
// Here the quantity of the boarding crew is calculated
float rel;
if(mcrew > ecrew)
{
if(mcrew > maxcrew)
{
rel = mcrew/maxcrew;
mcrew = maxcrew;
ecrew = MakeInt(ecrew/rel + 0.5);
}
}else{
if(ecrew > maxcrew)
{
rel = ecrew/maxcrew;
ecrew = maxcrew;
mcrew = MakeInt(mcrew/rel + 0.5);
}
}
...
boarding_enemy_crew = ecrew;
...
boarding_player_crew = mcrew;
...
// and the scaling factors
// (note that curplayercrew is the same as PChar.ship.crew.quantity!)
boarding_player_crew_per_chr =
(curplayercrew + boarding_officers + 1)/(mcrew + boarding_officers + 1);
boarding_enemy_crew_per_chr =
boarding_enemy_base_crew/ecrew;
...
}
<!--c2--></div><!--ec2-->
boarding_player_crew sinks with each deck, you fight. You need not know the losses, you just need to knw, how many crewmembers left with you on boarding.
<!--quoteo(post=151209:date=Jun 16 2006, 01:02 AM:name=Hook)--><div class='quotetop'>QUOTE(Hook @ Jun 16 2006, 01:02 AM) [snapback]151209[/snapback]</div><div class='quotemain'><!--quotec-->
There's another function that's called in that file, SetCrewQuantity(), which should be the proper place to adjust the crew numbers, but it always causes an error for too many crewmembers... then sets the crewmembers to max.
<!--QuoteEnd--></div><!--QuoteEEnd-->
That's because the piece of code with the for-loop I previously posted calculates boarding_player_crew new. But I think, it doesn't work properly, because it sets too many boarding crewmembers (in my case: 1st deck 10, next deck 49).
After boarding, there's a call to SetEndingStats(), where ship.crew.quantity is recalculated:
<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->
void SetEndingStats()
{
...
// That of course gets you over maximum, if boarding_player_crew gets
// higher during boarding as happens in the previously posted for-loop
crew = (boarding_player_crew + boarding_officers + 1)
* boarding_player_crew_per_chr;
// That's some weird arithmetic, that sets your crew quantity at
// least to 80% of before boarding, if you had more crew than
// enemy at boarding start
if(boarding_player_crew_per_chr>boarding_enemy_crew_per_chr)
{
while(crew < (GetCrewQuantity(PlayerChar)*0.8))
{
...
}
}
...
// There was another line, to recalculate crew quantity, if you lost more
// than 20 crewmembers of ship (not boarding!). I took that out.
if(crew < (GetCrewQuantity(PlayerChar)-20))
{
crew = crew +
(((GetCrewQuantity(PlayerChar)-crew)/2) +
rand(makeint((GetCrewQuantity(PlayerChar)-crew)/2)));
...
}
...
// And here is the line, that sets the new ship.crew.quantity:
if(!IsFort)
{
SetCrewQuantity(PlayerChar, makeint(crew + 0.5));
}
...
}
<!--c2--></div><!--ec2-->
I played yesterday a lot with the changes I made and the crew amount after boardings seemed ok for me. I can send you the changed file, if you like. Or someone tell me the new public ftp-data.
<img src="style_emoticons/<#EMO_DIR#>/par-ty.gif" style="vertical-align:middle" emoid="
" border="0" alt="par-ty.gif" />