Jump to content
  • Announcements

    • AndalayBay

      Orphan Attachments   07/31/2018

      I have been doing some housekeeping lately and I've noticed that I had a lot of orphaned attachments. Attachments get orphaned when the PM or post is deleted without removing the attachment first. Deleting a PM or post does not delete the attachment and the file or image remain on the server. I'd like to ask all members to go through their attachments and delete any attachments you don't need anymore or those that have been orphaned. Where can I get a list of my attachments? Click on your display name in the upper right corner of the forums and pick "My Attachments" from the drop-down list. How can I tell an attachment is orphaned? If the PM has been deleted, you'll see a message like this in your attachment list: Unfortunately there is no message if the post has been deleted, so please check your old posts. We do purge old birthday threads every once in a while. Also some hosted projects have been shut down, so you may have orphaned attachments on one of those locations. Thanks!
Sign in to follow this  
Milotek

Poison Kill Script Discussion

Recommended Posts

No, it needs to be the original. The cloned poison has the script effect added to it, which does nothing but make the poison effect script process more. You've got the poison effect script processing itself.

 

Here's some log results which will  help demonstrate:

 

 

New Poison: [FF005B1C Burden-Damage Health-Fire Damage]
Original Poison: [FF005B1B Burden-Damage Health-Fire Damage]
Previous Poison Ref: [FF005B1C Burden-Damage Health-Fire Damage]
Cloned Poison Ref: FF005B1D Burden-Damage Health-Fire Damage
Reapplied Poison Ref: [FF005B1D Burden-Damage Health-Fire Damage]
Effect Start: FF005B1C Burden-Damage Health-Fire Damage
Effect Update
Effect Update
Effect Update
Effect Finish
Effect Start: FF005B1C Burden-Damage Health-Fire Damage
Effect Update
Effect Update
Effect Update
Effect Finish
Effect Start: FF005B1C Burden-Damage Health-Fire Damage
Effect Update
Effect Update
Effect Update
Effect Finish

 

That shows the bug. You can see the form ID's are changing. Anyway, the entries where it says Effect Start, Effect Update and Effect Finish are from the poison effect script using the original poison, without the script effect. When I was using the wrong reference, the log looked like this:

 

 

Poison Applied: FF005B53 Burden-Damage Health-Fire Damage
Num Effects: 234
Effect: FIDG, Magnitude: 5.0000
Effect: DGHE, Magnitude: 4.0000
Effect: BRDN, Magnitude: 30.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000
Effect: SEFF, Magnitude: 0.0000

....

 

and so on for 256 lines or so. So the poison effect script should only be processing the fire damage, damage health and burden, not the scripted effect itself.

Share this post


Link to post
Share on other sites

Nope. I rewrote the script and have tried it with all the variables in one script and by putting the variables in a separate script - same results. If it was something odd with my saved game, then I'd think that moving the variables to a separate script would work. Also, I've renamed the variables to make their role more clear. I've attached the logs so you guys can have a look. In both cases, I stop Oblivion from the task manager. The scripts would run to completion and might award multiple points if I didn't have the debugging turned on.

 

Logs.7z

 

Both logs are "bad", I just didn't want the second run to append to the first. In those logs, the "new poison" is fine on the first line, and the cloned form should have a different form ID, as it does. However there shouldn't be any subsequent lines. The "new poison" on the next run should have the same form ID as the cloned form and the script should exit. Later the entries are from the poison script effect and there shouldn't be any SEFF entries.

 

Here are the scripts:

 

Derived Attributes:

 

    if ( ObXPSettings.enablePoisonFix )

        ; add ObXP effect to poison - this will increase player's kill counter manually
        let poisonRef := player.getEquippedWeaponPoison

        if ( poisonRef ) && ( poisonRef != ObXPMain.poisonRefCloned )

            ;store reference to original poison - used in poison effect script
            let poisonRefOriginal := poisonRef

            ;clone original poison - we don't want to change the base of the original poison
            let poisonRefCloned := cloneForm poisonRef

            ;go through effects on the poison and store longest duration
            let i := 0
            let poisonDuration := 0
            while ( i < getMagicItemEffectCount poisonRefCloned )
                if ( getNthEffectItemDuration poisonRefCloned i > poisonDuration )
                    let poisonDuration := getNthEffectItemDuration poisonRefCloned i
                endif
                let i := i + 1
            loop

            ;add ObXP poison script effect item
            let poisonScriptIndex := addEffectItem SEFF poisonRefCloned

            ;poison duration correction
            let poisonDuration := 4 * poisonDuration

            ;set new effect script
            let poisonScriptRef := ObXPPoisonScript
            setNthEffectItemScript poisonScriptRef poisonRefCloned poisonScriptIndex
            setNthEffectItemDuration poisonDuration poisonRefCloned poisonScriptIndex
            setNthEffectItemScriptVisualEffect POSN poisonRefCloned poisonScriptIndex
            setNthEffectItemScriptHostile 1 poisonRefCloned poisonScriptIndex

            ;re-apply poison to weapon
            player.removeEquippedWeaponPoison
            player.setEquippedWeaponPoison poisonRefCloned

            if (ObXPMain.debugMode)
                Scribe "New Poison: [%i %n] Cloned: [%i %n]|OblivionXP" poisonRef poisonRef poisonRefCloned poisonRefCloned
            endif
            
            let ObXPMain.poisonRefCloned := poisonRefCloned
            let ObXPMain.poisonRefBase := poisonRefOriginal
        endif
    endif

 

