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

Fixed Character Skill Importances Missing

A.H

Privateer
I found some weird stuff like "Importance" attribute missing.. something with my character's leveling system.
 

Attachments

  • error.log
    4.9 KB · Views: 330
I found some weird stuff like "Importance" attribute missing.. something with my character's leveling system.
Still happening despite our efforts? :(

Maybe now that @Levis has been seen in these waters again, he could have a look at it?
 
@A.H: do you have any odd officer types, e.g. "Civilian"?

Looking at "PROGRAM\Characters\Officetypes.c", "OFFIC_TYPE_CIVILIAN" has no skills with an "importance" attribute".

What's the significance of the "importance" attribute anyway? Several officers have skill contribution ratings of 0 but "importance" at a higher rating; "OFFIC_TYPE_SAILOR", for example, can't contribute anything but has "importance" set for "Sailing", "Repair" and "Sneak".
 
Yes 1 civilian which I captured.
Please check save file, as well as their salary in Character tab.. both officers (captured captains) have salary of 1, while one of them is citizen.
 

Attachments

  • -=Player=- QuickSave.zip
    1.5 MB · Views: 282
  • error.log
    5.3 KB · Views: 270
  • compile.log
    58.4 KB · Views: 265
Importance controls what skills NPCs get when they level up.

Captains should not ever be Civilians. If they are, that might indeed be a hint on what is wrong.

Please make a save prior to boarding any ship whenever you can.
And when it happens, please mention what kind of ship it is: Quest ship, Governor Ship Hunting ship, Coast Raider or Worldmap/DirectSail Encounter.
 
Pre-boarding a Raa Frigate... on a personal frog patrol of my own :p

I also noticed my crew gets wiped from 1 hit... my captain is also very weak, but my soldiers die instantly from 1 attack although I have guns & swords & antidotes on board
 

Attachments

  • -=Player=- QuickSave.zip
    1.6 MB · Views: 272
  • compile.log
    303.6 KB · Views: 274
  • error.log
    12.8 KB · Views: 265
Make sure you kill as many enemy crew as possible before boarding.
 
  • Like
Reactions: A.H
I can take a look at this but it will be a while as I'm off on vacation on Friday and I suspect before then I'm mostly busy with looking what you guys did in the meantime.
 
from what I can see from the logs:

Code:
XP ERROR: No officertype assigned to: Abizellus Perdiguero now set to: civilian

So it seems something goes wrong indeed.
This seems to be the character dump for this character:
Code:
ERROR: missing skillfactor for type error and skill Grappling
index = 1469
id = Enc_Officer_3
model = 9jdspa
  entity = NPCharacter
  animation = man
  height = 1.8000000
location = none
  locator = aloc0
  group = rld
  from_sea = Oxbay_port
  stime = 0.0000000
  etime = 24.0000000
chr_ai = 
  group = player
  hp_max = 116.0000000
  hp = 116.0000000
  dmgbldmin = 21.0000000
  dmgbldmax = 27.0000000
  piercing = 0.4000000
  block = 0.3000000
  login = 1
  alarmreact = 1
  grpalarmr = 1
  charge = 0
  chargeprc = 1
  type = officer
  tmpl = follow
    follow = 0
    state = falure
    time = 0
    wait = 0
    timeout = -1.0000000
crmonth = 1
crday = 25
nation = 2
  name = 2
  known = -2
quest = 
  officerprice = 396
  meeting = 
sex = man
faceid = 278
headmodel = h_9jdspa
name = Abizellus
lastname = Perdiguero
old = 
  name = Abizellus
  lastname = Perdiguero
  chr_ai = 
    group = player
rank = 8
items = 
  bladec2 = 1
equip = 
  blade = bladeC2
skill = 
  leadership = 3
    shipclass = 7
    fleetsize = 1
    importance = 68
    bonus = 1.0000000
    charmod = -1
  freeskill = 0
  fencing = 3
    importance = 409
    bonus = 1.0000000
    shipclass = 7
    fleetsize = 1
    charmod = 0
  sailing = 4
    importance = 163
    bonus = 1.0000000
    shipclass = 7
    fleetsize = 1
    charmod = 0
  accuracy = 2
    importance = 225
    bonus = 1.0000000
    shipclass = 7
    fleetsize = 1
    charmod = 0
  cannons = 2
    importance = 98
    bonus = 1.0000000
    shipclass = 7
    fleetsize = 1
    charmod = 0
  grappling = 3
    importance = 406
    bonus = 1.0000000
    shipclass = 7
    fleetsize = 1
    modifier = 0
    officertype = deck fighter
    charmod = -1
  repair = 3
    importance = 104
    bonus = 1.0000000
    shipclass = 7
    fleetsize = 1
    charmod = 0
  defence = 3
    importance = 252
    bonus = 1.0000000
    shipclass = 7
    fleetsize = 1
    charmod = 0
  commerce = 3
    importance = 138
    bonus = 1.0000000
    shipclass = 7
    fleetsize = 1
    charmod = 0
  sneak = 3
    importance = 106
    bonus = 1.0000000
    shipclass = 7
    fleetsize = 1
    charmod = 0
experience = 65550
  leadership = 4713
  fencing = 5250
  sailing = 6690
  accuracy = 4668
  cannons = 1377
  grappling = 4972
  repair = 1902
  defence = 1777
  commerce = 2793
  sneak = 1459
money = 0
loyality = 6
alignment = good
homelocation = Oxbay
  group = 
  locator = 
homestate = citizen
skillimportancetotal = 1969
officerprice = 0
fakelevels = 0
bonussetup = 1
lastsailstate = 2
flags = 
locdate = 1714
perktypes = 281
  combat = 25
  sailing = 40
  sea combat = 26
  sea defence = 31
  boarding = 22
  merchant = 30
  daring = 30
  party = 27
  repair = 30
  misc = 20
  highest = 1
after_1st_sailto = 1
playernation = 1
playership = Model_BrigRoyal
delayedxp = 
oldnation = 2
surrendered = 1
  seatime = 1467
  oldgroup = CrOxbay5
status = dead
position = captive
fight = 0
wealth = 933
dialog = 
  filename = Enc_Officer_dialog.c
    debug = Debug.c
  currentnode = Hired
  lines = 3
  tempnode = first time
greeting = Gr_Officer_m common
charmods = 
  leadership = 
    surrender = -1
      desc = This captain surrendered
  grappling = 
    surrender = -1
      desc = This captain surrendered
loadeddialog = 
  filename = Cabinfight_dialog.c
  filename0 = Debug.c
actions = 
  dead = 
    d1 = death_citizen_1
    d2 = death_citizen_2
friend = 1
nofollowtype = nofollow
skillsetup = deck fighter
perks = 
  freepoints = 7
  list = 
completeinit = 1
passenger = 1

strange thing here I find is there is an officertype set, but its set inside the grappling skill instead of the quest branch. So maybe there is the problem?
I do not know how it has gotten there. I don't have the game code at work here so I can't check but maybe this can point someone in the right direction?
I looks to me like the character is first set up right, but after the capture (the create twincharacter which happens there maybe?) something goes wrong and the officertype is being removed. I think this because I do see the -1 which is set to the abilities after capture. and there aren't any error before this, and else this should have been the case during the init of the character when encountering the ship. So the problem has to lie somewhere round the creation of the twin character after the ship is captured and the captain is placed on deck.
Maybe this can point @Pieter Boelen or someone else int he right direction.
 
There is a chance it is related to this: High Priority - Levelling: Some Captains Not Correctly Initialized until Too Late | PiratesAhoy!
I did some tweaking around there to get it better, but it might require some further changes?
Probably that is the case. And the problem here is mostly it's just to damn complicated at the moment.
I believe this isn't a game breaking bug at the moment. If people don't mind I wanna take this one up. But it has to wait two weaks untill I can look at this. But then I will handle it correctly and make sure it isn't a mess anymore (Read: just remove the whole creation of a twin character and making sure the captain is placed on the deck as he is).
 
I think if this were to be done, it would also help substantially in reducing the related mess in captain generation:
Planned Feature - Use Generic Captain and Ship Generation Functions | PiratesAhoy!
Well in two weeks (or so) I wanna start on this. Next week I'm off and I wont read anything here, but till then we have time to discuss on what needs to be taken into account. So feel free to start the discussion. If I'm going to fix it, better do it well. And I imagine not many people here dare to undertake such rewrites of codes so I have to do it else it wont happen :p.
 
Sounds like you'll be starting then when I go on holiday myself.
With a bit of luck, I'll occasionally have access to Wifi, but I definitely won't have access to my game files between 12 August and the end of the month.

I'd definitely appreciate if you can sort this out and clean it up! :woot
 
Okay here is the function where I think it's going wrong:
ref CreateTwinCharacter(ref _refEnemy)
{
ref refMyCharacter = GetMainCharacter();
ref Fightincabin;

Fightincabin = _refEnemy;
Fightincabin.isFantom = 0;
Fightincabin.fight = 0;
_refEnemy.isFantom = 0;
_refEnemy.fight = 0;

bool IsFantom = CheckAttribute(_refEnemy, "isFantom") == true && sti(_refEnemy.IsFantom) == true; // KK
if(!IsFantom) IsFantom = strleft(_refEnemy.id,4)=="fenc";//MAXIMUS:
if(!IsFantom) IsFantom = _refEnemy.id=="0";//MAXIMUS:
if(!IsFantom) IsFantom = _refEnemy.id == "Quest Pirate"; // LDH 14Jan09

int freeIdx = FindFreeCabinCaptain(); // KK
if(freeIdx != -1)
{
if(IsFantom)
{
Fightincabin = GetCharacter(freeIdx); // KK

int newIndex = Fightincabin.index;
string newId = Fightincabin.id
CopyAttributes(&Fightincabin,_refEnemy);
Fightincabin.index = newIndex;
Fightincabin.id = newId;
facemaker(Fightincabin);

if(CheckAttribute(Fightincabin,"ship")) DeleteAttribute(Fightincabin,"ship");
if(CheckAttribute(Fightincabin,"shiptype")) DeleteAttribute(Fightincabin,"shiptype");
if(CheckAttribute(Fightincabin,"shipmoney")) DeleteAttribute(Fightincabin,"shipmoney");
if(CheckAttribute(Fightincabin,"curshipnum")) DeleteAttribute(Fightincabin,"curshipnum");
if(CheckAttribute(Fightincabin,"seaai")) DeleteAttribute(Fightincabin,"seaai");
if(CheckAttribute(Fightincabin,"features")) DeleteAttribute(Fightincabin,"features");
if(CheckAttribute(Fightincabin,"seatime")) DeleteAttribute(Fightincabin,"seatime");
if(CheckAttribute(Fightincabin,"relation")) DeleteAttribute(Fightincabin,"relation");
if(CheckAttribute(Fightincabin,"fantomtype")) DeleteAttribute(Fightincabin,"fantomtype");
if(CheckAttribute(Fightincabin,"canfiretime")) DeleteAttribute(Fightincabin,"canfiretime");
if(CheckAttribute(Fightincabin,"rankscale")) DeleteAttribute(Fightincabin,"rankscale");
if(CheckAttribute(Fightincabin,"tmpperks")) DeleteAttribute(Fightincabin,"tmpperks");
if(CheckAttribute(Fightincabin,"tmpskill")) DeleteAttribute(Fightincabin,"tmpskill");
if(CheckAttribute(Fightincabin,"points")) DeleteAttribute(Fightincabin,"points");
if(CheckAttribute(Fightincabin,"randofficers")) DeleteAttribute(Fightincabin,"randofficers");
if(CheckAttribute(Fightincabin,"skillnatmult")) DeleteAttribute(Fightincabin,"skillnatmult");
if(CheckAttribute(Fightincabin,"nodisarm")) DeleteAttribute(Fightincabin,"nodisarm");
if(CheckAttribute(Fightincabin,"points")) DeleteAttribute(Fightincabin,"points");
if(CheckAttribute(Fightincabin,"isFantom")) DeleteAttribute(Fightincabin,"isFantom");

Fightincabin.isFantom = 1;
Fightincabin.fight = 0;
_refEnemy.isFantom = 1;
_refEnemy.fight = 0;

if(CheckAttribute(_refEnemy,"Ship"))
{
Fightincabin.Ship = "";
aref arShipMy, arShipEnemy;
makearef(arShipMy,Fightincabin.Ship);
makearef(arShipEnemy,_refEnemy.Ship);
CopyAttributes(&arShipMy,&arShipEnemy);
}
}
}

//if(!UsableOfficer(_refEnemy))
//{
/*switch(Rand(7))
{
case 0: Fightincabin.quest.officertype = OFFIC_TYPE_BOATSWAIN; break;
case 1: Fightincabin.quest.officertype = OFFIC_TYPE_CANNONEER; break;
case 2: Fightincabin.quest.officertype = OFFIC_TYPE_QMASTER; break;
case 3: Fightincabin.quest.officertype = OFFIC_TYPE_NAVIGATOR; break;
case 4: Fightincabin.quest.officertype = OFFIC_TYPE_FIRSTMATE; break;
case 5: Fightincabin.quest.officertype = OFFIC_TYPE_CARPENTER; break;
case 6: Fightincabin.quest.officertype = OFFIC_TYPE_DOCTOR; break;
case 7: Fightincabin.quest.officertype = OFFIC_TYPE_ABORDAGE; break;
}*/
// if(!CheckAttribute(Fightincabin,"quest.officertype")) Fightincabin.quest.officertype = GetRandomOfficerType(); //Levis let's use a global function so we can easily add types later.
// LAi_Create_Officer(rand(8), &Fightincabin);
//}

if(CheckAttribute(_refEnemy,"quest.officerprice")) { Fightincabin.quest.officerprice = _refEnemy.quest.officerprice; }
else { Fightincabin.quest.officerprice = makeint((sti(refMyCharacter.rank) * 2 + 10)*100) - 330 + rand(40)*15 + rand(10); }

if(!CheckAttribute(_refEnemy,"money")) { Fightincabin.money = makeint(rand(100)); }
if(CheckAttribute(_refEnemy,"money")) { Fightincabin.wealth = makeint(sti(_refEnemy.money)*(frand(5.0)+2.3)); }

Fightincabin.nodisarm = 1;
if(!CheckAttribute(Fightincabin,"chr_ai.type")) { Fightincabin.chr_ai.type = "stay"; }
if(!CheckAttribute(Fightincabin,"model.entity")) { Fightincabin.model.entity = "NPCharacter"; }
Fightincabin.Dialog.Filename = "Cabinfight_dialog.c";
Fightincabin.Dialog.Currentnode = "First time";
if(Fightincabin.sex=="woman") Fightincabin.greeting = "Gr_Pirate_f";
else Fightincabin.greeting = "Gr_Dark Teacher";
if (IsFantom) LAi_NPC_Equip(&Fightincabin, sti(Fightincabin.rank), true, 0.5); // KK

return Fightincabin;
}

It's only used at one place so I kind of want to just get rid of this function all together because some very weird things are happening in here.

@A.H am I right to say you took one of the captains as your officer?
 
Indeed I don't particularly like that being needed either (hate it, more like!).
I had to remove two of your lines from there, which may have helped with some stuff and hindred with some other stuff:
Code:
if(!CheckAttribute(Fightincabin,"quest.officertype")) Fightincabin.quest.officertype = GetRandomOfficerType(); //Levis let's use a global function so we can easily add types later.
LAi_Create_Officer(rand(8), &Fightincabin);
For explanantion, see here: High Priority - Levelling: Some Captains Not Correctly Initialized until Too Late | Page 5 | PiratesAhoy!
 
Ah there is the problem.
For some reason sometimes the officertype isn't set for these captains or its removed (because I do see they used to have a officertype). And now this doesn't catch it. So this explains why I didn't had this problem before.

I can't test this now but if someone could that would be nice.
I've changed this in the boarding file:
Code:
// We determine the sizes of the commands
// KK -->
    /*if (!IsFort && !IsTown)
        refEnCharacter = CreateTwinCharacter(boarding_enemy);
    else
        refEnCharacter = boarding_enemy;*/
// <-- KK
    //Levis let's try to handle them all the same, it should work now right?
    refEnCharacter = boarding_enemy;

Please make a copy of LAi_boarding.c before you place this one in PROGRAM\Loc_ai because I have no idea if it will screw up things, but from what I see it should just work.
 

Attachments

  • LAi_boarding.c
    97.3 KB · Views: 267
I've been trough the code and everything which happens in the creation of the twin character should be obsolete because ALL characters are now generated well already. In the past this was needed because character weren't generated well. So from what I can see this shouldn't cause any problems. But that's why I ask people to test it. It's an easy thing to revert if strange things do happen. But from what I can tell it shouldn't.
 
I'd definitely welcome it to be tested. If it does indeed work, I sure wouldn't mind! :cheeky
 
Back
Top