• 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!

Fixing Models to Promotions

I never properly finished the code for those promotion models.
There's a lot of models and I didn't actually code them in yet,
except for the midshipmen and some character-specific ones.
If you could do that, it'd be absolutely great! :woot

Here's a short explanation of how the code works:
Code:
					switch(GetAttribute(pchar,"model"))
{
case "cnorrington": GiveModel2Player("Mdnorrington", true); break; // Norrington is promoted to higher-level Norrington
case "blaze": GiveModel2Player("47_Blaze_brtmds", true); break; // Nathaniel Hawk is promoted to higher-level Nathaniel
switch(rand(2)) // Any other character gets a random model upon promotion
{
case 0: GiveModel2Player("rn_mdshp18_1", true); break;
case 1: GiveModel2Player("rn_mdshp18_2", true); break;
case 2: GiveModel2Player("rn_mdshp18_3", true); break;
}
}
If you want to always give the same model upon promotion, try this:
Code:
					switch(GetAttribute(pchar,"model"))
{
case "cnorrington": GiveModel2Player("Mdnorrington", true); break; // Norrington is promoted to higher-level Norrington
case "blaze": GiveModel2Player("47_Blaze_brtmds", true); break; // Nathaniel Hawk is promoted to higher-level Nathaniel
GiveModel2Player("britmds_18", false); // Any other character gets this model (this one doesn't exist???)
}
 
I never properly finished the code for those promotion models.
There's a lot of models and I didn't actually code them in yet,
except for the midshipmen and some character-specific ones.
If you could do that, it'd be absolutely great! :woot

Here's a short explanation of how the code works:
Code:
					switch(GetAttribute(pchar,"model"))
{
case "cnorrington": GiveModel2Player("Mdnorrington", true); break; // Norrington is promoted to higher-level Norrington
case "blaze": GiveModel2Player("47_Blaze_brtmds", true); break; // Nathaniel Hawk is promoted to higher-level Nathaniel
switch(rand(2)) // Any other character gets a random model upon promotion
{
case 0: GiveModel2Player("rn_mdshp18_1", true); break;
case 1: GiveModel2Player("rn_mdshp18_2", true); break;
case 2: GiveModel2Player("rn_mdshp18_3", true); break;
}
}
If you want to always give the same model upon promotion, try this:
Code:
					switch(GetAttribute(pchar,"model"))
{
case "cnorrington": GiveModel2Player("Mdnorrington", true); break; // Norrington is promoted to higher-level Norrington
case "blaze": GiveModel2Player("47_Blaze_brtmds", true); break; // Nathaniel Hawk is promoted to higher-level Nathaniel
GiveModel2Player("britmds_18", false); // Any other character gets this model (this one doesn't exist???)
}

oh ye i noticed i was spellin it britmds when its brtmds and sorted it. with the first example no uniform is ever given is that cos rn_mds18_1 model doesn't exist? i cant find it anywhere.

What i was thinkin of doin is givin the specific uniform for specific promotions eg midshipman, Lt, cpt and admiral then givin soldier uniforms for 2nd Lt and so on. with higher rank you would get more ppl under your command in real life so with lower ranks il give salor uniforms and higher ranks soldier uniforms so you can dress your crew up


with the switch(rand(2)) line does the 2 represent the highest case?
would this be correct

case 1: // Midshipman
switch(GetAttribute(pchar,"model"))
/*{
case "cnorrington": GiveModel2Player("Mdnorrington", true); break;
case "blaze": GiveModel2Player("47_Blaze_brtmds", true); break;
switch(rand(3))
{
case 0: GiveModel2Player("brtmds1_18", true); break;
case 1: GiveModel2Player("brtmds2_18", true); break;
case 2: GiveModel2Player("brtmds3_18", true); break;
case 3: GiveModel2Player("brtmds4_18", true); break;
}
}*/
 
Code:
				case 1: // Midshipman
