if (player.nightlevel) {
// print night level stuff
}
// original description with the two prints.
if (player.nightlevel) {
// print night level stuff
} else {
// original description with the two prints.
}
if (not GetBoolean(player, "inhut")) {
msg ("It looks like a storage hut.<br/><br/>East will take you back to the entrance.<br/>")
}
else if (GetBoolean(player, "inhut")) {
msg ("The door to the storage hut lies open,<br/><br/>East will take you back to the entrance.<br/>")
}
s = "It looks like a storage hut."
if (GetBoolean(player, "inhut")) {
s = s + " The door lies open."
}
if (GetBoolean(game, "night")) {
s = s + " At this time of night it looks very dark."
}
s = s + "East will take you back to the entrance."
msg(s)
The Pixie wrote:I would be selective about which rooms get nighttime descriptions. Does the description for the storage hut change at night? If not, leave it as it is.
The Pixie wrote:
An alternative approach would be to build up a description in your script. In this example, I have a variable called s, to which more text is added, depending on the game state, before getting doosplayed.s = "It looks like a storage hut."
if (GetBoolean(player, "inhut")) {
s = s + " The door lies open."
}
if (GetBoolean(game, "night")) {
s = s + " At this time of night it looks very dark."
}
s = s + "East will take you back to the entrance."
msg(s)
Silver wrote:If you're struggling at this stage I really wouldn't bring torch use into it. Then it isn't just the description being either night or day. You'll have to set scripts for every single object depending on whether it's day, night or night with the torch on.
Silver wrote:Could be. I forget you're doing things a bit differently. The very first room in my game has light and dark states. Considering it's one room, it has been a lot of work. Although mine is a bit more complex than a torch on and off.
But for example, if the room is dark the default for examining an object is "You can't see that." So a possible issue you'll come up against is:
use torch
>you can't see that.
The Pixie wrote:I would be selective about which rooms get nighttime descriptions. Does the description for the storage hut change at night? If not, leave it as it is.
An alternative approach would be to build up a description in your script. In this example, I have a variable called s, to which more text is added, depending on the game state, before getting doosplayed.
s = "It looks like a storage hut."
if (GetBoolean(player, "inhut")) {
s = s + " The door lies open."
}
if (GetBoolean(game, "night")) {
s = s + " At this time of night it looks very dark."
}
s = s + "East will take you back to the entrance."
msg (s)
if (not GetBoolean(player, "inhut")) {
msg ("You try the door, but it's locked and rattles loosely in the frame. It appears to be very flimsy.")
}
else if (GetBoolean(player, "inhut")) {
MoveObject (player, hutinside)
}
jaynabonne wrote:Make the torch a weak light source when it's off and a strong one when it's on. Then you'll always be able to see it, and it will illuminate the room when switched on.
having a bit of a problem getting the game to remember if the door to the hut has been previously opened on the night section. It works fine on the day section and the sequence should be:
"It looks like a storage hut" >> Enter hut >> "it's locked" >> kick door >> "The door smashes in" >> enter >> "You are inside the hut" >> leave >> "It looks like a storage hut and the door is smashed in" >> enter hut >> "You are inside the hut"
But at night, I get:
"It looks like a storage hut" >> Enter hut >> "it's locked" >> kick door >> "The door smashes in" >> enter >> "You are inside the hut. It's pitch black" >> leave >> "It looks like a storage hut" >> enter hut >> "it's locked"
This sequence uses two rooms; hut (exterior) and hutinside (interior)
On the description for the hut (exterior) I run the following script supplied by TP:s = "It looks like a storage hut."
if (GetBoolean(player, "inhut")) {
s = s + " The door lies open."
}
if (GetBoolean(game, "night")) {
s = s + " At this time of night it looks very dark."
}
s = s + "East will take you back to the entrance."
msg (s)
And on the command pattern for 'open door; enter hut; etc' I run the script:if (not GetBoolean(player, "inhut")) {
msg ("You try the door, but it's locked and rattles loosely in the frame. It appears to be very flimsy.")
}
else if (GetBoolean(player, "inhut")) {
MoveObject (player, hutinside)
}
I think I need to add the night condition to the last script, but can't figure out how.
if (game.daytime_or_nighttime = "nighttime") {
if (player.sleep_behavior = "diurnal") {
player.sleeping = true
} else if (player.sleep_behavior = "nocturnal") {
player.sleeping = false
}
} else if (game.daytime_or_nighttime = "daytime") {
if (player.sleep_behavior = "diurnal") {
player.sleeping = false
} else if (player.sleep_behavior = "nocturnal") {
player.sleeping = true
}
}
if (player.sleep_behavior = "diurnal") {
if (game.daytime_or_nighttime = "daytime") {
player.sleeping = false
} else if (game.daytime_or_nighttime = "nighttime") {
player.sleeping = true
}
} else if (player.sleep_behavior = "nocturnal") {
if (game.daytime_or_nighttime = "daytime") {
player.sleeping = true
} else if (game.daytime_or_nighttime = "nighttime") {
player.sleeping = false
}
}
OurJud wrote:Sorry to bump, but can anyone with the know-now run their eyes over this to see where I'm going wrong?
if (not GetBoolean(player, "inhut")) {
msg ("You try the door, but it's locked and rattles loosely in the frame. It appears to be very flimsy.")
}
else if (GetBoolean(player, "inhut")) {
MoveObject (player, hutinside)
}
if (not GetBoolean(player, "inhut")) {
msg ("You try the door, but it's locked and rattles loosely in the frame. It appears to be very flimsy.")
}
else {
MoveObject (player, hutinside)
}
The Pixie wrote:Where are you setting player.inhut? I would look there and see if it is missed at night (or post your whole game).