Poison Effect Script:

 

scn ObXPPoisonScript

;this is a script effect that is added to any poison on the player's weapon
;it manually increases the player's kill counter if the actor it's applied to was killed by the poison
;the script will only run for the duration of the poison

ref actor
ref poisonRef

float damageDone
float scriptTimer
float scriptTimerTotal

int j

short killRegistered

float creatureKills
float npcKills

;debug variables
float actorHealth
int effectCnt
int effectInt
float dmg
string_var effectCode
float resPoison
float ckills
float pkills

begin ScriptEffectStart
    ;get reference to the original poison
    let poisonRef := ObXPMain.poisonRefBase
    
    if (ObXPMain.debugMode)
        Scribe "Poison Applied: %i %n" poisonRef poisonRef
    endif
    
    ;get reference to the actor the poison is on (the target of the player)
    let actor := getSelf
    
    ; get current values for creature and NPC kills
    let creatureKills := GetPCMiscStat 5
    let npcKills := GetPCMiscStat 6

    ;go through all effects on the poison and calculate damage done by each effect
    let damageDone := 0
    let j := 0
    if (ObXPMain.debugMode)
        let effectCnt := getMagicItemEffectCount poisonRef
        scribe "Num Effects: %.0f" effectCnt
    endif
    while ( j < getMagicItemEffectCount poisonRef )
        ;initial damage equals spell magnitude

        let effectInt := getNthEffectItemCode poisonRef j
        let effectCode := getMagicEffectCharsC effectInt
        let dmg := getNthEffectItemMagnitude poisonRef j
        
        if (ObXPMain.debugMode)
            scribe "Effect: %z, Magnitude: %.4f" effectCode dmg
        endif
        
        ; sum up the damage from the health related effects only (damage health, drain health, fire damage, frost damage, shock damage)
        ; need to consider individual resistances before adding to total damage done.  Negative resistance is a weakness, so the damage
        ; will be increased.
        if ( effectInt == ( getMECode DGHE ))
            let damageDone := damageDone + dmg
        elseif ( effectInt == ( getMECode DRHE ))
            let damageDone := damageDone + dmg
        elseif ( effectInt == ( getMECode FIDG ))
            let damageDone := damageDone + dmg * ( 100 - actor.getAV ResistFire ) / 100
        elseif ( effectInt == ( getMECode FRDG ))
            let damageDone := damageDone + dmg * ( 100 - actor.getAV ResistFrost ) / 100
        elseif ( effectInt == ( getMECode SHDG ))
            let damageDone := damageDone + dmg * ( 100 - actor.getAV ResistShock ) / 100
        endif
        
        let j := j + 1
    loop

    let resPoison := (100 - actor.getAV ResistPoison) / 100

    if (ObXPMain.debugMode)
        scribe "Total damage: %.4f" damageDone
        scribe "Poison resistance: %.4f" resPoison
    endif

    ; defenses against poison damage include resist poison, and resist elemental effects, calculated above
    ; weakness to poison enhances damage
    let damageDone := damageDone * resPoison
        
    let actorHealth := actor.getAV Health

    if (ObXPMain.debugMode)
        scribe "Net damage done: %.4f" damageDone
        scribe "Health of target: %.4f" actorHealth
        let ckills := GetPCMiscStat 5
        let pkills := GetPCMiscStat 6
        scribe "Creature kills: %.4f, NPC kills: %.4f" ckills pkills
    endif
    
    ;check if damage is enough to kill the actor - need to compare before and after misc. stats and possibly use kill command
    ; to get death to register
    if (( damageDone >= actorHealth ) && ( actorHealth > 0 ))
        actor.kill player
        PrintC "ObXP: Poison killed %n!" actor
        let killRegistered := 1

        if (ObXPMain.debugMode)
            let ckills := GetPCMiscStat 5
            let pkills := GetPCMiscStat 6
            scribe "Creature kills: %.4f, NPC kills: %.4f" ckills pkills
        endif
    endif
    
end

