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

Solved Questions from the current build 4.1 of July

maybe, need to look into it
 
It is the line to set AI group relations.
Just need to find the relevant group ID and the function call.
 
On the subject of console codes, are there codes to:

1) give the officer in the first slot 1 perk point

2) give the officer in the first slot a checkmark to increase skill gain in a given skill

Just in the meantime before a fix, I want to correct these thing manually, at least make a couple of officers I found a little less disadvantaged.
 
On the subject of console codes, are there codes to:

1) give the officer in the first slot 1 perk point

2) give the officer in the first slot a checkmark to increase skill gain in a given skill

Just in the meantime before a fix, I want to correct these thing manually, at least make a couple of officers I found a little less disadvantaged.

To add a perk point
I think it should be something like this (I believe 0 returns the mainchar so the index should be 1):
Code:
Officer = &characters[GetOfficersIndex(pchar,1)];
Officer.perks.FreePoints = sti(Officer.perks.FreePoints)+1;

The checkmark isn't broken I believe, its just not that common to find one with a checkmark and not all should have 2 but if you still want to add it.
To add a checkmark you should do this (change SKILLNAME to the name of the skill you want to give him a checkmark):
Code:
Officer = &characters[GetOfficersIndex(pchar,1)];
Officer.skill.SKILLNAME.bonus = 1.25;
 
I misunderstood then, I thought the checkmark wasn't detecting nationality or something? That french officer I had had the wrong checkmarks for his nationality, and the 6 or 7 officers that offered their services to me afterwards all did not have a checkmark. Maybe I'm just unlucky. ;)

Thanks so much for the console codes Levis! So nice of you!
 
There is something fishy going on but I think that is because the officer doesn't have a nation set :p. so they just get something at random.
 
@Levis

Thanks again for the help. I tried executing the console using the code you gave me like this (adding it to bottom of the first few lines, and leaving the many cases of preprepared code alone beneath it, so like below), but it doesn't seem to work (I don't even get the message "console executed"). Could you point me to what I am doing wrong?

ref pchar = GetMainCharacter();
ref ch;
int i;
int limit;
Officer = &characters[GetOfficersIndex(pchar,0)];
Officer.perks.FreePoints = sti(Officer.perks.FreePoints)+1;

Am I doing something wrong? Should I delete the stuff below this, or change any of it?
 
Last edited:
ah my fault. if you look at the errorlog it will probably tell already what is wrong.
it should say:
Code:
ref Officer = &characters[GetOfficersIndex(pchar,0)];

I had to type it from the top of my head so mistakes are possible :p.
 
Thanks so much Levis! So nice of you to help me! :)

By the way, could I ask one more question

I wanted to reduce the influence of item bonuses on skills, specifically to make it so you need +3 in item bonuses to get +1 to the skill, so I inserted a line mod = mod /3 right before the clamp for max skill increase in skill_utils:


mod = mod / 3
mod = iclamp(-100, MAX_SKILL_INCREASE, mod); //JRH for cursed coin
character.skill.(skillName).modifier = mod;
return mod;

It seems to work for what I wanted , but I wanted to get your opinion that I won't brake anything doing this? I know absolutelly nothing about programing, and I'm kind of worried that dividing by 3 will sometimes return non integer values (it seems to round down in game like it should though)? Or otherwise break something in the game by reducing item bonuses to a third?

Sorry if this is a dumb question. ;)
 
Last edited:
Thanks so much Levis! So nice of you to help me! :)

By the way, could I ask one more question

I wanted to reduce the influence of item bonuses on skills, specifically to make it so you need +3 in item bonuses to get +1 to the skill, so I inserted a line mod = mod /3 right before the clamp for max skill increase in skill_utils:


mod = mod / 3
mod = iclamp(-100, MAX_SKILL_INCREASE, mod); //JRH for cursed coin
character.skill.(skillName).modifier = mod;
return mod;

It seems to work for what I wanted , but I wanted to get your opinion that I won't brake anything doing this? I know absolutelly nothing about programing, and I'm kind of worried that dividing by 3 will sometimes return non integer values (it seems to round down in game like it should though)? Or otherwise break something in the game by reducing item bonuses to a third?

Sorry if this is a dumb question. ;)
I sugest not doing this. I sugest instead you look at the item init, each item has a number of items it needs. Just up this number for the items you think are OP. Or else in the code there change the number needed to be times 3.
 