switch(GetAttribute(pchar,"model"))
{
case "cnorrington": GiveModel2Player("Mdnorrington", true); break;
case "blaze": GiveModel2Player("47_Blaze_brtmds", true); break;
switch(rand(3))
{
case 0: GiveModel2Player("brtmds1_18", true); break;
case 1: GiveModel2Player("brtmds2_18", true); break;
case 2: GiveModel2Player("brtmds3_18", true); break;
case 3: GiveModel2Player("brtmds4_18", true); break;
}
}
You mean?

If you put /* */ around a section of code it makes that code NOT HAPPEN!
The switch (rand(3)) would get a random number between 0 and 3, and then would make that case happen (eg if random number is 2 then you would be given "brtmds3_18")...
It only does this random number if:
a) your character model isnt cnorrington
b) your character model isnt blaze
 
Code:
				case 1: // Midshipman
switch(GetAttribute(pchar,"model"))
{
case "cnorrington": GiveModel2Player("Mdnorrington", true); break;
case "blaze": GiveModel2Player("47_Blaze_brtmds", true); break;
switch(rand(3))
{
case 0: GiveModel2Player("brtmds1_18", true); break;
case 1: GiveModel2Player("brtmds2_18", true); break;
case 2: GiveModel2Player("brtmds3_18", true); break;
case 3: GiveModel2Player("brtmds4_18", true); break;
}
}
You mean?

If you put /* */ around a section of code it makes that code NOT HAPPEN!
The switch (rand(3)) would get a random number between 0 and 3, and then would make that case happen (eg if random number is 2 then you would be given "brtmds3_18")...
It only does this random number if:
a) your character model isnt cnorrington
b) your character model isnt blaze


lol ye thats why it didnt work, its workin fine now. now is there a way to get dif uniforms dependin on the in game year? cos there is no point givin a soldier uniform that doesnt fit into the eara of the dif campagns. maybe if not the year then dif uniforms dependin on witch campaign is bein played


Iv set the officers uniforms up for england,spain and france but i cant find any for holland and portugal, have they not bin made yet?
 
This line of code will give you the soldier models for era your in
Code:
Nations[ENGLAND].fantomModel.m1
Of course ENGLAND needs to be changed depending on nation and the number at the end is a number between 1-6 (for all 6 period model uniforms)

Also when doing the code it is
Code:
GiveModel2Player(Nations[ENGLAND].fantomModel.m1, true);
so no "" around the model name :yes

The Holland officers are: Offic_Hol_*per* and the same for Portugal but Offic_Pol_*per* (I dont think all periods are there for them though and that is just the basic officers not Admiral or anything) :no
 
This line of code will give you the soldier models for era your in
Code:
Nations[ENGLAND].fantomModel.m1
Of course ENGLAND needs to be changed depending on nation and the number at the end is a number between 1-6 (for all 6 period model uniforms)

Also when doing the code it is
Code:
GiveModel2Player(Nations[ENGLAND].fantomModel.m1, true);
so no "" around the model name :yes

The Holland officers are: Offic_Hol_*per* and the same for Portugal but Offic_Pol_*per* (I dont think all periods are there for them though and that is just the basic officers not Admiral or anything) :no

I dont understand this code
Code:
GiveModel2Player(Nations[ENGLAND].fantomModel.m1, true);
Where would you put the period number and model name? could you give me an example plez oh and are the officer uniforms goin to be made for Holland and Portugal at some point?
 
You dont, there is a bit of code set up that the statement I just gave you will get model 1 for ENGLAND in ANY period, you change the 1 to any number between 1-6 to get the other models for that period :shrug

I dont have a clue Im afraid
 
You dont, there is a bit of code set up that the statement I just gave you will get model 1 for ENGLAND in ANY period, you change the 1 to any number between 1-6 to get the other models for that period :shrug

I dont have a clue Im afraid

oh ok i get ya, when you said dont put "" around the model name i thought i needed to add a model name lol

Well thats done and workin, not too bad to say iv bin modin for all of 2 days lol. now what i wanted to do with the ships i think might be outa my league. i wanted to give ships to the player on promotion but have the option of sayin no so if the player already has a bigger ship they dont have to take it. im guessin i will have to mess about with the dialog and stuff, is it worth me givin it a try?
 
