Hello. I'm trying to edit Realistic Needs and Diseases to add a small feature for personal use - I'd like to add modifiers on the base sleep points given based on the armor type that the player is wearing. The trouble I'm having is that regardless of the armor I am wearing in game, my script edit always seems to think that I am not wearing any light or heavy armor. I'm having it check the player's equipment for the ArmorLight and ArmorHeavy keywords. I've added these keywords to the script, and filled them in the CK to the auto-filled values. However, it is still not properly detecting the armor type. Would anyone with more experience mind helping me figure out what is wrong? Here is the relevant portion of the script:
Keyword Property ArmorHeavy Auto
Keyword Property ArmorLight Auto
Event OnSleepStart(float afSleepStartTime, float afDesiredSleepEndTime)
RemoveSleepSpells()
float NumOfHours = (afDesiredSleepEndTime - afSleepStartTime) * 24
if Player.WornHasKeyword(ArmorHeavy)
Debug.Notification("You are sleeping in heavy armor.")
; Give penalty here
elseif Player.WornHasKeyword(ArmorLight)
Debug.Notification("You are sleeping in light armor.")
; No effect
else
Debug.Notification("Sleeping bonus!")
; No light or heavy armor - give bonus here
; This is the message I am getting every time, even when I shouldn't.
endif
Debug.Notification("Initial sleep hours:" + NumOfHours)
; (code continues with the rest of the function, which is from default RND and I know works; this is the only part I edited.)
Thanks so much in advance!