• 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 Leveling: Unintentional Reset of Character HP

Jack Rackham

ex train dispatcher
Quest Writer
Storm Modder
Pieter, you once made a fix for resetting the pistol values to what they were when I made WoodesRogers quest.
This was needed for balancing the difficulty with the enemies. Now that doesn't seem to work anymore.
I don't remeber where it was added.

To test it's cheatmod on and Teach head, choose "Ships: Long run to Vanes".
One pistol shot should be enough to kill an enemy here. :guns:
 
@Jack Rackham: The fix is still there in PROGRAM\Storyline\WoodesRogers\SL_Reinit.c .
No related code has changed at all. Not that I remember.
 
Strange because now I need 4 shots to kill the first guy. Is there any other function
with enemies that has been tweaked/changed?

I'm using my qust pistols which as I can see are not even mentioned in SL_Reinit.c.
 
Strange because now I need 4 shots to kill the first guy. Is there any other function
with enemies that has been tweaked/changed?
When is the last time you tried? Just so I know what kind of time-frame I need to think in.

A lot has been changed all over the place. I remember resetting a function dealing with character damage a while back, because it had gotten messed up.
But I doubt that is it, because you must have done your balancing before that ever got messed up in the first place.

When facing the enemy you're trying to kill, press the [O]-key to see his "officer interface".
Check if the numbers there match with what they are supposed to be according to you.

I'm using my qust pistols which as I can see are not even mentioned in SL_Reinit.c.
Your quest pistols were never changed from your own settings anyway.
 
When is the last time you tried? Just so I know what kind of time-frame I need to think in.
Today.

I made these enemies really weak to be sure each one of the new 6 pistols in the belt should kill.
Like 14 HP. When I fighted them they had around like 190/200 HP!
 
I meant when is the last time you tested it when it DID work?

I made these enemies really weak to be sure each one of the new 6 pistols in the belt should kill.
Like 14 HP. When I fighted them they had around like 190/200 HP!
Can you show a character init entry of one of these guys?

Probably Levelling is overriding your default settings, because that tries to get character levels, skills and HP to be properly in line with each other.

You can try to add the "questchar" attribute to them if they don't already.
Also, if you want to reduce HP, it is better to set a negative HPBonus .
 
I meant when is the last time you tested it when it DID work?
Don't remember. The oldest game I still have is from nov 2015 and the problem is there.


Code:
            //wr 9 crew,             port attack 3/6
    ch.old.name = "Rogers'";
    ch.old.lastname = "Crew";
    ch.name = TranslateString("","Rogers'");
    ch.lastname = TranslateString("","Crew");
    ch.id        = "wr_raoul";
    ch.model = "wr_raol";
    ch.sex = "man";
    ch.sound_type = "pirate";
    GiveItem2Character(ch, "blade4");
    ch.equip.blade = "blade4";
    GiveItem2Character(ch, "pistol1");
    ch.equip.gun = "pistol1";   
    if (ENABLE_AMMOMOD) {
        TakenItems(ch, "gunpowder", 1);
        TakenItems(ch, "pistolbullets", 1);
    }
    ch.location    = "wr_crew";
    ch.location.group = "sit";
    ch.location.locator = "sit21";
    ch.Dialog.Filename = "wr crew_dialog.c";
    ch.greeting = "";
    ch.rank     = 20;
    ch.reputation = "20";
    ch.experience = "0";
    ch.skill.Leadership = "0";
    ch.skill.Fencing = "4";
    ch.skill.Sailing = "1";
    ch.skill.Accuracy = "0";
    ch.skill.Cannons = "1";
    ch.skill.Grappling = "1";
    ch.skill.Repair = "1";
    ch.skill.Defence = "0";
    ch.skill.Commerce = "0";
    ch.skill.Sneak = "0";
    ch.money = "1";
    ch.quest.meeting = "0";
    LAi_SetSitType(ch);
    LAi_SetLoginTime(ch, 0.0, 24.0);
    LAi_SetHP(ch, 14.0, 14.0);
    AddGameCharacter(n, ch);

I added the "questchar" attribute and it reduced the HP a lot. Not to my levels though. To 50 -60.

Not sure which is the easiest way to get the balance back.
Can we add another attribute which means "leave my quest characters alone"? ;)
I don't want to do a lot of tweaking and then one day there's another general change...
I'm not at all familiar with the levelling thing.
 
Can we add another attribute which means "leave my quest characters alone"? ;)
That is sort-of what "questchar" is already supposed to be doing. Just not 100%.

Here is what I understand of it all:
- In general, it is based on "one size fits all" so that all characters are treated equally.
That means "40 + 10 * (rank-1)" for their HP and skills that are supposed to be in line with their level (approximately 2 skill points per level)
- For regular characters, the level is determined FIRST and their skills are then auto-assigned
- For "questchar" situations, their skills are determined first and then their level is based on that

With the [O]-key you now probably notice that the skills match with your character init entry, but the character level does not.
I imagine the character shows as level 2 or 3 or so? Let's assume Level 3 here.
By consequence, that means the character will get 40+10*(3-1)=60 HP which matches with your own observation.

To decrease the HP to the level that you want, you can add an extra line:
Code:
ch.HPBonus = -46;
That should reduce HP by 46, so that makes for HP is 60-46=14, which is the value you want.

You could even calculate the negative HP bonus that you want based on CHAR_HITPOINTS_PER_LEVEL and CHAR_START_HITPOINTS .
That would ensure even if those numbers are ever changed, you still get the results that you want.

I hope that at least explains what is going on here.

I'm not at all familiar with the levelling thing.
NOBODY is! Other than @Levis. Which is.... uhm.... inconvenient to say the least.
 
It sounds very complicated in the future if enemy HP don't match your weapon strength
without some math.

Thanks Pieter I'll add ch.HPBonus = -46; to all enemies. :onya
 
In general it does make sense to have the various numbers in line with each other.
But getting everything to work as it is meant to is definitely VERY challenging.

The good part though: Once it is all handled properly, we shouldn't need to worry about it again.
 
Here is that HP fix.
Looking at that code, I am afraid it isn't going to do what you want.
The "-46" was based on a level 3 character. But the first example I see would end up as a level 1 character:
Code:
   ch.rank    = 1;
   ch.reputation = "None";
   ch.experience = "0";
   ch.skill.Leadership = "1";
   ch.skill.Fencing = "1";
   ch.skill.Sailing = "1";
   ch.skill.Accuracy = "1";
   ch.skill.Cannons = "1";
   ch.skill.Grappling = "1";
   ch.skill.Repair = "1";
   ch.skill.Defence = "1";
   ch.skill.Commerce = "1";
   ch.skill.Sneak = "1";
Applying -46 there will give the character 40-46=-6 HP. Probably kills the character right away or something! :shock
 
It occurred to me that LAi_SetHP is a bit pointless now.
I wonder.... If we can find the function definition for that one, perhaps we can rewrite it so it handles this stuff automatically?
But how to make that work....?
 
Back
Top