Ahhhhhh. I've noticed this as well, I thought there was a problem in my code somewhere and I couldn't work out what was going wrong. Glad to know it's not just me.
Alex wrote:I'm struggle to understand in what scenario you would want scenery objects to be taken anyway...
There are plenty of scenarios where you might want to do this. Masking the importance of an object for one so the description isn't just a bombardment of objects within a room shouting "look at me, take me without thinking because you'll probably need me!" Or an object you might not need but is fun to take anyway either for added realism or for some little bonus task. OK, that's only 2 scenarios but other people may have their reasons.
EDIT: I've found the problem, it exists in the DoTake function. Where it has
if (GetBoolean ( object , "scenery" )) {
object.scenery = false
}
It's running that code indiscriminately whether the object is successfully taken or not.
By replacing DoTake with this you can stop it from happening while still changing the scenery attribute if the take is successful.
prefix = ""
if (ismultiple) {
prefix = GetDisplayAlias(object) + ": "
}
if (object.parent = game.pov) {
msg (prefix + DynamicTemplate("AlreadyTaken", object))
}
else if (not ListContains(ScopeReachable(), object)) {
msg (prefix + DynamicTemplate("ObjectNotOpen", GetBlockingObject(object)))
}
else {
volume = 0
continue = true
foreach (obj, GetAllChildObjects(game.pov)) {
if (HasInt(obj, "volume")) {
volume = volume + obj.volume
}
}
if (not Contains(game.pov, object)) {
volume = volume + GetVolume(object,true)
}
if (HasInt(game.pov, "maxvolume")) {
if (volume > game.pov.maxvolume) {
continue = false
if (HasString(game.pov, "containerfullmessage")) {
message = prefix + game.pov.containerfullmessage
}
else {
message = prefix + DynamicTemplate("FullInventory", object)
}
}
}
children = GetDirectChildren(game.pov)
if (HasInt(game.pov, "maxobjects")) {
if (game.pov.maxobjects > 0) {
if (ListCount(children) >= game.pov.maxobjects) {
continue = false
if (HasString(game.pov, "containermaxobjects")) {
message = prefix + game.pov.containermaxobjects
}
else {
message = prefix + DynamicTemplate("MaxObjectsInInventory", object)
}
}
}
}
if (continue = false) {
msg (message)
}
else {
found = true
takemsg = object.takemsg
switch (TypeOf(object, "take")) {
case ("script") {
if (ismultiple) {
msg (prefix)
}
do (object, "take")
takemsg = ""
}
case ("boolean") {
if (object.take = true) {
object.parent = game.pov
if (takemsg = null) {
takemsg = DynamicTemplate("TakeSuccessful", object)
}
}
else {
found = false
}
}
case ("string") {
object.parent = game.pov
takemsg = object.take
}
default {
found = false
}
}
if (not found and takemsg = null) {
takemsg = DynamicTemplate("TakeUnsuccessful", object)
}
if (LengthOf(takemsg) > 0) {
msg (prefix + takemsg)
}
if (HasScript(object, "ontake")) {
do (object, "ontake")
}
}
}
if (object.parent = game.pov) {
object.scenery = false
}
The key part is at the bottom. I've taken the original code that I posted at the top out and at the very bottom of the script placed this. This is only a quick fix though, as it doesn't account for scenery objects being moved around the room, only if you take the object and it ends up in your inventory.
if (object.parent = game.pov) {
object.scenery = false
}
Hope this helps.