Jump to content

GetOwner wrong when it is with AndAnd GetCurrentSoulLevel


Stealth21

Recommended Posts

Function GetOwner when used as a check within GetCurrentSoulLevel check is providing not a true. For example, I have next items in my inventory:

- 3 empty petty soul gems customly filled with a petty soul which owns by a player (which is not 00000014/00000007 but just zero);

- 1 empty petty soul gem which stolen from... ehm... Elsynia (BaseID 3e183, RefID 3e185 ElsyniaRef, no matter) also customly filled with a petty soul;

- 1 empty petty soul gem which stolen from... Gogan (no matter) also customly filled with a petty soul.

 

Stolen or not, BaseObject is same for both types. I would like to remove only the stolen empty petty soul gems like this:

ForEach iter <- Player
  if ( iter.GetBaseObject == SoulGemEmpty1Petty ) && ( iter.GetCurrentSoulLevel == 1 ) && ( iter.GetOwner != 0 )
    iter.RemoveMeIR
  endif
loop
but it removes ALL the customly filled petty soul gems of both types either player's or stolen.

 

Alright, then, I would like to remove only the player's empty petty soul gems and leave the stolen untouched like this:

ForEach iter <- Player
  if ( iter.GetBaseObject == SoulGemEmpty1Petty ) && ( iter.GetCurrentSoulLevel == 1 ) && (( iter.GetOwner == 0 ) || ( iter.GetOwner == Player ))
    iter.RemoveMeIR
  endif
loop
- now it removes NOTHING, either player's or stolen.

 

If to exclude the SoulLevel checking like this:

ForEach iter <- Player
  if ( iter.GetBaseObject == SoulGemEmpty1Petty ) && ( iter.GetOwner != 0 )
    iter.RemoveMeIR
  endif
loop
- then it is "Owner-sensetive" and works as it suppose to be working - in this certain example it removes the stolen soulgems only and leave the player's untouched (however, if I would have also a stolen empty lesser soulgem even without a soul filled with - the script would remove also it too).

 

The workaround fo this is just to use GetOwner check right in the next 'if' like this:

ForEach iter <- Player
  if ( iter.GetBaseObject == SoulGemEmpty1Petty ) && ( iter.GetCurrentSoulLevel == 1 ) 
    if ( iter.GetOwner != 0 )
      iter.RemoveMeIR
    endif
  endif
loop
Link to comment
Share on other sites

I have no a github account, because even if I would have, I do not actually understand the answers from the people who knows programming)) And a translative describing in not my native language is kinda mindful action. I wonder how much "sentencevelly" correct I am writting...))

KatsAwful, no, as I said, I have no github account and would like to not create it. And it is a little bit hard for me to explain things which I am translating first... But if you (or any other else person) understood what I wanted to explain, you just could make that issue there by yourself)

Link to comment
Share on other sites

Soul gems are a mess for sure... It is them that are the problem most likely, not the other functions used on them like getowner but that is what I think though... Not that it will change anything or make us wiser really.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...