Jump to content

Scripting question


Recommended Posts

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

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

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
endif
endif

Link to comment
Share on other sites

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

endif

endif

That could work. Thanks.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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