Gamehour not working?

Post » Fri May 27, 2011 8:49 pm

Begin DEM_sailorscriptIf ( GameHour > 21 )	If ( GameHour < 24 )		Enable	EndifEndifIf ( GameHour > 0 )	If ( GameHour < 6 )		Enable	EndifEndifIf ( GameHour > 6 )	If ( GameHour < 21 )		Disable	EndifEndifIf ( Onactivate == 1)	Return	Messagebox "They ignore you."	Endif End


It should activate or deactivate a person depending on the time of day.
But I'm getting a Right Eval error. Which is weird, because it used to work.
User avatar
Claire Lynham
 
Posts: 3432
Joined: Mon Feb 12, 2007 9:42 am

Post » Fri May 27, 2011 4:01 pm

I don't see anything wrong in your script... but since a right eval is usually an undeclared variable, I wonder if you are running a mod that has altered the global gamehour?

In any case, one way to test whether it's working or not is to make an object that displays current gamehour, or download something like the dej pocketwatch mod. then install it and reorder it so it loads first.

If it doesn't work, you know that a mod is to blame.
User avatar
Auguste Bartholdi
 
Posts: 3521
Joined: Tue Jun 13, 2006 11:20 am

Post » Fri May 27, 2011 12:06 pm

Your script runs just fine in unmodded Morrowind. The problem lies elsewhere.

You might want to remove the return down the bottom though, since it's not needed and prevents the messagebox from showing.
User avatar
Sweets Sweets
 
Posts: 3339
Joined: Tue Jun 13, 2006 3:26 am

Post » Sat May 28, 2011 1:50 am

Dunno, I'd try adding a space between 1 and )
If ( Onactivate == 1 )

User avatar
Dona BlackHeart
 
Posts: 3405
Joined: Fri Dec 22, 2006 4:05 pm

Post » Fri May 27, 2011 9:00 pm

I don't see a real error, either. Try abot's sugguestion. I'd probably also reorder the times so that a later condition is not covered by an earler one (> 0, > 6), and I'd change the conditions to actually include the time borders (> 6 and <= 6, for example). Another sidenote: the MessageBox can only be displayed if it's located before the Return command. Add in a couple of Return commands to stop the script from constantly triggering contradictory commands, and I'm momentarily at my wits' end.

Begin DEM_sailorscriptIf ( GameHour >= 21 )	If ( GameHour < 24 )		Enable		Return	EndifElseIf ( GameHour >= 6 )	If ( GameHour < 21 )		Disable		Return	EndifElseIf ( GameHour >= 0 )	If ( GameHour < 6 )		Enable		Return	EndifEndifIf ( OnActivate == 1 )	Messagebox "They ignore you."		ReturnEndif End

User avatar
Sandeep Khatkar
 
Posts: 3364
Joined: Wed Jul 18, 2007 11:02 am

Post » Fri May 27, 2011 1:23 pm

There are cases where errors in other scripts can cause an error to be reported in a script that has no errors.
User avatar
Mandy Muir
 
Posts: 3307
Joined: Wed Jan 24, 2007 4:38 pm


Return to III - Morrowind