Difference of GetPCSleep (?) behavior between vanilla and OpenMW
There's a difference of behavior between Morrowind.exe (with MCP, although I'm not sure if that's relevant) and OpenMW that's possibly related to the GetPCSleep MWScript function (?).
Attached here is a cut down version of a quest from an upcoming Tamriel Rebuilt release that's affected (you only need Morrowind/Tribunal/Bloodmoon to load it): GetPCSleepVamp.ESP
The script in question:
Begin TR_m4_VA_AshwalkerSleep_Sc
; Allows the player to sleep during the day as a vampire in Ashlands Region.
; state == 1 -- sleeping
short state
; sundamage == 0 -- you have a custom sun damage spell with no "Sun Damage" effect
; sundamage == 1 -- you have the standard "vampire sun damage" spell
short sundamage
; stop if player cured themselves
if ( PCVampire < 1 )
StopScript "TR_m4_VA_AshwalkerSleep_Sc"
endif
; while sleeping, switch out sun damage for a vampirism effect without sun damage
if ( state == 0 )
if ( GetPCSleep != 1 )
return
endif
; possible only in Ashlands Region
if ( GetPCCell "Ashlands Region" != 1 )
return
endif
player->AddSpell "TR_m4_VA_AshSleep_SunDmg"
if ( player->GetSpell "vampire sun damage" )
player->RemoveSpell "vampire sun damage"
set sundamage to 1
endif
set state to 1
; switch back to regular sun damage
elseif ( GetPCSleep != 1 )
if ( sundamage == 1 )
player->AddSpell "vampire sun damage"
set sundamage to 0
endif
player->RemoveSpell "TR_m4_VA_AshSleep_SunDmg"
set state to 0
endif
End
Steps to reproduce:
- player->addspell "vampire sun damage"
- set PCVampire to 1
- StartScript TR_m4_VA_AshwalkerSleep_Sc
- coc "ashlands region"
- Sleep for 1 hour
In Morrowind.exe, the result is that if you rest in the Ashlands Region, for the duration of the sleep, the standard vampire sun damage ability is removed from the player, and another ability that doesn't have the sun damage malus is added to them, meaning the player can sleep safely in the Ashlands during the day.
In OpenMW, the player instantly dies after resting.
- Is the problem OpenMW specific or does it also happen in vanilla Morrowind?
- OpenMW specific
- What is your operating system?
- Windows 10
- What version of OpenMW are you using? If you used a bleeding edge build, state the exact revision used.
- 0.49, commit 0e1678b3
- What version of Morrowind are you using (i.e. retail CD or Steam)? What addons (Tribunal, Bloodmoon) do you have installed? What language is your Morrowind install?
- Not relevant, but English GOG version
- Do you use any mods? If so, does the problem also occur in a clean vanilla install without any mods?
- Problem is mod specific
- What are the exact steps to reproduce the problem?
- Described above
- What did you expect to happen? What happened instead?
- Described above
- Are there any error messages in your
openmw.log
file? If you're not an OpenMW team member, it's best to upload it.- Nothing that seems relevant, but here: openmw.log
- What settings do you use? If you're not an OpenMW team member, it's best to upload your
settings.cfg
.- Not relevant
- Where is the in-game location this problem can be observed? Avoid vague statements such as "west of town X". Instead, open the console (
`
key by default, the key above Tab), click on the problematic object, then use the betacomment (bc
) instruction to get useful information about the object that you can copy and paste into the bugreport:- Described above