Taking scenery by the same name
XanMag
14 Jul 2016, 04:08I'm sure you all missed my questions =)
By the lake I have some moss on a rock. The player can take the moss. I moved moss1 to the player inventory. Moss now has a 'taken' flag so it cannot be taken again. Moss should remain there at the lake on the rocks even after the player has taken some of it. It'd be idiotic to think the player removes all the moss from the rocks, right? Moss1 has a different description than moss. Moss is on the rock, moss1 has been removed from the rock. Something must be done to the moss1 to make it usable in a 'puzzle', but it's still moss. When that something is done, I remove moss1 from the game and introduce moss2.
All of that works just fine.
My problem is that because moss and moss1 have the same name (and they should), if I 'x moss' in the room where moss and moss1 are at the same time, I get that stupid message asking which moss do I want to look at, moss or moss.
Is there an easier work around for this? The easiest is probably to rename moss1 to something like 'Sphagnum'. Xanadu IS/WAS a science teacher after all and once he takes the moss from the rock, I could print a message like "You scrape some moss off the rock and examine it. HEY! You recognize this as Sphagnum moss!" But, I'm not sure I want to do that. Or should I? Does it add character or is it just pedantic? I don't know. I'm tired.
Thanks one more time!
bergedorfcacher
14 Jul 2016, 06:45How about naming it 'a bit of moss'?
The Pixie
14 Jul 2016, 07:08moss1 needs to be called "moss" so the player can do stuff with it. No player is going to want to type USE SPHAGNUM.
However, you could rename the moss that stays, when some is taken. Set its alias to a random string when the moss is harvested.
There is still a potential problem; if the player drops the moss and then goes back to that room, he will except to be able to get more moss, so you might want to have the alias go back to "moss" when moss1 is dropped, and to have moss1 destroyed if it is dropped near the original moss (in fact, you might want to think through how you want to handle the player taking moss twice).
Father
14 Jul 2016, 07:33How about
X rocks
if not carrying moss print.
One large rock overhanging the lake is thickly crusted with green moss.
Else
The rocks are very uninteresting
Take moss
First time
You scrape some moss from the rock. Aaagh! That was close. You dislodged it. The rock slid down into the depths of the lake. You nearly joined it. You scramble back clutching the moss.
Else
You pick up the moss.
Set moss to inventory
Father
14 Jul 2016, 07:57The moss by the way should be scenery at the start. If you want to make it not scenery when taken remove it from game and replace with new item, moss (not scenery)
hegemonkhan
14 Jul 2016, 18:30I think 'Father' (were you ~FatherThine?), has the best method. Have the 'firsttime' Script/Function (I'm guessing that the 'x' input command involves/uses the 'look/description' Script/Verb/Command or maybe its the 'handle command' Function/Command/Script) handle the 'moss' Object, creating a clone 'mossX' and moving it into your inventory. The 'otherwise' part of it should then handle only using your 'mossX' clone(s). This can be done like this:
// however the 'x #object#' input command works in getting the Object, we can then act upon that Object:
firsttime {
if (VARIABLE_THAT_HOLDS_YOUR_OBJECT = moss) { // or: = "moss", depends upon the VARIABLE
CloneObjectAndMove (moss, player)
}
} otherwise {
// if (VARIABLE_THAT_HOLDS_YOUR_OBJECT = moss) { // or: = "moss", depends upon the VARIABLE // this 'if' block is optional (why I have it 'commented out', as it depends on your game design plans
foreach (object_variable, ScopeReachable()) {
if (StartsWith (object_variable.name, "moss") and LengthOf (object_variable.name) > "moss") {
// you're now acting upon your 'mossX' clone(s) here, so add in whatever the scripting you want to do with them here
}
}
// }
}
Father
15 Jul 2016, 13:29Hegemonkhan, I was Father Thyme on the forums and Father on the Quest site seems they deleted Thyme when they amalgamated the two.
The x rocks means examine rocks ( making it a container containing moss would be better) with the look at command. My coding knowledge is nil , I tend to solve problems by low tech around the back streets methods. Your answer explaining my answer had me totally baffled.
hegemonkhan
16 Jul 2016, 00:50ya, I had the feeling you were fatherthyne (yeah!, I was right for once, laughs), hehe.
ah, so the 'x' means/is the 'examine' Command/Script/Function. Don't know how I forgot about 'examine'... though I'm still not sure what it is, maybe it is its own Verb/Command/Function/Script, and not related at all to the 'look/lookat/description'... my knowledge of the built-in stuff is almost nil, laughs.
Just ignore my code stuff (I put code in my posts as I'm lazy laughs), it may even have some issues with it... but I think it would work... hmm... meh.
XanMag
16 Jul 2016, 04:56I went ahead and used a modified version of what FatherThyme suggested. It wasn't the BEST solution but it was a pretty easy one and it's working. Thanks all for the suggestions. =)