• New Horizons on Maelstrom
    Maelstrom New Horizons


    Visit our website www.piratehorizons.com to quickly find download links for the newest versions of our New Horizons mods Beyond New Horizons and Maelstrom New Horizons!

import/export

skeletor9000

Landlubber
I would like to edit the import/export table so that slaves are an export of certain colonies. I have enabled the `slave-trading` with `hell-angel`'s mod. Does this table even exist anymore or has it all become dynamic according to how much of a certain good that a colony has? Also, if any `code-junkies` are reading this I'd like to know if there is any way that I could make it so there's a random chance that any crew you take off of a captured ship are "too unruly" and become slave cargo. Any help would be appreciated.
 
more specifically...

When I ask about the random chance of crew from captured ships, I'm referring to the following code area in the Program/Interface/Transfer_crew.c file... The following bit is from the slavery mod:

Code:
void ProcessChangeLeft()

{

if(GetCrewQuantity(refEnemyCharacter)<=0) return;

if(GetMaxCrewQuantity(refMyCharacter)<=GetCrewQuantity(refMyCharacter)) return;

AddCharacterGoods(&Characters[0],GOOD_SLAVES,1);

RemoveCharacterCrew(refEnemyCharacter,1);

WasChangeData();

}

Compare the following bit from the build...

Code:
void ProcessChangeLeft()

{

if(GetCrewQuantity(refEnemyCharacter)<=0) return;

if(GetMaxCrewQuantity(refMyCharacter)<=GetCrewQuantity(refMyCharacter)) return;

// boal min crew on ship --> NK

if(nCompanionIndex >= 0)

{

 if(GetCrewQuantity(refEnemyCharacter) <= GetMinCrewQuantity(refEnemyCharacter) && GetCrewQuantity(refEnemyCharacter) + GetCrewQuantity(refMyCharacter) > GetMinCrewQuantity(refMyCharacter) + GetMinCrewQuantity(refEnemyCharacter))

 {

 PlaySound("interfaceknock.wav");

 GameInterface.strings.Mincrewwarn = "Min crew reached!"; // NK

 return;

 }

}

GameInterface.strings.Mincrewwarn = ""; // NK

// boal min crew on ship <-- NK

AddCharacterCrew(refMyCharacter,1);

RemoveCharacterCrew(refEnemyCharacter,1);

WasChangeData();

}

It seems to me that someone with rudimentary code knowledge (something that I don't have yet) would be able to insert the "add slave" bit along with a random chance variable into the build code. If anyone with the inclination could post or explain how to fix this code, I'd be really grateful. Thanks a bunch. :cheers
 
won't that make EVERY crew member i take turn into a slave? What I'd like to do is randomly assign it. So that there's something like a 30% chance that the crew member is turned into a slave. Is there a way to do that?
 
Replace AddCharacterCrew(....
with:

Code:
if(frnd() > 0.3) { AddCharacterCrew(refMyCharacter,1); }

else { AddCharacterGoods(&Characters[0],GOOD_SLAVES,1); }
 
wonderful! thanks so much, NK. Sorry to bug you so much. But you're quicker than "teaching myself C in 21 days". Thanks a million.
 
You're quite welcome, I'm happy to help.
Especially with specific questions. :cheers

But, you'd be surprised, it doesn't take that much work to pick this stuff up--give it a try, you may like it. :cheeky
(Then again, you _have_ started already. :onya )
 
Back
Top