I am working on trying to get a mod (http://www.nexusmods.com/skyrim/mods/10067/?) from the original Skyrim to work in SE with a few additional features. I have managed to add the ingredients from the DLC to the mod with no issues. The difficulty I am having is trying to prevent the mod from breaking the ability to be ethereal. As it happens now, when the auto harvest triggers, the character is dropped out of ethereal form. My idea is to check the HasMagicEffect field for ethereal and if it is true prevent harvesting.
Scriptname AutoHarvestQuest extends Quest
FormList Property floraList Auto
Quest Property AutoHarvest Auto
Float Property HarvestDistance = 5000.0 Auto
Float Property HarvestDistMult = 0.5 Auto
MagicEffect Property ethereal Auto
Event OnUpdate()
Actor plyr = Game.GetPlayer()
; Get Harvest Distance
float distMultPerc = plyr.GetActorValuePercentage("alchemy")
float distTotal = HarvestDistance * (1 + (HarvestDistMult * distMultPerc))
ObjectReference floraRef = none
int loop = 0
If (plyr.HasMagicEffect(ethereal))
loop = 4
EndIf
while (loop < 3)
floraRef = Game.FindRandomReferenceOfAnyTypeInListFromRef(floraList, plyr, distTotal)
floraList.Revert() ;Needed to find the next herb. Otherwise, we keep returning a null ref for some reason.
If (floraRef != none)
If ((floraRef.GetActorOwner() == none) && (floraRef.GetFactionOwner() == none))
Cell pCell = floraRef.GetParentCell()
If ((pCell.GetActorOwner() == none) && (pCell.GetFactionOwner() == none))
floraRef.Activate(plyr)
return
EndIf
EndIf
EndIf
loop += 1
endWhile
endEvent
In the CK I have set the Property for ethereal to Ethereal and all other variants of it but always get the same papyrus log output:
[05/15/2017 - 03:35:35PM] Error: HasMagicEffect called with invalid Magic Effect
stack:
[ (00000014)].Actor.HasMagicEffect() - "<native>" Line ?
[AutoHarvestQuest (40002851)].AutoHarvestQuest.OnUpdate() - "autoharvestquest.psc" Line 20
[05/15/2017 - 03:35:51PM] VM is freezing...
I am new to papyrus and any help would be greatly appreciated