jastey Posted December 10, 2017 Share Posted December 10, 2017 I wanted to grant my NPC a min 1 HP effect so he can't die. I tried to do this via spell. I made an (innate) spell with the effect "Minimum HP (208)", Target Self(1), HP amount 1 and applied to via ReallyForceSpellRES. If the spell is applied, the NPC still dies when I Ctr-y him. Did I misunderstood the minHP effect, did I apply it wrongly, or did I misunderstood how damage is applied? Any help appreciated. Quote Link to comment
lynx Posted December 10, 2017 Share Posted December 10, 2017 And what was the duration? Usually this is done via items and equipping effects. Quote Link to comment
Roxanne Posted December 10, 2017 Share Posted December 10, 2017 (edited) I wanted to grant my NPC a min 1 HP effect so he can't die. I tried to do this via spell. I made an (innate) spell with the effect "Minimum HP (208)", Target Self(1), HP amount 1 and applied to via ReallyForceSpellRES. If the spell is applied, the NPC still dies when I Ctr-y him. Did I misunderstood the minHP effect, did I apply it wrongly, or did I misunderstood how damage is applied? Any help appreciated. Minimum HP (208)", Target = Self(1), HP amount = 1 (or whatever, I use 15 for Corwin) Duration = Instant/Permanent Until death - 1 (well, should not happen but that is the setting) Probability 1 = 100 I use this for my Corwin mod because she cannot die in BG1 as you need her in SoD. I have coupled this with a script that makes her go unconcious as long as the party is in combat and if her HP are down. This way she stays alive but cannot fight and needs to be healed afterwards. Edited December 10, 2017 by Roxanne Quote Link to comment
jastey Posted December 10, 2017 Author Share Posted December 10, 2017 lynx: Duration is "0" but Timing mode is Instant/Permanent Until death. The idea was not to do it via item, so I tried using an effect. (I have reasons why I want to avoid an item, I know it can be easily done via item.) Roxanne: It's basically what I intend to realise as well, the NPC is not in the party at that time and needs to stay alive (I let him drop unconscious and turn neutral, too, so he can't be used as an undying "tank"). I tried using 15 HP but I can still instand-kill him. I am working with the old BGII engine, I should add. My original intention was to make this effect a SecType to be able to remove the 1HP effect via (221). (I added ADD_SECTYPE "C#1HPEffect" and patched it to this spell.) I guess this won't work as I imagine but so far I can't even get the 1 HP effect to work. Quote Link to comment
Roxanne Posted December 10, 2017 Share Posted December 10, 2017 (edited) lynx: Duration is "0" but Timing mode is Instant/Permanent Until death. The idea was not to do it via item, so I tried using an effect. (I have reasons why I want to avoid an item, I know it can be easily done via item.) Roxanne: It's basically what I intend to realise as well, the NPC is not in the party at that time and needs to stay alive (I let him drop unconscious and turn neutral, too, so he can't be used as an undying "tank"). I tried using 15 HP but I can still instand-kill him. I am working with the old BGII engine, I should add. My original intention was to make this effect a SecType to be able to remove the 1HP effect via (221). (I added ADD_SECTYPE "C#1HPEffect" and patched it to this spell.) I guess this won't work as I imagine but so far I can't even get the 1 HP effect to work. If the cre is not in party, just give it an item with the above effect and use *while equip*. You simply destroy the item if no longer needed, Just use imoenhp1.itm to test it (the belt she has in Irenicus Dungeon). ActionOverride("YourDV",CreateItem("ImoenHP1",0,0,0)) ActionOverride("YourDV",FillSlot(SLOT_BELT)) Edited December 10, 2017 by Roxanne Quote Link to comment
jastey Posted December 10, 2017 Author Share Posted December 10, 2017 (edited) I already have the solution with an item. I was thinking about using the effect so I do not have to switch items because it blocks one item slot for nothing. EDIT: Thanks for your help, nontheless. I appreciate any ideas in this regard. I fear the effect does not work for the BGII engine, though. Can anyone confirm this? Edited December 10, 2017 by jastey Quote Link to comment
Roxanne Posted December 10, 2017 Share Posted December 10, 2017 (edited) I already have the solution with an item. I was thinking about using the effect so I do not have to switch items because it blocks one item slot for nothing. EDIT: Thanks for your help, nontheless. I appreciate any ideas in this regard. I fear the effect does not work for the BGII engine, though. Can anyone confirm this? Not sure why you cannot get it to work. I had this spell and it works in both BGT and EET. And I applied it via ReallyForceSpellRES, just like you intended. CVDEXIN.zip I never tested anything to remove it, I had no need for that. Edited December 10, 2017 by Roxanne Quote Link to comment
CamDawg Posted December 10, 2017 Share Posted December 10, 2017 I already have the solution with an item. I was thinking about using the effect so I do not have to switch items because it blocks one item slot for nothing. EDIT: Thanks for your help, nontheless. I appreciate any ideas in this regard. I fear the effect does not work for the BGII engine, though. Can anyone confirm this? It works--trolls use the monhp1 item to prevent death from damage until their scripts swap them to their 'dead' versions. Quote Link to comment
CamDawg Posted December 10, 2017 Share Posted December 10, 2017 Oh, and if you want to see an invincibility spell in action, check OHSMODE1.spl in the EE engine. OHSMODE1 is applied when the player enables story mode and, though it has some extra effects you won't want (e.g. immunity to sleep), would probably be a good place to start. Set the secondary to what you want and then strip out the EE-only opcodes and unwanted protections. Quote Link to comment
jastey Posted December 10, 2017 Author Share Posted December 10, 2017 Thank you both for your help, I'll try a bit more to get it to work. Quote Link to comment
jastey Posted December 10, 2017 Author Share Posted December 10, 2017 It works! (I was an idiot, I added an effect to the spell, not an ability with an effect.) So, 1HP effect works and removing it (via SecType) works, too. Only drawback is that the 1 HP effect is stripped if the NPC is healed by Ctrl-R, but I guess if someone uses that cheat then I won't have to worry about health getting too low, anyway... So, I will have to decide whether I risk it nontheless and spare the stupid 1 HP item. Thank you again! Quote Link to comment
Roxanne Posted December 10, 2017 Share Posted December 10, 2017 It works! (I was an idiot, I added an effect to the spell, not an ability with an effect.) So, 1HP effect works and removing it (via SecType) works, too. Only drawback is that the 1 HP effect is stripped if the NPC is healed by Ctrl-R, but I guess if someone uses that cheat then I won't have to worry about health getting too low, anyway... So, I will have to decide whether I risk it nontheless and spare the stupid 1 HP item. Thank you again! You can build in a safety feature, e.g. just casting that spell again if your NPC HP goes below some value 20hp or so. That way it will be restored if needed. Quote Link to comment
jastey Posted December 11, 2017 Author Share Posted December 11, 2017 Good idea! Thanks! Quote Link to comment
CamDawg Posted December 11, 2017 Share Posted December 11, 2017 (edited) I wanted to grant my NPC a min 1 HP effect so he can't die. I tried to do this via spell. I made an (innate) spell with the effect "Minimum HP (208)", Target Self(1), HP amount 1 and applied to via ReallyForceSpellRES. If the spell is applied, the NPC still dies when I Ctr-y him. Did I misunderstood the minHP effect, did I apply it wrongly, or did I misunderstood how damage is applied? Any help appreciated. Keep in mind that a min HP effect only protects against death from damage; there are still a lot of ways to die in the engine: Stat-drained to zero (ops 6, 10, 15, 19, 44, 49) Level-drained to zero (216) Disintegration (238) Turned to stone (134) Power word kill (209) Various items use instant kill effects such as vorpal hits (kill, op 13) or destruction (slay, op 55 e.g. Crom vs. golems) Polymorph (135) can kill on transformation, such as Aec'Letec's gaze) If undead, turn from a high-level cleric (297 prevents) edit: I can't remember if anything stops a scripted kill such as Kill(Myself) Edited December 11, 2017 by CamDawg Quote Link to comment
Roxanne Posted December 11, 2017 Share Posted December 11, 2017 (edited) I wanted to grant my NPC a min 1 HP effect so he can't die. I tried to do this via spell. I made an (innate) spell with the effect "Minimum HP (208)", Target Self(1), HP amount 1 and applied to via ReallyForceSpellRES. If the spell is applied, the NPC still dies when I Ctr-y him. Did I misunderstood the minHP effect, did I apply it wrongly, or did I misunderstood how damage is applied? Any help appreciated. Keep in mind that a min HP effect only protects against death from damage; there are still a lot of ways to die in the engine: Stat-drained to zero (ops 6, 10, 15, 19, 44, 49) Level-drained to zero (216) Disintegration (238) Turned to stone (134) Power word kill (209) Various items use instant kill effects such as vorpal hits (kill, op 13) or destruction (slay, op 55 e.g. Crom vs. golems) Polymorph (135) can kill on transformation, such as Aec'Letec's gaze) If undead, turn from a high-level cleric (297 prevents) edit: I can't remember if anything stops a scripted kill such as Kill(Myself) I know of no reasonable way to overcome those, you can even kill plot creatures that way and thereby kill your game as well. But that has always been the case. Unless you want to spend useless time to prevent every single eventual case... Edited December 11, 2017 by Roxanne Quote Link to comment
Recommended Posts
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.