begin ScriptEffectUpdate
    let scriptTimer := scriptTimer + scriptEffectElapsedSeconds
    let scriptTimerTotal := scriptTimerTotal + scriptEffectElapsedSeconds
    if ( scriptTimer >= 0.98 )
        let scriptTimer := 0

        ;go through all effects on the poison and calculate damage done by each effect
        let damageDone := 0
        let j := 0

        while ( j < getMagicItemEffectCount poisonRef )
            ;initial damage equals spell magnitude
            
            let effectInt := getNthEffectItemCode poisonRef j
            let effectCode := getMagicEffectCharsC effectInt
            let dmg := getNthEffectItemMagnitude poisonRef j

            if (ObXPMain.debugMode)
                scribe "Effect Update: Effect = %z, Magnitude = %.4f" effectCode dmg
            endif
        
            if ( effectInt == ( getMECode DGHE ))
                let damageDone := damageDone + dmg
            elseif ( effectInt == ( getMECode DRHE ))
                let damageDone := damageDone + dmg
            elseif ( effectInt == ( getMECode FIDG ))
                let damageDone := damageDone + dmg * ( 100 - actor.getAV ResistFire ) / 100
            elseif ( effectInt == ( getMECode FRDG ))
                let damageDone := damageDone + dmg * ( 100 - actor.getAV ResistFrost ) / 100
            elseif ( effectInt == ( getMECode SHDG ))
                let damageDone := damageDone + dmg * ( 100 - actor.getAV ResistShock ) / 100
            endif

            let j := j + 1
        loop

        let resPoison := (100 - actor.getAV ResistPoison) / 100

        if (ObXPMain.debugMode)
            scribe "Total damage: %.4f" damageDone
            scribe "Poison resistance: %.4f" resPoison
        endif

        let damageDone := damageDone * resPoison
        let actorHealth := actor.getAV Health

        if (ObXPMain.debugMode)
            scribe "Net damage done: %.4f" damageDone
            scribe "Health of target: %.4f" actorHealth
            let ckills := GetPCMiscStat 5
            let pkills := GetPCMiscStat 6
            scribe "Before kill: Creature kills: %.4f, NPC kills: %.4f" ckills pkills
        endif
        
        ;check if damage is enough to kill the actor
        if (( damageDone >= actorHealth ) && ( actorHealth > 0 ))
            actor.kill player
            PrintC "ObXP: Poison killed %n!" actor
            let killRegistered := 1

            if (ObXPMain.debugMode)
                let ckills := GetPCMiscStat 5
                let pkills := GetPCMiscStat 6
                scribe "After kill, update cycle: Creature kills: %.4f, NPC kills: %.4f" ckills pkills
            endif
        endif
    endif
end

begin ScriptEffectFinish
    ; the resistances of certain creatures aren't captured properly, so they die in between the update cycles
    ; try to capture those cases here - return in update cycle not working.  Also need to account for critter
    ; dying by brute force, in which case the kill will be registered by the regular kill script.
    
    if (killRegistered)
        sv_Destruct effectCode
        return
    endif
    
    if (actor.getDead)
        if ( actor.getObjectType == 35 )
            if ( GetPCMiscStat 6 == npcKills )
                modPCMiscStat 6 1
                call OBXPfnOnDeath actor, player
                PrintC "ObXP: Poison killed %n!" actor
            endif
        elseif ( actor.getObjectType == 36 )
            if ( GetPCMiscStat 5 == creatureKills )
                modPCMiscStat 5 1
                call OBXPfnOnDeath actor, player
                PrintC "ObXP: Poison killed %n!" actor
            endif
        endif
        
        if (ObXPMain.debugMode)
            let ckills := GetPCMiscStat 5
            let pkills := GetPCMiscStat 6
            scribe "After kill, finish cycle: Creature kills: %.4f, NPC kills: %.4f" ckills pkills
        endif
    endif
    sv_Destruct effectCode
end

 

Since the Derived Attributes script is running when it shouldn't, it's overwriting the poisonRefBase variable with the scripted version.

Share this post


Link to post
Share on other sites

Hrmmm.  Well, other than storing the original poison ref in a quest variable, your derived attributes script is identical.  How often does it run?  Mine runs every .1 seconds.  It occurs to me that if yours is running every frame, it may not be enough time for the system to register removing the old potion and adding the new one.  Therefore, on the next frame it does it again.  Could that be it?  Without seeing the rest of the script it's hard to tell.

 

I'm not convinced that storing the original poison as the base reference for the scripted effect works, because it has been removed from the weapon and therefore might no longer be a valid reference.  In addition, my magic effect script is set up slightly differently.  For one thing, even though it ends up examining itself, when it gets to the script in the list of poison effects it doesn't do anything because it doesn't match any of the expected nthEffectItemCodes.  And it's not really looking at the script itself, it's just looking at what the script effect code number is for SEFF.  And since that code number isn't used, it's disregarded.

 

Although our poison effect scripts are coded slightly differently, they seem to do basically the same thing.  (Although I now see a wee bit of room for improvement in mine).

So I don't really know what to tell you.  I haven't run into any of the problems that you have.  Multiple poisoned arrows on the same person only gives me xp once, poison applied to a weapon only gets swapped out once, and the replacement poison when used as the reference for calculating damage, etc. doesn't seem to cause any damage calculation problems, crashes, or performance issues.

 

EDIT:  One thing I noticed that was different between our scripts is that at the end of the magic script effect, I clear out the quest variable holding the poison ref.  Maybe that has something to do with it?  Perhaps you should be clearing out those variables?

Edited by saebel

Share this post


Link to post
Share on other sites

Saebel,  I would like to see your code in action in my game.  I can make these multiple XP issue happen whenever I want.  I have version SDR_8_1_1_b0_beta.  Is this the current one?  Plus how do I setup SDR and OBXP to make sure your code is the one that is handling everything.

 

Saebel, when you tested with poisons, were you using long lasting ones?  The problem isn't that you poisoned them multiple times, but that they must have multiple poisons active in their system at the time of death.  Longer lasting poison makes it more likely that these poison are still active.  This issue was pretty much fixed in OBXP's latest version.  I don't know if you added it to your code in your latest version of SDR. 

 