I thought about that, but mainly I find getting items not too hard, so requiring 3 is just going to be a couple of extra shopping trips. Mainly, I want people to have to work to have a variety of items to support their abilities (multiple books, etc), but not be able to get over +1, so the focus is on their own abilities and they don't get close to the max too soon (I usually just sell the indian artifacts and minerals, so using only realistic stuff the max bonus with /3 is +1 in everything, except navigation which can get +2)

Is your concern based only on game balance, or on the code messing something up? Because if implementing it like that might bug the game out, I will just change the max skill increase to +1 and roleplay needing the other items....I don't want to mess up the game. So far it hasn't caused problems that I've noticed, but I just edited it a couple of hours ago. Do you think it will create bugs?
 
I thought about that, but mainly I find getting items not too hard, so requiring 3 is just going to be a couple of extra shopping trips. Mainly, I want people to have to work to have a variety of items to support their abilities (multiple books, etc), but not be able to get over +1, so the focus is on their own abilities and they don't get close to the max too soon (I usually just sell the indian artifacts and minerals, so using only realistic stuff the max bonus with /3 is +1 in everything, except navigation which can get +2)

Is your concern based only on game balance, or on the code messing something up? Because if implementing it like that might bug the game out, I will just change the max skill increase to +1 and roleplay needing the other items....I don't want to mess up the game. So far it hasn't caused problems that I've noticed, but I just edited it a couple of hours ago. Do you think it will create bugs?

If you want the mod to be a fraction some more has to be changed because now internally this is handled as a integer (so a rounded number) and if you are going to store it as a float (a fractal number) I don't know for sure if anything is going to break somewhere ...

iclamp will always make it an int again so if the mod was 2/3 for example it would still be 0 in the end ...
 
Interesting, thanks for explaining that! So iclamp will make it an integer, and then there won't be any bugs? Perfect!

That is exactly what I want--you need 3 different +1 items to get +1, so rounding down is great.
 
@Levis

Another couple of quick questions if it is ok. :) I tried to prepare the console codes myself, but need your advice.

First, I am trying to remove the auto bought perks. I tried this:

characters[GetOfficersIndex(pchar,1)].perks.list.BasicCommerce = false;

It didn't work sadly, the perk remains. I tried switching "false" to "true", and using it on a different officer, and it did add the perk, so I am not sure where I am going wrong.

Second, I want to set my hp bonus to 0 to remove the mist effects on my character, but allow myself to later gain HP bonus for the apothecary or other means if I want. This seems to set it to 0 fine, just want to make sure it shouldn't cause other problems?
DeleteAttribute(pchar, "HPBonus");

Thanks so much Levis!
 
deleting HPBonus shouldn't be a problem.
Also to remove the perk basic commerce you need to remove that attribute aswell.
I don't know from the top of my head anymore if you can just do
DeleteAttrbibte(Character,"attribute.subattribute.deletethisone");
So test it please, if that don't work you need to do it like this:

Code:
ref perklist = makearef(characters[GetOfficersIndex(pchar,1)],"perks.list");
Deleteattribute(perklist,"BasicCommerce");
 
Thanks so much!

How do I tell if it is working to remove the "attribute?" I don't actually know what that is, I am pretty ignorant of coding stuff.

EDIT: Also, the code you placed at the bottom, so if I use that to delete the attribute then I don't also need to delete the perk itself by setting it to false, or I need to do both? Sorry I am so confused by thee things!
 
Thanks so much!

How do I tell if it is working to remove the "attribute?" I don't actually know what that is, I am pretty ignorant of coding stuff.

EDIT: Also, the code you placed at the bottom, so if I use that to delete the attribute then I don't also need to delete the perk itself by setting it to false, or I need to do both? Sorry I am so confused by thee things!
you don't have to set it to false.

and to answer your first question, you know it worked if only that single perk is removed. If all perks are removed (or more likely the game crashes) you know something went wrong ;).
 
btw in the past I made a start with this:
New Horizons Modding | PiratesAhoy!

maybe that helps you :), it exaplains a bit out potc modding. If you want to start modding I sugest reading the simple coding tutorial at least.
I will try to improve the tutorials later, but if you let me know what you are missing I can write more focussed :).
 
Thanks Levis!

I have been reading your tutorials, they are great. :) I will continue working through them, and trying to figure things out first and asking questions after if I get stuck. Thank you for being patient with my ignorance of computers. :)
 
Thanks Levis!

I have been reading your tutorials, they are great. :) I will continue working through them, and trying to figure things out first and asking questions after if I get stuck. Thank you for being patient with my ignorance of computers. :)
Oh believe me, in my line of work I've learned to be patient with people who use computers. If I wasn't a lot of people would have been send to a course about "using computers for dummys" a long time ago already XD.
 
Back
Top