Jump to content

Recommended Posts

Posted (edited)

Hi,

 

I've a script here; I'd like it to be run during gamemode, never stopping; but for some reasons it does not seem to work, even if the script compiles without errors... Here it is:

 

Scriptname SAGPlayerInChargenMyScript extends Quest

Quest Property MyProperty  Auto
Spell Property Rested Auto
SPell Property WellRested Auto
Spell Property MarriageRested Auto
Function SomeFunction()              
 registerForUpdate(0.5) ; Before we can use onUpdate() we must register.
EndFunction

Event OnUpdate()
if Game.GetPlayer().HasSpell(Rested) || Game.GetPlayer().HasSpell(WellRested) || Game.GetPlayer().HasSpell(MarriageRested)
Debug.MessageBox("Its okay")
registerForUpdate(0.5)
else
registerForUpdate(0.5)
Debug.MessageBox("Not Okay")
Endif
EndEvent

 

No message appear, so that means something is done wrong...

Edited by sagittarius22
Posted
I'm trying to see if the player is under the WellRested effect...
Posted

Meh, I was only asking because this seems to be the exact thing I was trying to accomplish with my mod. I need to know when the payer has slept, but I wasn't sure if it was more effective to have a continuously running script or script the beds themselves. I still am not sure which is more efficient. :psyduck:

 

EDIT: But I agree w/ philip. Something needs to be using a function. Better to have an event which starts it. :thumbsup:

Posted
additonally, you only need to RegisterForUpdate(0.5) once, and itll send an update event every 0.5 seconds. To ask for single update use RegisterForSingleUpdate(0.5), or keep it as it is and use UnregisterForUpdate() when you dont need updates anymore
Posted (edited)

I made this:

Scriptname SAGPlayerInChargenMyScript extends Quest  


Quest Property MyProperty  Auto  
Spell Property Rested Auto
SPell Property WellRested Auto
Spell Property MarriageRested Auto

Function SomeFunction()                
 registerForUpdate(0.5) 
EndFunction


Event OnInit()
SomeFunction()
if Game.GetPlayer().HasSpell(Rested) || Game.GetPlayer().HasSpell(WellRested) || Game.GetPlayer().HasSpell(MarriageRested)
	Debug.MessageBox("Its okay")
else
	Debug.MessageBox("Not Okay")
Endif
EndEvent


But it does not have any effect :psyduck:

Edited by sagittarius22
  • Recently Browsing   0 members

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