While the cloning of the weapon may be an issue, I still believe that it has nothing to do with the two issues I have described.  I could be wrong, and I hope I am, as I am sure we all would like to put these issues to bed.  But from my testing and even just running the Poison script in my head, I am pretty sure I am correct in this assumption.   The Poison script doesn't care which poisonref it is from what I can see.  It only calculates the damage, so as long as the poisonref contains the correct info to do the math, it doesn't matter which one it is.  Anyway, once you two sort out the cloning issue, I will be able the test these issues and we will know for sure, hopefully!!

 

I actually have three more scenarios that cause problems with the Poison script that I have yet to bring up.  Two I have tested and confirmed but the third is harder to make happen as it requires an NPC to make a kill at the right time.  Two of them are rare but the third happens all the time in normal play.  It was hidden by the Stacked Poison issue,  just like the Simultaneous Kill issue was hidden.  

Share this post


Link to post
Share on other sites

Hrmmm.  Well, other than storing the original poison ref in a quest variable, your derived attributes script is identical.  How often does it run?  Mine runs every .1 seconds.  It occurs to me that if yours is running every frame, it may not be enough time for the system to register removing the old potion and adding the new one.  Therefore, on the next frame it does it again.  Could that be it?  Without seeing the rest of the script it's hard to tell.

 

I'm not convinced that storing the original poison as the base reference for the scripted effect works, because it has been removed from the weapon and therefore might no longer be a valid reference.  In addition, my magic effect script is set up slightly differently.  For one thing, even though it ends up examining itself, when it gets to the script in the list of poison effects it doesn't do anything because it doesn't match any of the expected nthEffectItemCodes.  And it's not really looking at the script itself, it's just looking at what the script effect code number is for SEFF.  And since that code number isn't used, it's disregarded.

 

Although our poison effect scripts are coded slightly differently, they seem to do basically the same thing.  (Although I now see a wee bit of room for improvement in mine).

 

So I don't really know what to tell you.  I haven't run into any of the problems that you have.  Multiple poisoned arrows on the same person only gives me xp once, poison applied to a weapon only gets swapped out once, and the replacement poison when used as the reference for calculating damage, etc. doesn't seem to cause any damage calculation problems, crashes, or performance issues.

 

EDIT:  One thing I noticed that was different between our scripts is that at the end of the magic script effect, I clear out the quest variable holding the poison ref.  Maybe that has something to do with it?  Perhaps you should be clearing out those variables?

 

The derirved attributes script runs every .01 seconds. It has to run that frequently because it also handles the health, magicka and fatigue regeneration, if the player has enabled those. I think you might have hit the nail right on the head though: I'll try clearing out the quest variable holding the quest reference. Milotek is correct: the fact that the poison reference isn't the same doesn't matter. It's only used to track the poison effects. Now if there was only one scripted effect, it may not hurt to use the real poison reference, but the problem right now is that with the duplication, there are hundreds of SEFF's and they are what is causing the multiple XP awards.

 

Saebel,  I would like to see your code in action in my game.  I can make these multiple XP issue happen whenever I want.  I have version SDR_8_1_1_b0_beta.  Is this the current one?  Plus how do I setup SDR and OBXP to make sure your code is the one that is handling everything.

 

Saebel, when you tested with poisons, were you using long lasting ones?  The problem isn't that you poisoned them multiple times, but that they must have multiple poisons active in their system at the time of death.  Longer lasting poison makes it more likely that these poison are still active.  This issue was pretty much fixed in OBXP's latest version.  I don't know if you added it to your code in your latest version of SDR. 

 

While the cloning of the weapon may be an issue, I still believe that it has nothing to do with the two issues I have described.  I could be wrong, and I hope I am, as I am sure we all would like to put these issues to bed.  But from my testing and even just running the Poison script in my head, I am pretty sure I am correct in this assumption.   The Poison script doesn't care which poisonref it is from what I can see.  It only calculates the damage, so as long as the poisonref contains the correct info to do the math, it doesn't matter which one it is.  Anyway, once you two sort out the cloning issue, I will be able the test these issues and we will know for sure, hopefully!!

 

I actually have three more scenarios that cause problems with the Poison script that I have yet to bring up.  Two I have tested and confirmed but the third is harder to make happen as it requires an NPC to make a kill at the right time.  Two of them are rare but the third happens all the time in normal play.  It was hidden by the Stacked Poison issue,  just like the Simultaneous Kill issue was hidden.  

 

You just need to run SDR and Ob XP together. There's no set up needed. If you disable Oblivion XP's poison script by setting the variable to 0 in the ini, you won't get any points for killing something with poison.

 

This does bring up a point that I've been thinking about for a while. Saebel, if someone is running Oblivion XP, I think you should disable your poison script. We can't disable Ob XP's because it awards the kill points. I would have to create a completely separate script if they are running SDR to award the points without monitoring the poison effects and I'm not sure that's even possible. I'm wondering if the fact that we've got two mods trying to do the same thing is why the derived attributes replication routines aren't working. There is something changing those form ID's and I think it's SDR. SDR is winning because you have an ESM. Would it be possible for you to disable your poison script if Oblivion XP is detected?

Share this post


Link to post
Share on other sites

Milotek:

In my poison tests, I made sure the poisons lasted 20 seconds each.  So I made sure that I could get at least three arrows into the targets before they died while all the poisons were actively running.

You need to run the more recent version of SDR.  It's available on the Nexus.

 

AndalayBay:

