WalkerInShadows Posted December 25, 2021 Share Posted December 25, 2021 I'm trying to fix a script that uses GetSleeping for an NPC. The NPC goes to sleep like he should, but the script doesn't recognize the fact that he IS sleeping, and won't advance the quest: if (GetStage povssbravilquest == 20) && (povssdroshanjiref.GetSleeping == 3) SetStage povssbravilquest 25 endif I can't figure out what's wrong here. Is there a better way to do it? Link to comment Share on other sites More sharing options...
qwertyasdfgh Posted December 26, 2021 Share Posted December 26, 2021 From what you posted, it seems correct, but there could be other factors involved.That's a gamemode script, right? On a quest? How often is it running? Is there something else in the script?I'm assuming that the quest is actually at stage 20.You can also click on NPC in console and type GetSleeping to check if it returns correct value. Link to comment Share on other sites More sharing options...
Lanceor Posted December 27, 2021 Share Posted December 27, 2021 Maybe try something like this just to see exactly what is breaking: if (GetStage povssbravilquest == 20) set SleepingStatus to povssdroshanjiref.GetSleeping messagebox "Stage is 20 and Sleeping status is %.0f", SleepingStatus if (povssdroshanjiref.GetSleeping == 3) SetStage povssbravilquest 25 endifendif Link to comment Share on other sites More sharing options...
WalkerInShadows Posted December 27, 2021 Author Share Posted December 27, 2021 From what you posted, it seems correct, but there could be other factors involved.That's a gamemode script, right? On a quest? How often is it running? Is there something else in the script?I'm assuming that the quest is actually at stage 20.You can also click on NPC in console and type GetSleeping to check if it returns correct value.Yes, it's a quest script with a Gamemode block. It runs every five seconds, like normal. When he goes to sleep, a pair of wraiths are supposed to spawn; I only figured out that GetSleeping was the culprit because I added another quest stage that accidentally bypassed his sleeping and spawned them while he was still headed to bed. Maybe try something like this just to see exactly what is breaking: if (GetStage povssbravilquest == 20) set SleepingStatus to povssdroshanjiref.GetSleeping messagebox "Stage is 20 and Sleeping status is %.0f", SleepingStatus if (povssdroshanjiref.GetSleeping == 3) SetStage povssbravilquest 25 endifendifThat could work. Thanks. Link to comment Share on other sites More sharing options...
Recommended Posts