Different description for different time of day
demonboy
10 Jan 2013, 15:26I'm using The Pixie's Clock_Lib and I want to give a different description to a room depending upon the time of day (eg people are working in an area during the day, and at night there is no one around). Any clues? Cheers.
The Pixie
10 Jan 2013, 19:27Briefly: Have the description be a script, rather than text. Use an "if" statement to test if it is day time, then print a message if so, and have an "else" to print a message if not.
demonboy
11 Jan 2013, 15:07Hi The Pixie, thanks for your reply. Is this a case of just saying:
If: [expression] IsEvening
Then
Print: It is now evening.
I've tried that but it returns an error.
If: [expression] IsEvening
Then
Print: It is now evening.
I've tried that but it returns an error.
sgreig
13 Jan 2013, 06:18You would need to find out what variable in the library stores the information about what time of day it is. The code "If IsEvening" isn't valid. I haven't used that library, but if the time of day is set as a boolean attribute on the game object called IsEvening, then it would be something like this:
if (game.IsEvening = true) {
msg ("It is evening.")
}
else {
msg ("It is daytime.")
}
demonboy
14 Jan 2013, 07:46Hi sgrieg and thanks for your reply. If I run that it comes back with an error:
Error running script: Error compiling expression 'game.IsEvening = true': CompareElement: Operation 'Equal' is not defined for types 'Object' and 'Boolean'

jaynabonne
14 Jan 2013, 11:31That means it doesn't know what "game.IsEvening" is. It goes back to what Scott was saying - you need to find out what the variable is that you need to be checking. (He took a guess, but it seems to be something else.
)

demonboy
15 Jan 2013, 06:09Indeed, but it should know it because I am using The Pixie's Clock library. Is.Evening is one of its features.

Pertex
15 Jan 2013, 09:49Then you should read the wikipage of it. IsEvening is a function and you would call it like this:
If: [expression] IsEvening ()
Then
Print: It is now evening.
If: [expression] IsEvening ()
Then
Print: It is now evening.
demonboy
17 Jan 2013, 09:01Aha, I had omitted the parenthesis. Thanks, Pertex.