Actually, I think you are the one who has figured it out.  I don't have Oblivion XP installed.  If both our poison replacers are happening simultaneously, then yes, they would keep swapping out each other.  Every time my script replaced a poison, your script would detect a different poison ref and replace it.  Then my script would detect a different poison ref and replace it.  Etc. etc.

 

I *could* disable my poison replacer if Oblivion XP is detected.  That would certainly solve the problem.  However, that means that they won't get any assassination bonus XP for poison kills if they are undetected.  Personally, that doesn't bother me.  It means they have to do it the hard way.  :)  So if you want to go in that direction, I can do that.

Edited by saebel

Share this post


Link to post
Share on other sites

If we went back to disabling Ob XP's poison handling, how would I detect the kill from poison? It works fine that way, but you don't get any points. The assassination points are just a bonus, not the base points. And assassinations, especially by poison, are pretty hard to get anyway. If that's correct, then I would say to suspend your poison replacer if Ob XP is detected.

Share this post


Link to post
Share on other sites

AndalayBay, under your thinking, if there are multiple Script effects because of the derirved attributes script, wouldn't that create multiple XP on all kills not just the cases I have brought up?  Another thing, if you believe SDR and OBXP are conflicting causing the derirved attributes script to not function correctly thus causing multiple XP, then why would I have the problem since I am not running SDR?  Just a couple of thing you think about.

Share this post


Link to post
Share on other sites

AndalayBay:

Actually, I think you are the one who has figured it out.  I don't have Oblivion XP installed.  If both our poison replacers are happening simultaneously, then yes, they would keep swapping out each other.  Every time my script replaced a poison, your script would detect a different poison ref and replace it.  Then my script would detect a different poison ref and replace it.  Etc. etc.

 

Saebel,  while your theory about the swapping poisonrefs may be true,  since I don't use SDR it doesn't explain my issue with multiple XP.

Share this post


Link to post
Share on other sites

AndalayBay, how can I test to see if I am getting the issue in the derirved attributes script.  As Saebel stated maybe it is because you use both OBXP and SDR. Saebel doesn't have the derived attributes script issue and doesn;t use OBXP.  I need to see if I have the issue with the derirved attributes script since I only run OBXP. 

Share this post


Link to post
Share on other sites

Milotek, we're just taking this one step at a time. I need to recreate your problem in order to figure out the cause. I can't recreate your problem until I get Ob XP's scripts working the way they should.

Share this post


Link to post
Share on other sites

Milotek, we're just taking this one step at a time. I need to recreate your problem in order to figure out the cause. I can't recreate your problem until I get Ob XP's scripts working the way they should.

Ok I understand,  I will leave it alone until you sort things out.  I think it would be beneficial if we knew whether I was having the derived attributes script problem.  If Sabel and I don't have the issue but you do,  It would highly suggest an conflict with the two mods

Edited by Milotek

Share this post


Link to post
Share on other sites

Correct me if I'm wrong, but won't any kill grant Oblivion XP points?  So let's say you disabled your poison script and mine was enabled.  The moment my poison script kills the target, Oblivion XP would detect it and award the points, right?

 

The only exception would be when it gets to the end of the poison effect script I suppose.  However, I think we could use OBSE 21s new features to get around that if you want to experiment.  Let me know.

Share this post


Link to post
Share on other sites

OK this is what I got.  I applied a poison then killed a mud crab with it.  This caused the multiple XP due to the Simultaneous Kill.  Also my kill stat for creatures was 872 before I attempted the kill

New Poison: [FF127E64 _Damage Health] Cloned: [FF1318C5 _Damage Health]
Poison Applied: FF127E64 _Damage Health
Num Effects: 1
Effect: DGHE, Magnitude: 7.0000
Total damage: 7.0000
Poison resistance: 1.0000
Net damage done: 7.0000
Health of target: 0.0000
Creature kills: 873.0000, NPC kills: 223.0000
After kill, finish cycle: Creature kills: 874.0000, NPC kills: 223.0000

 

Share this post


Link to post
Share on other sites

Correct me if I'm wrong, but won't any kill grant Oblivion XP points?  So let's say you disabled your poison script and mine was enabled.  The moment my poison script kills the target, Oblivion XP would detect it and award the points, right?

 

The only exception would be when it gets to the end of the poison effect script I suppose.  However, I think we could use OBSE 21s new features to get around that if you want to experiment.  Let me know.

 

There are certain times where XP needs to be given without really capturing the kill. 

Share this post


Link to post
Share on other sites

Correct me if I'm wrong, but won't any kill grant Oblivion XP points?  So let's say you disabled your poison script and mine was enabled.  The moment my poison script kills the target, Oblivion XP would detect it and award the points, right?

 

The only exception would be when it gets to the end of the poison effect script I suppose.  However, I think we could use OBSE 21s new features to get around that if you want to experiment.  Let me know.

 

The problem is that you've lost the connection to the player. It's a kill, but the kill isn't attributed to the player. That's why the poison effect script updates the miscellaneous stats and manually calls Ob XP's onDeath handler.

 

So you're thinking of calling Ob XP's onDeath handler? You mentioned that in our PM thread. That might work.

Share this post


Link to post
Share on other sites

 

OK this is what I got.  I applied a poison then killed a mud crab with it.  This caused the multiple XP due to the Simultaneous Kill.  Also my kill stat for creatures was 872 before I attempted the kill

