Poison Effect Experts Needed

Post » Sun Feb 20, 2011 4:56 am

One of the bugs that I'm trying to fix in Oblivion XP is the script that gives credit for kills due to poison effects. I know why this script isn't working, but figuring out how to get it to work is another issue entirely. Anyway, I think I've figured out what I need to do, so I thought I would list all the info I've gathered so far and ask others for input on details I might have missed or have gotten wrong.

  • in-game poisons act immediately
  • custom poisons do damage every second
  • only certain poisons are detrimental to health (burden is a poison, but it doesn't have any effect on an enemy's health)
  • custom poison effects are cumulative (add up the damage from multi-effect poisons every second)
  • getAV health is not accurate, but the only measure available


The game engine does not update your kill stats when an NPC or creature dies from poisoning. SirFrederik has attempted to do this via script, but the script has several problems.

The script correctly determines that a poison has been applied to a weapon and knows the target of the poisoning. I need to fix the rest :)

Steps:
- get the active effects on the weapon
- loop through the active effects and if the effect is one that affects health, get the magnitude of the damage
- add the damage from each effect together
- compare the sum of the damage to the target's health each second
- if the damage exceeds the target's health, bump up the kill statistic for NPC's or creatures, as appropriate

Now I need opinions. Do you think this covers it? I know the getAV health command isn't the best, but I think that's all I have to work with. I can also check if the NPC or creature is dead even though the health isn't 0 if necessary, although I think assuming that if damage exceeds health, the creature or NPC is going to be dead might be good enough.

I am not having a problem determining the current active effects on a weapon or comparing those effects to certain types of damage (I've seen Jroush's recommendations in the OBSE thread :)) I also have the scriptEffectStart and scriptEffectUpdate loops set up. I just want to make sure I have everything covered and would like to know if there is a better way of doing this.

Thanks for your input!
User avatar
Chris Cross Cabaret Man
 
Posts: 3301
Joined: Tue Jun 19, 2007 11:33 pm

Post » Sun Feb 20, 2011 9:01 am

Just wondering...

What if 2 or more poisons are on one target from separate attackers, all together they kill the target but separately they would not, who gets the credit for the kill?

Could this be why the (per the developers ) poisons are not credit to any one attacker?
User avatar
Sara Lee
 
Posts: 3448
Joined: Mon Sep 25, 2006 1:40 pm

Post » Sat Feb 19, 2011 11:40 pm

I honestly don't know :) The script identifies the target of the player's attack alright, so if that target dies from someone else's attack, the player will probably get credit for it! I don't think this will be a big deal though. Kills don't yield that many experience points, so I don't think getting a few "freebies" will upset the balance too much. This would only be the case for poison kills though. The scripts handle regular deaths with no problems. If a companion makes the kill, the player gets credit, but if a guard comes running along and makes the kill, the player doesn't. If you're playing with Oblivion XP, you don't want help from guards ;) ...or any other non-companion, for that matter! (companions are followers)

Any more comments? Have I left anything out?

Thanks!
User avatar
koumba
 
Posts: 3394
Joined: Thu Mar 22, 2007 8:39 pm

Post » Sun Feb 20, 2011 3:28 am

Why not use the new OBSE event handlers? Register an OnHit event to fire whenever the player strikes another actor. Then, when you detect that the player has struck an enemy with a poisoned weapon, register an OnDeath handler for that enemy. If/when the enemy dies, one of the handler arguments will be the 'killing actor' ref. If this is invalid then the target died from indirect damage (poison, lava, falling, scripted damage, etc). Since the target was poisoned, odds are that's the cause of death, and you can award experience accordingly. This should be pretty reliable, and you never have scripts running in game mode.

You won't be able to actually check if the poison was still active (all magical effects are immediately removed when a target dies), so make sure to unregister your OnDeath handler as soon as the poison has expires.

Alternatively, why not just give experience for successfully poisoning an enemy in the first place?
User avatar
Shirley BEltran
 
Posts: 3450
Joined: Wed Jul 26, 2006 4:14 pm

Post » Sun Feb 20, 2011 5:12 am

Why not use the new OBSE event handlers? Register an OnHit event to fire whenever the player strikes another actor. Then, when you detect that the player has struck an enemy with a poisoned weapon, register an OnDeath handler for that enemy. If/when the enemy dies, one of the handler arguments will be the 'killing actor' ref. If this is invalid then the target died from indirect damage (poison, lava, falling, scripted damage, etc). Since the target was poisoned, odds are that's the cause of death, and you can award experience accordingly. This should be pretty reliable, and you never have scripts running in game mode.

You won't be able to actually check if the poison was still active (all magical effects are immediately removed when a target dies), so make sure to unregister your OnDeath handler as soon as the poison has expires.


This is mainly why I was asking! :) One of the trickiest things I'm finding with the scripting is getting a handle (sorry, pun is intended) on the functions that are available through OBSE. I have the documentation, but it isn't organized very well and I find the short descriptions a little hard to relate to usage or implementation. I have started to update the wiki here and there...

Alternatively, why not just give experience for successfully poisoning an enemy in the first place?


That's cheating! :) Very tempting though. I figure that it's pretty much a no-brainer to poison an ememy, but to not get credit when he drops dead from the poison is annoying. I'm thinking of battles where you are engaged with several enemies. You nail the first guy with a pretty good poison effect, melee with the others and by the time you're done, the first guy drops dead. You'd get credit for the two direct kills, but wouldn't get credit for the third. On the other hand, if your poison isn't enough to kill him, you'd get credit for poisoning him and then credit for killing him via melee if points were awarded for simply poisoning someone.

Thanks for your input. I'll have a look at the handlers.
User avatar
sunny lovett
 
Posts: 3388
Joined: Thu Dec 07, 2006 4:59 am

Post » Sat Feb 19, 2011 10:12 pm

On the other hand, if your poison isn't enough to kill him, you'd get credit for poisoning him and then credit for killing him via melee if points were awarded for simply poisoning someone.

Or you could even poison him multiple times with useless poisons to farm XP? :P
User avatar
Olga Xx
 
Posts: 3437
Joined: Tue Jul 11, 2006 8:31 pm

Post » Sun Feb 20, 2011 12:40 am

Or you could even poison him multiple times with useless poisons to farm XP? :P


Yup. Although if I might at least restrict the poison list to poisons that do health damage :)
User avatar
sam westover
 
Posts: 3420
Joined: Sun Jun 10, 2007 2:00 pm


Return to IV - Oblivion