The ship part is already more-or-less done with the shipyards.
You can only buy high-class navy vessels if you've got the correct navy rank.
If you want to actually GIVE to the player, you'll need to mess around with the dialog code.
Not too difficult, but personally I'm more interested in the model-assignment code being finished. ;)
Be sure to upload your work once you're on a point you're happy with. :yes

And thanks a lot for working on this. Definitly a good job after two days of coding. :onya
 
The ship part is already more-or-less done with the shipyards.
You can only buy high-class navy vessels if you've got the correct navy rank.
If you want to actually GIVE to the player, you'll need to mess around with the dialog code.
Not too difficult, but personally I'm more interested in the model-assignment code being finished. ;)
Be sure to upload your work once you're on a point you're happy with. :yes

And thanks a lot for working on this. Definitly a good job after two days of coding. :onya

i totaly forgot about the rank restritions lol, il just leave that alone then.
im happy with it i just wish i could have added a wider variety of uniforms for the soldiers, as it is there are afew salors and specific period soldier uniforms oh and cors the Midshipman and so on. iv attached the NK file, if you want me to change or add anythin just tell me and il give it a go for ya

i dont think the attachmant work for some resone, how should i upload it?
 
Ill add you to group "modders" which gives you a lot more attachment size :yes

Correct me if Im wrong but I thought when you became a officer for a nation it automatically gave your crew there soldier uniform? :?
 
Ill add you to group "modders" which gives you a lot more attachment size :yes

Correct me if Im wrong but I thought when you became a officer for a nation it automatically gave your crew there soldier uniform? :?

if you set the bourdin option to soldier then when you bourd a ship there in uniform but you dont have the uniform for your officers or the crewmen you can take ashore with you. the way iv done it gives the player it so he can wear it himself or equip it on his officers/crewmen.
 
I can think of a way to make it so that your crewman get the uniform by default, which I think is probably a better way to handle it as then it doesnt clutter up your outfit menu :shrug

The code needed to pull it off is just
Code:
				Characters[GetCharacterIndex("Crewmember_01")].model = Nations[ENGLAND].fantomModel.m1;
Characters[GetCharacterIndex("Crewmember_01")].headmodel = Nations[ENGLAND].fantomModel.m1;
Characters[GetCharacterIndex("Crewmember_03")].model = Nations[ENGLAND].fantomModel.m3;
Characters[GetCharacterIndex("Crewmember_03")].headmodel = Nations[ENGLAND].fantomModel.m3;
Characters[GetCharacterIndex("Crewmember_04")].model = Nations[ENGLAND].fantomModel.m4;
Characters[GetCharacterIndex("Crewmember_04")].headmodel = Nations[ENGLAND].fantomModel.m4;
Characters[GetCharacterIndex("Crewmember_05")].model = Nations[ENGLAND].fantomModel.m5;
Characters[GetCharacterIndex("Crewmember_05")].headmodel = Nations[ENGLAND].fantomModel.m5;
pchar.boardingmodels = "Soldiers";                                      //change the boarding model in fights
 
I can think of a way to make it so that your crewman get the uniform by default, which I think is probably a better way to handle it as then it doesnt clutter up your outfit menu :shrug

The code needed to pull it off is just
Code:
				Characters[GetCharacterIndex("Crewmember_01")].model = Nations[ENGLAND].fantomModel.m1;
Characters[GetCharacterIndex("Crewmember_01")].headmodel = Nations[ENGLAND].fantomModel.m1;
Characters[GetCharacterIndex("Crewmember_03")].model = Nations[ENGLAND].fantomModel.m3;
Characters[GetCharacterIndex("Crewmember_03")].headmodel = Nations[ENGLAND].fantomModel.m3;
Characters[GetCharacterIndex("Crewmember_04")].model = Nations[ENGLAND].fantomModel.m4;
Characters[GetCharacterIndex("Crewmember_04")].headmodel = Nations[ENGLAND].fantomModel.m4;
Characters[GetCharacterIndex("Crewmember_05")].model = Nations[ENGLAND].fantomModel.m5;
Characters[GetCharacterIndex("Crewmember_05")].headmodel = Nations[ENGLAND].fantomModel.m5;
pchar.boardingmodels = "Soldiers";                                      //change the boarding model in fights