New Poison: [FF127E64 _Damage Health] Cloned: [FF1318C5 _Damage Health]
Poison Applied: FF127E64 _Damage Health
Num Effects: 1
Effect: DGHE, Magnitude: 7.0000
Total damage: 7.0000
Poison resistance: 1.0000
Net damage done: 7.0000
Health of target: 0.0000
Creature kills: 873.0000, NPC kills: 223.0000
After kill, finish cycle: Creature kills: 874.0000, NPC kills: 223.0000

 

That's from the poison kill script. What about the lines from the Derived Attributes script? Could you post the contents of the entire log?

 

Edit: Oh, it looks like you did post it all. That's it? Wow, I haven't seen a log that small in a while. :lol:

 

Ok, so that's working properly. Now could you try one of your multiple poison tests?

Edited by AndalayBay

Share this post


Link to post
Share on other sites

I poisoned a frost imp 3 times with Fatigue poisons by arrow and then killed it with the 4th arrow(no poison).  I would have gotten three XP messages and points but with the fix we put in it only gave one.

New Poison: [FF0FBB2D _Damage Fatigue] Cloned: [FF131893 _Damage Fatigue]
Poison Applied: FF0FBB2D _Damage Fatigue
Num Effects: 1
Effect: DGFA, Magnitude: 10.0000
Total damage: 0.0000
Poison resistance: 1.0000
Net damage done: 0.0000
Health of target: 57.5803
Creature kills: 872.0000, NPC kills: 223.0000
New Poison: [FF0FBB2D _Damage Fatigue] Cloned: [FF1318BB _Damage Fatigue]
Effect Update: Effect = DGFA, Magnitude = 10.0000
Total damage: 0.0000
Poison resistance: 1.0000
Net damage done: 0.0000
Health of target: 57.5803
Before kill: Creature kills: 872.0000, NPC kills: 223.0000
Effect Update: Effect = DGFA, Magnitude = 10.0000
Total damage: 0.0000
Poison resistance: 1.0000
Net damage done: 0.0000
Health of target: 57.5803
Before kill: Creature kills: 872.0000, NPC kills: 223.0000
Effect Update: Effect = DGFA, Magnitude = 10.0000
Total damage: 0.0000
Poison resistance: 1.0000
Net damage done: 0.0000
Health of target: 57.5803
Before kill: Creature kills: 872.0000, NPC kills: 223.0000
Poison Applied: FF0FBB2D _Damage Fatigue
Num Effects: 1
Effect: DGFA, Magnitude: 10.0000
Total damage: 0.0000
Poison resistance: 1.0000
Net damage done: 0.0000
Health of target: 37.5355
Creature kills: 872.0000, NPC kills: 223.0000
New Poison: [FF0FBB2D _Damage Fatigue] Cloned: [FF1318BD _Damage Fatigue]
Effect Update: Effect = DGFA, Magnitude = 10.0000
Total damage: 0.0000
Poison resistance: 1.0000
Net damage done: 0.0000
Health of target: 37.5355
Before kill: Creature kills: 872.0000, NPC kills: 223.0000
Effect Update: Effect = DGFA, Magnitude = 10.0000
Total damage: 0.0000
Poison resistance: 1.0000
Net damage done: 0.0000
Health of target: 37.5355
Before kill: Creature kills: 872.0000, NPC kills: 223.0000
Effect Update: Effect = DGFA, Magnitude = 10.0000
Total damage: 0.0000
Poison resistance: 1.0000
Net damage done: 0.0000
Health of target: 37.5355
Before kill: Creature kills: 872.0000, NPC kills: 223.0000
Effect Update: Effect = DGFA, Magnitude = 10.0000
Total damage: 0.0000
Poison resistance: 1.0000
Net damage done: 0.0000
Health of target: 37.5355
Before kill: Creature kills: 872.0000, NPC kills: 223.0000
Effect Update: Effect = DGFA, Magnitude = 10.0000
Total damage: 0.0000
Poison resistance: 1.0000
Net damage done: 0.0000
Health of target: 37.5355
Before kill: Creature kills: 872.0000, NPC kills: 223.0000
Effect Update: Effect = DGFA, Magnitude = 10.0000
Total damage: 0.0000
Poison resistance: 1.0000
Net damage done: 0.0000
Health of target: 37.5355
Before kill: Creature kills: 872.0000, NPC kills: 223.0000
Poison Applied: FF0FBB2D _Damage Fatigue
Num Effects: 1
Effect: DGFA, Magnitude: 10.0000
Total damage: 0.0000
Poison resistance: 1.0000
Net damage done: 0.0000
Health of target: 17.4962
Creature kills: 872.0000, NPC kills: 223.0000
Effect Update: Effect = DGFA, Magnitude = 10.0000
Total damage: 0.0000
Poison resistance: 1.0000
Net damage done: 0.0000
Health of target: 17.4962
Before kill: Creature kills: 872.0000, NPC kills: 223.0000
Effect Update: Effect = DGFA, Magnitude = 10.0000
Total damage: 0.0000
Poison resistance: 1.0000
Net damage done: 0.0000
Health of target: 17.4962
Before kill: Creature kills: 872.0000, NPC kills: 223.0000
Effect Update: Effect = DGFA, Magnitude = 10.0000
Total damage: 0.0000
Poison resistance: 1.0000
Net damage done: 0.0000
Health of target: 17.4962
Before kill: Creature kills: 872.0000, NPC kills: 223.0000
Effect Update: Effect = DGFA, Magnitude = 10.0000
Total damage: 0.0000
Poison resistance: 1.0000
Net damage done: 0.0000
Health of target: 17.4962
Before kill: Creature kills: 872.0000, NPC kills: 223.0000
Effect Update: Effect = DGFA, Magnitude = 10.0000
Total damage: 0.0000
Poison resistance: 1.0000
Net damage done: 0.0000
Health of target: 17.4962
Before kill: Creature kills: 872.0000, NPC kills: 223.0000
Effect Update: Effect = DGFA, Magnitude = 10.0000
Total damage: 0.0000
Poison resistance: 1.0000
Net damage done: 0.0000
Health of target: 17.4962
Before kill: Creature kills: 872.0000, NPC kills: 223.0000
Effect Update: Effect = DGFA, Magnitude = 10.0000
Total damage: 0.0000
Poison resistance: 1.0000
Net damage done: 0.0000
Health of target: 17.4962
Before kill: Creature kills: 872.0000, NPC kills: 223.0000
Effect Update: Effect = DGFA, Magnitude = 10.0000
Total damage: 0.0000
Poison resistance: 1.0000
Net damage done: 0.0000
Health of target: 17.4962
Before kill: Creature kills: 872.0000, NPC kills: 223.0000
Effect Update: Effect = DGFA, Magnitude = 10.0000
Total damage: 0.0000
Poison resistance: 1.0000
Net damage done: 0.0000
Health of target: 17.4962
Before kill: Creature kills: 872.0000, NPC kills: 223.0000
After kill, finish cycle: Creature kills: 873.0000, NPC kills: 223.0000
After kill, finish cycle: Creature kills: 873.0000, NPC kills: 223.0000
After kill, finish cycle: Creature kills: 873.0000, NPC kills: 223.0000
Edited by Milotek

