Jump to content

[solved] My creature dies while wearing a 1HP belt


jastey

Recommended Posts

BG:EE v2.3.67.3 from BeamDog

 

I need help: My creature dies while wearing a 1HP belt, and the funny thing is, that I don't even try to kill it. It dies after I apply a healing spell. I am very confused and need not only a second pair of eyes but definitely a better brain:

 

The creature is neutral, and at 1 HP wearing a 1 HP item.

The script triggers when the fight is over, and the creatures is supposed to get some HP (works, as far as I can see), say "woof!" (works always), and join the group as a familiar.

 

This script block is the following:

IF
    Global("C#Grey_IsUnconsciousAt1HP","GLOBAL",1)
    Global("C#GreyJoined","GLOBAL",2) 
    CombatCounter(0)
THEN
    RESPONSE #100
        ReallyForceSpell("C#Grey",C#GREY_HP) //restores 5 HP
        DisplayStringHead(Myself,%Woof!%)
        ChangeEnemyAlly(Myself, FAMILIAR)
        AddFamiliar()
        SetGlobal("C#Grey_IsUnconsciousAt1HP","GLOBAL",0)
END


In 5 times out of 6, it all works as planned. But from time to time, the creature dies while performing this script block (checked by stutter test).

 

I confirmed, that

 

-it is wearing the 1 HP item

-it is this script block

-the spell C#GREY_HP is a custom Monk "Lay on Hands" that gives "Current HP bonus (17)" of 5 HP in total without any visual effects. This seems to work OK, too.

 

Adding a Wait(1) before the ChangeEnemyAlly(Myself, FAMILIAR) seems to solve the problem, or at least reduces the dying to such a low % that I didn't encounter it in game. Still, what is happening here? Why is the 1Hp item not preventing the creature's death (it works during the fight)?

Link to comment

Have you checked that the creature is not really hurt... aka if it has 1 hitpoint and the damage it takes is 13 hit points, the +5 hps won't heal it above the death point that comes when the creature joins and removes the min1hp item.

What type do you use at the opcode 17 ? Aka what the parameter 2's value is.

Link to comment

Why do you say the item gets removed? It doesn't get removed. Unless you know something about how AddFamiliar() or ChangeEnemyAlly() works that I don't?

 

What exactly do you mean by the 2nd parameter value? In terms of NI: do you mean Power (=1), Value (=5) or Probability1 (=100) or Probability2 (=0) ?

 

As for the damage taken, I'd figure after the fight any "extra" hit points would be forgotten, meaning the creature wouldn't die half an hour after the fight if I remove the 1 HP item, which would be rather silly?

Link to comment

The only way I've encountered NPCs dying through the MINHP1 item is if they have any effects applied on them that provide bonus maximum hit points, such as opcode 10 which modifies Constitution or opcode 18, maximum HP modifier. What I think happens is that sometimes the NPC refreshes their effects (such as when they join the party, all their innate abilities are refreshed) and if they're at 1 HP losing their maximum HP bonus puts them at negative HP which kills them immediately. I don't suppose you have any temporary HP effects applied on your NPC?

Link to comment

Thank you (all) for your ideas! Artemius: I am not aware, but that doesn't mean it's not possible I applied some effect that in the end grants more hit points. I guess I will heal him completely before AddFamiliar(), then, hoping it will solve the problem.

I forgot to tell I am working on BG:EE v2.3.67.3 from BeamDog (added to the first post).

Link to comment

I have no knowledge of AddFamiliar() but I have made the similar experience with JoinParty() and the effects are equivalent to what you deswcribe and the reason for it being what Artemius I describes in the post above.

 

In my case, I have made the following spell I to *clean* the cre before joining - and I would also suggest to add a Wait(6) between spell and joining.

 

IF
Global("C#Grey_IsUnconsciousAt1HP","GLOBAL",1)
Global("C#GreyJoined","GLOBAL",2)
CombatCounter(0)
THEN
RESPONSE
#100

ReallyForceSpellRES("CVReset","C#Grey")
DisplayStringHead(Myself,%Woof!%)

Wait(6)
ChangeEnemyAlly(Myself, FAMILIAR)
AddFamiliar()
SetGlobal("C#Grey_IsUnconsciousAt1HP","GLOBAL",0)
END

 

You may want to try it.

PS - the spell is invisible.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...