• 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 Non-Violent/Unarmed Characters

Artois is probably also set to isOfficer because I gave all officer this attribute. and this one has higher priority then the isMerchant so it will pick an officer type.
And If I'm not mistaken artois actually has an officertype already set so I dont think it will be overwritten then.

Again if an character gets the isMerchant thingy it now gets the shopkeeper officertype. we could just remove the whole isMerchant and I could check for itemtrade also instead. But don't townfantoms have this attribute either?
 
Artois is probably also set to isOfficer because I gave all officer this attribute. and this one has higher priority then the isMerchant so it will pick an officer type.
And If I'm not mistaken artois actually has an officertype already set so I dont think it will be overwritten then.
I suppose if he was inclined to open a store, @Hylie Pistof would have noticed by now.
So probably your "taking presence" thing does have its intended effect there.
Still odd that he has that attribute in the first place though. I'd like to know how that happened.

Again if an character gets the isMerchant thingy it now gets the shopkeeper officertype. we could just remove the whole isMerchant and I could check for itemtrade also instead. But don't townfantoms have this attribute either?
I think the "itemtrade" attribute gets added the first time you open the "Item Trade" interface with a character.
So that means that real merchants DON'T have that when they are first generated; you have to talk to them first.

And of course some random town folk can offer item trading too.
Which means that they then ALSO get this and would now stop equipping weapons because of that.
That is OK as long as you don't leave the location as SetUpCharacterWeapons shouldn't be called while you're in there anyway, right?

And as these are RANDOM characters, they should be newly generated again when you return.
However, that probably reuses old character array spots, which may have left-over attributes, including that "itemtrade" one.
That would then NOT be intended. Maybe ClearCharacter should be called on such characters when they are removed or regenerated to prevent that?
 
I believe clear character is called. we fixed that a while ago if I remember right.
I think the easiest solution is just to go trough the character inits and check all different LAi_types to make sure they are right.
Before we do that lets make a list of them and define which should be set to which kind of character.
After doint that actually going trough all characters should probably take an hour or so. that's probably way less then we spend on trying to fix it in other ways
 
One thing I was thinking of is to see what "isSomething" attributes are added to all the LAi types and then have a DeleteAttribute to remove all other ones.
So if you assign a character to MerchantType, he may get the attribute; but if you assign the character to something else later, the attribute will be removed.

I believe clear character is called. we fixed that a while ago if I remember right.
The following characters get fully cleared with my (somewhat) new ClearCharacter function:
- Unhired officers (upon leaving a location AND when trying to find a new empty spot)
- Unused cabin captains (only when trying to find a new empty spot)

It doesn't get applied to ANY other characters as we noticed scary unintentional side-effects from doing that so I put a stop to that.
So that means also character array spots that get reused to NOT yet fully get cleared like that.
Perhaps they should be? Coast Raiders? Random citizens? All sorts of "monsters"?
Might help to prevent all sorts of random left-overs from accumulating in the later game.
Maybe... perhaps....?

Anyway, I'd rather not get too deep into that. Do you reckon you can have a look at it next week?
There are still some other things I needed to address and I already got big-time side-tracked again today. :facepalm
 
I can look into it. It shouldn't be that hard. There is an unload location function which cycles trough all character which are unloaded. Just adding a check here to see if one is a fantom and if thats the case deleting all attributes should do the trick.
 
I can look into it. It shouldn't be that hard. There is an unload location function which cycles trough all character which are unloaded. Just adding a check here to see if one is a fantom and if thats the case deleting all attributes should do the trick.
Or find the spot where they are generated? So that just before their index is reused, they can be cleared out?
 
Thanks! Looks like we don't truly need to worry about this one, because I found the following line in there:
Code:
DeleteAttribute(chr,"itemtrade"); // NK 05-04-05 so itemtrading cleared
Apparently the great @NathanKell already thought of this one in 2005. :rofl

Still, a call to ClearCharacter may be able to get rid of a lot of other separate "DeleteAttribute" lines in there.
Not sure if we should want to do that though. I'm getting a "don't fix what isn't broken" impression here... :confused:
 
For now I tend to agree on that. altough I do sugest adding an delete for
isOfficer
isMerchant
isSoldier

I believe those are the ones I introduces. You could check it quickly by searching leveling.c for isMerchant. There is an if statement somewhere setting the appropriate officertype for the different settings.
 
Standard storyline: I just boarded a pirate ship and the crew was not armed.
The captain was armed alright. There are very long logs, much more than usual.
 

Attachments

  • error.zip
    273 bytes · Views: 84
  • compile.zip
    12.9 KB · Views: 76
  • system.zip
    2.3 KB · Views: 81
Did you start a new game yet? From what I gathered from your previous log files, your game got well and truly broken.
There is no saying what other insanity will occur next for you and I hardly even want to know.
It is bug overkill by the looks of it and we had better find the underlying cause soon. :modding
 
In that context, I have noticed after putting in both your zip and Levis' none of the brigands encountered in the jungle appear to be armed and the run up to you and don't attack. Also all of the merchant guards who appear after you rob someone are also unarmed. This does not the 10/22 fix.
 
This does not the 10/22 fix.
I'm not sure what you're saying there. In any case, I didn't specifically focus on item equipping just yet.
First wanted to get to the point where the game doesn't completely start breaking down with CTDs and insane error logs.
Still plenty to be done this weekend. :(
 
Now playing the 10/22 fixes. Everyone seems appropriately armed. The amour is still disappearing visually but remains equipped.
 
Merged some threads on similar issues together.
Please keep en eye out for this one with the new EXE; I'm still investigating further....
 
Since we didn't have this problem before and this was removed from LAi_CreateFantomCharacterExOt, I'm putting it back:
Code:
   EquipCharacterByItem(&chr, FindCharacterItemByGroup(&chr, BLADE_ITEM_TYPE));
   EquipCharacterByItem(&chr, FindCharacterItemByGroup(&chr, GUN_ITEM_TYPE));
   EquipCharacterByItem(&chr, FindCharacterItemByGroup(&chr, ARMOR_ITEM_TYPE));
As far as I'm concerned, this issue is "Fixed" until I hear otherwise.
 
Loading times OK too? :woot

Loading times are much improved, maybe a little slow but only a few times.

First glitch but minor. In the peter blood quest leaving a Havana encountered random raidiers in the jungle all were unarmed but that was only once. every once else seems to have weapons.
 
First glitch but minor. In the peter blood quest leaving a Havana encountered random raidiers in the jungle all were unarmed but that was only once. every once else seems to have weapons.
Again? I got rid of all code that seemed responsible for that! If you have .log files and a savegame when that happens again, please post them.
To relate the log files with your game, it may help to know the names of some of the characters who appeared unarmed.
 
Back
Top