Share this post


Link to post
Share on other sites

Yeah, damage fatigue won't do anything. You're just killing it with arrows. Does your character have any alchemy skills? I have a poison recipe that will kill a timber wolf by poison alone. You can hit it with a poisoned arrow and it will drop dead as it runs towards you. It's really cool. :D

 

Journeyman level formula:

 

Damage Health + Damage Magicka + Fire Damage

 

Steel-blue Entoloma Cap + Spiddal Stick + Bergamot seeds OR Rat Meat + Nightshade, Peony seeds, St. John's Wort nectar, Strawberry, Venison OR Wisp stalk caps.

 

It's only one of the last ingredients in that list. I usually use Nightshade OR Peony seeds - whichever I have more of. Damage Magicka doesn't do anything to wolves, but that poison is also really effective against High Elf conjurers. The health and fire damage take care of wolves just fine.

Share this post


Link to post
Share on other sites

Yes I do alchemy all the times.  As I stated in other posts, the issue with stacked poison can happen with any poison.  I just used Fatigue as it won't kill the actor before I want it to.  I could used a Health one with the same results.  I will do one with health poisons.

Share this post


Link to post
Share on other sites

I shot an arrow with one health poison and waited for it to die. 

New Poison: [FF127E64 _Damage Health] Cloned: [FF131893 _Damage Health]
Poison Applied: FF127E64 _Damage Health
Num Effects: 1
Effect: DGHE, Magnitude: 7.0000
Total damage: 7.0000
Poison resistance: 1.0000
Net damage done: 7.0000
Health of target: 62.0070
Creature kills: 872.0000, NPC kills: 223.0000
Effect Update: Effect = DGHE, Magnitude = 7.0000
Total damage: 7.0000
Poison resistance: 1.0000
Net damage done: 7.0000
Health of target: 55.1609
Before kill: Creature kills: 872.0000, NPC kills: 223.0000
Effect Update: Effect = DGHE, Magnitude = 7.0000
Total damage: 7.0000
Poison resistance: 1.0000
Net damage done: 7.0000
Health of target: 48.2730
Before kill: Creature kills: 872.0000, NPC kills: 223.0000
Effect Update: Effect = DGHE, Magnitude = 7.0000
Total damage: 7.0000
Poison resistance: 1.0000
Net damage done: 7.0000
Health of target: 41.3779
Before kill: Creature kills: 872.0000, NPC kills: 223.0000
Effect Update: Effect = DGHE, Magnitude = 7.0000
Total damage: 7.0000
Poison resistance: 1.0000
Net damage done: 7.0000
Health of target: 34.3778
Before kill: Creature kills: 872.0000, NPC kills: 223.0000
Effect Update: Effect = DGHE, Magnitude = 7.0000
Total damage: 7.0000
Poison resistance: 1.0000
Net damage done: 7.0000
Health of target: 27.3777
Before kill: Creature kills: 872.0000, NPC kills: 223.0000
Effect Update: Effect = DGHE, Magnitude = 7.0000
Total damage: 7.0000
Poison resistance: 1.0000
Net damage done: 7.0000
Health of target: 20.4897
Before kill: Creature kills: 872.0000, NPC kills: 223.0000
Effect Update: Effect = DGHE, Magnitude = 7.0000
Total damage: 7.0000
Poison resistance: 1.0000
Net damage done: 7.0000
Health of target: 13.5946
Before kill: Creature kills: 872.0000, NPC kills: 223.0000
Effect Update: Effect = DGHE, Magnitude = 7.0000
Total damage: 7.0000
Poison resistance: 1.0000
Net damage done: 7.0000
Health of target: 6.5945
Before kill: Creature kills: 872.0000, NPC kills: 223.0000
After kill, update cycle: Creature kills: 873.0000, NPC kills: 223.0000

 

