• 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 Hiring "Anonymous Cowards" at the tavern

ANSEL

Corsair
Storm Modder
Hearts of Oak Donator
seadogs2_0050.jpg After asking the barman for officers, I hired a gunner with high skills.
But it turns to I have now an" Anonymous Coward" in my crew, instead
of the Gunner. Worst, I cant get rid of this "person".
 

Attachments

  • error.log
    11.9 KB · Views: 110
  • compile.log
    9.8 KB · Views: 103
  • -=Player=- Bonaire. Kralendijk tavern. August 22nd, 1683.zip
    898.5 KB · Views: 96
Are you running the lastest version?
Do you have a savegame from before hireing him (while you are in the tavern already)?
 
@ANSEL, you're totally right; I replicated the very same from your savegame.
But WHY, I am not sure. This has worked fine before; what broke it this time!?!?
 
For some reason, CopyAttributes is completely failing! :shock
BEFORE hiring:
Code:
index = 1472
id = Enc_Officer_4
model = capstan
  entity = NPCharacter
  animation = man
  height = 1.8000000
location =
  locator = goto3
  group = goto
  stime = 0.0000000
  etime = 24.0000000
chr_ai =
  group =
  type = citizen
  notalk = 11.5230026
  player = 0.0000000
  ay = 2.5090446
  alarmreact = 1
  grpalarmr = 1
  hp = 283.0000000
  hp_max = 283.0000000
  charge = 1.0000000
  login = 1
  dmgbldmin = 22.0000000
  dmgbldmax = 38.5000000
  piercing = 0.3700000
  block = 0.3100000
  charge_max = 1
  chargeprc = 0
  charge_dlt = 0.0714286
  dmggunmin = 50.0000000
  dmggunmax = 225.0000000
  accuracy = 0.7000000
  tmpl = dialog
  state = dialog
  dialog = 0
  time = 0
  dlgtime = -1
  phrasetime = 5.9190521
dialog =
  filename = enc_officer_dialog.c
  debug = Debug.c
  currentnode = ReturnfromSkillview
  tempnode = OnboardSoon
  lines = 4
offgen = 1
officer = 1
quest = True
  meeting =
  officertype = cannoneer
  officerprice = 1722
reputation = 28
nation = 4
  name = 4
skill =
  leadership = 3
  importance = 9
  bonus = 1.0000000
  charmod = 0
  modifier = 0
  fencing = 8
  importance = 193
  bonus = 1.0000000
  modifier = 0
  charmod = 0
  sailing = 2
  importance = 5
  bonus = 1.0000000
  charmod = 0
  accuracy = 10
  importance = 408
  bonus = 1.0000000
  officertype = cannoneer
  modifier = 0
  charmod = 0
  cannons = 10
  importance = 410
  bonus = 1.0000000
  officertype = cannoneer
  modifier = 0
  charmod = 0
  grappling = 2
  importance = 5
  bonus = 1.0000000
  charmod = 0
  repair = 3
  importance = 12
  bonus = 1.0000000
  charmod = 0
  defence = 3
  importance = 12
  bonus = 1.0000000
  charmod = 0
  commerce = 4
  importance = 36
  bonus = 1.0000000
  charmod = 0
  modifier = 0
  sneak = 4
  importance = 24
  bonus = 1.0000000
  charmod = 0
  modifier = 0
  freeskill = 0
sex = man
faceid = 301
headmodel = h_capstan
name = Friko
lastname = Wiese
old =
  name = Friko
  lastname = Wiese
  chr_ai =
  group =
experience = 1003321
  leadership = 2300
  fencing = 5190
  sailing = 3671
  accuracy = 25727
  cannons = 27734
  grappling = 3671
  repair = 5309
  defence = 5309
  commerce = 17280
  sneak = 5236
rank = 28
money = 1102
loyality = 17
alignment = good
homelocation =
  group =
  locator =