So this code would change the on shore crewmen to soldiers, the guys you get by askin a crewman on board your ship for help on land. Cos at the moment these guys come with normal salor models and no weapons, you have to give them weapons and uniforms.
 
Sorry bout the double post but iv had to fix afew minor things, should be fine now.

all that code did was change the crew models when boardin a ship and attackin a fort into nathan hawks lol prity funny watchin 6 nathan hawks runnin around. maybe i didnt put it in the right place or somethin, i placed it in the midshipman section of the NK. from what i can tell tho this code is supost to do the same thing the Boardin advanced options does all ready so i dont think there is any point tryin to work it in
 
Sorry bout the double post but iv had to fix afew minor things, should be fine now.

all that code did was change the crew models when boardin a ship and attackin a fort into nathan hawks lol prity funny watchin 6 nathan hawks runnin around. maybe i didnt put it in the right place or somethin, i placed it in the midshipman section of the NK. from what i can tell tho this code is supost to do the same thing the Boardin advanced options does all ready so i dont think there is any point tryin to work it in
Well then the boarding models isnt "soldiers" its something else then. What about changing your crew though :wacko:

EDIT: I was wrong with soldiers it is in fact "soldier" :facepalm
 
You do know that your code does need to include the
Code:
switch(GetAttribute(pchar,"model"))
at the top before you add the cases :facepalm
 
You do know that your code does need to include the
Code:
switch(GetAttribute(pchar,"model"))
at the top before you add the cases :facepalm

This is how my Midshipman promotion is set out -

case 1: // Midshipman
switch(GetAttribute(pchar,"model")) << is this the switch(GetAttribute(pchar,"model")) code your talkin about?
{
case "cnorrington": GiveModel2Player("Mdnorrington", true); break;
case "blaze": GiveModel2Player("47_Blaze_brtmds", true); break;
switch(rand(3))
{
case 0: GiveModel2Player("brtmds1_18", true); break;
case 1: GiveModel2Player("brtmds2_18", true); break;
case 2: GiveModel2Player("brtmds3_18", true); break;
case 3: GiveModel2Player("brtmds4_18", true); break;
}
}
GiveModel2Player("sailor10", false);
GiveModel2Player("sailor19", false);
GiveModel2Player(Nations[ENGLAND].fantomModel.m1, false);
Characters[GetCharacterIndex("Crewmember_01")].model = Nations[ENGLAND].fantomModel.m1;
Characters[GetCharacterIndex("Crewmember_01")].headmodel = Nations[ENGLAND].fantomModel.m1;
Characters[GetCharacterIndex("Crewmember_03")].model = Nations[ENGLAND].fantomModel.m3;
Characters[GetCharacterIndex("Crewmember_03")].headmodel = Nations[ENGLAND].fantomModel.m3;
Characters[GetCharacterIndex("Crewmember_04")].model = Nations[ENGLAND].fantomModel.m4;
Characters[GetCharacterIndex("Crewmember_04")].headmodel = Nations[ENGLAND].fantomModel.m4;
Characters[GetCharacterIndex("Crewmember_05")].model = Nations[ENGLAND].fantomModel.m5;
Characters[GetCharacterIndex("Crewmember_05")].headmodel = Nations[ENGLAND].fantomModel.m5;
pchar.boardingmodels = "Soldier";
break;

Iv changed the soldiers to soldier but it didn't change anything, it is still multiple nathan hawks. Have i done somthin wrong? oh and to your other question no it did nothin to the crewman that go ashore.
 
I know the two things that need to be changed, soldier gets your nation flag your flying. Therefore if its PERSONAL it will be Nathanial, needs to be ENGLAND for the English soldiers.

I know for a fact that some of the crewman are now English soldiers but not all. Do the same thing as the headmodel and model but this time include Treas_Crewmember_1 to Treas_Crewmember_10 as well as the crewmember_01 to 05. Oh and why are you still giving yourself the soldier outfit? :wacko:

Yes that is the switch and it needs to be at the top above every case you get that has multiple models it can be
 
Back
Top