Share this post


Link to post
Share on other sites

That's not how I imagined you doing the stacked poisons. Ok, well it seems to be working, so the scripts are fine. We just need to figure out how to get SDR to play nice. :D

Share this post


Link to post
Share on other sites

Ok, so check this out.  Here's the documentation:

 

 

User-Defined Events

 

In addition to the events supplied by OBSE, mods can also register event handlers for events dispatched by other mods. These types of events are referred to as "user-defined events". The event handler for a user-defined event always takes one argument: a Stringmap. The stringmap argument always includes the following two key-value pairs:

 

"eventName": a string indicating the event which occurred

"eventSender": a string indicating the origin of the event. By default this is the filename of the mod which dispatched the event, unless that mod supplied an alternate sender name.

The stringmap argument will also contain any additional data supplied by the sender of the event.

To register an event handler for a user-defined event, use SetEventHandler. To dispatch an event to any registered listeners, use DispatchEvent

Example:

 

scriptname EventHandler

array_var args

begin Function {args}

print "Event " + args->eventName + " received from " + args->eventSender

print $arg->activator + " was activated by " + $arg->activatedBy

end

 

scriptname EventSender

begin onActivate

DispatchEvent "Activated" (ar_Map "activator"::GetSelf "activatedBy"::GetActionRef)

end

DispatchEvent - dispatches a user-defined event to any registered listeners. The eventName parameter specifies the event that occurred; this should be fairly unique to prevent event name clashes between different mods, but the event handler can also disambiguate name clashes by checking the name of the event sender if necessary. The optional second parameter is a StringMap containing any additional information about the event. When the event is dispatched, the array will also include the event name and the name of the sender. If omitted, the name of the sender is the filename from which the event originated; otherwise it matches the supplied third argument.

(dispatched:bool) DispatchEvent eventName:string args:StringMap senderName:string

 

 

 

I think what you need to do is add the following line of code in your initialization set up:

SetEventHandler "sdrPoisonKill" OBXPfnOnDeath
Then what I do at the end of my poison effect script is the following:

begin ScriptEffectFinish

    let sdrQ.rPoisonCloned := 0

; the resistances of certain creatures isn't captured properly, so they die in between the update cycles
; try to capture those cases here - return in update cycle not working.  Also need to account for critter
; dying by brute force, in which case the kill will be registered by the regular kill script.

    if iKillRegistered
        return
    endif

    if rActor.GetDead
        if rActor.IsCreature
            if ( GetPCMiscStat 5 == fKillsCreatures )
                ModPCMiscStat 5 1
                if iDebug
                    PrintToConsole "SDR: Poison killed %n! (scenario 2)" rActor
                endif
                DispatchEvent "sdrPoisonKill" (ar_Map "target"::rActor "killer"::PlayerRef)
;               check for assassination skill up directly, because OnDeath handler probably missed it
                if PlayerRef.isSneaking
                    Call sdrEHAssassinationCheck rActor PlayerRef 1
                endif
            endif
        else
            if ( GetPCMiscStat 6 == fKillsNPCs )
                ModPCMiscStat 6 1
                if iDebug
                    PrintToConsole "SDR: Poison killed %n! (scenario 3)" rActor
                endif
                DispatchEvent "sdrPoisonKill" (ar_Map "target"::rActor "killer"::PlayerRef)
;               check for assassination skill up directly, because OnDeath handler probably missed it
                if PlayerRef.isSneaking
                    Call sdrEHAssassinationCheck rActor PlayerRef 1
                endif
            endif
        endif

    endif

end
Note the two "DispatchEvent" lines.

 

In theory what this will do is that whenever I dispatch the "sdrPoisonKill" event, your "sdrPoisonKill" event handler will pick it up along with the arguments I've passed and then activate your on death handler with those arguments, causing the OB XP kill points to be added. After the OB XP kill points are added, then my assassination script will kick in if appropriate.

 

So in theory, your initialization code would be wrapped in something along the following lines:

if GetModLoaded "SDR.esm"
  ; code to check version compatibility (will be 8212 +)
  if versionokay == 1
    ; code to check that SDR's poison script is active
    if GetGameSetting iSDRsApplyPoisonBugFix == 1
      ; code to disable your poison fix
      let OBXPoisonFix := 0
      ; code to set up your event listener
      SetEventHandler "sdrPoisonKill" OBXPfnOnDeath
    endif
    ; whatever other SDR compatibility stuff needs to be here
    ; (stuff for disabling sneak multiplier if SDR assassination skill up is active)
  endif
endif
If this works, that would be freaking badass. What's more, it means that in theory you could set this up to listen for and call ANY function from another mod, not just the default handlers. In this particular case, it just happens to be the same function because that's what is needed for the xp.

 

Wanna try it?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×