homestate =
skillimportancetotal = 1114
officerprice = 0
fakelevels = 0
bonussetup = 1
actions =
  idle =
  i1 = idle_1
  i2 = idle_2
  i3 = idle_3
  i4 = idle_4
  i5 = idle_5
  i6 = idle_6
  i7 = idle_7
  i8 = idle_8
  i9 = idle_9
  i10 = idle_10
  walk = walk
  backwalk = back walk
  run = run
  backrun = back run
  stsup = stairs up
  stsuprun = run stairs up
  stsdown = stairs down
  stsdownrun = run stairs down
  stsupback = back stairs up
  stsdownback = back stairs down
  stsuprunback = back run stairs up
  stsdownrunback = back run stairs down
  turnleft = turn left
  turnright = turn right
  swim = swim
  hit = face_hit
  h1 = hit_1
  h2 = hit_2
  h3 = hit_3
  sidestep_left_on = skip
  sidestep_right_on = skip
  fightwalk = fight walk
  fightbackwalk = fight back walk
  fightrun = fight run
  fightbackrun = fight back run
  attack =
  a1 = attack_1
  a2 = attack_2
  a3 = attack_3
  a4 = attack_4
  a5 = attack_5
  a6 = attack_6
  a7 = attack_7
  a8 = attack_8
  attacktl =
  a1 = attack_left_1
  attacktr =
  a1 = attack_right_1
  block = block
  blockhit = block_hit
  recoil = Recoil
  shot = Shot
  fightsidestep_left_on = skip
  fightsidestep_right_on = skip
  fightdead =
  d1 = death_0
  d2 = death_1
  d3 = death_2
  d4 = death_3
  fightidle =
  i1 = fight stand_1
  i2 = fight stand_2
  i3 = fight stand_3
  i4 = fight stand_4
  dead =
  d1 = death_citizen_1
  d2 = death_citizen_2
locdate = 2004
skillsetup = cannoneer
perks =
  freepoints = 0
  list =
  criticalhit = 1
  rush = 1
  gunman = 1
  improveaiming = 1
  gunprofessional = 1
  basicdefence = 1
  advanceddefence = 1
  swordplayprofessional = 1
  toughness = 1
  crewdamageup = 1
  sailsdamageup = 1
  hulldamageup = 1
  criticalshoot = 1
  longrangeshoot = 1
  fastreload = 1
  unlocked =
  improveaiming = 1
  gunprofessional = 1
  advanceddefence = 1
  swordplayprofessional = 1
  toughness = 1
completeinit = 1
items =
  blade27+2 = 1
  pistol5 = 1
equip =
  blade = blade27+2
  gun = pistol5
perktypes = 400
  combat = 69
  sailing = 20
  sea combat = 70
  sea defence = 29
  boarding = 32
  merchant = 40
  daring = 48
  party = 32
  repair = 30
  misc = 30
  highest = 2
greeting = Gr_Dutch Officer
grsex = man
friend = 1
loadeddialog =
  filename = enc_officer_dialog.c
  filename0 = Debug.c
And then AFTER copying:
Code:
index = 1472
id = Enc_Officer_4
See? NOTHING!
 
This is what happens:
- FindFreeRandomOfficer ends up calling ClearCharacter ON the officer you just hired (somehow TWICE, which I doubly don't understand)
- This DESPITE my code to specifically PREVENT just that
- It happens because the code doesn't know the character is in the same location as the player; which makes no sense, but apparently happens anyway
- Therefore this line fails to keep the character safe:
Code:
if(tempChar.location == loadedLocation.id) { continue; } // PB: To prevent prospective officers from disappearing when you're talking to them
 
@Levis: I found the reason:
Code:
  //Always set the location first to pchar so we know for sure he is initialized right
   string oldlocation = "";
   if(CheckAttribute(Npchar,"location")) oldlocation = Npchar.location;
   Npchar.location = Characters[GetMaincharacterIndex()].location;
   //Now lets set it to the right level
   InitCharacterSkills(Npchar);
   //Now restore the old location
   Npchar.location = ""; // <-------------- THAT SHOULD USE THE "oldlocation" VARIABLE!
 
I found another errors with @ANSEL's savegame, which I think @Levis should have a look at.
Note the "Ship Skill" on Commerce in that savegame, then look at the skills of Jhan van Imbroeck:
Code:
index = 1474
id = Enc_Officer_6
name = Jhan
lastname = Van Imbroeck
skill =
  commerce = 10
  charmod = 0
  importance = 405
  bonus = 1.0000000
  modifier = 0
  effective = 7
  officertype = quartermaster
^ See how that doesn't match up? Actual skill is 10, but effective is 7. Depending on officer type, effective skill should be "1", "5" or "10", but NOT "7".
Executing this through console does make it update properly:
Code:
ResetCharMod(CharacterFromID("Enc_Officer_6"), SKILL_COMMERCE);
But that does raise the question: How did it end up being wrong in the first place?
 
Nobody reported this in a while, so I assume it has been "Fixed".
 
Back
Top