OurJud wrote:"Silver"
You're going about this in a very complicated way. The game lists objects in rooms by default as long as you haven't set it as a scenery item.
I suspect I am, but I don't use hyperlinks, so have no choice but to do these things via my descriptions.
Silver wrote:"OurJud"
[quote="Silver"]You're going about this in a very complicated way. The game lists objects in rooms by default as long as you haven't set it as a scenery item.
I suspect I am, but I don't use hyperlinks, so have no choice but to do these things via my descriptions.
if (Got(gun)) {
// Have gun
if (Got(cellphone)) {
// have both gun and cellphone
} else {
// have gun only
}
} else {
// Don't have gun
if (Got(cellphone)) {
// have cellphone only
} else {
// have neither
}
}
jaynabonne wrote:Where you currently have your code. The code you're trying to extend to handle both the gun and cellphone. You'll need to add in the actual text you want printed out, but it gives the overall structure.
if (Got(gun)) {
msg ("There is a smoked-glass coffee table on which sits a cellphone.")
if (Got(cellphone)) {
msg ("There is a smoked-glass coffee table here.")
} else {
msg ("There is a smoked-glass coffee table on which sits a cellphone.")
}
} else {
msg ("There is a smoked-glass coffee table on which sits a gun.")
if (Got(cellphone)) {
msg ("There is a smoked-glass coffee table on which sits a gun.")
} else {
msg ("There is a smoked-glass coffee table on which sits a gun and a cellphone.")
}
}
if (Got(gun)) {
if (Got(cellphone)) {
msg ("There is a smoked-glass coffee table here.")
} else {
msg ("There is a smoked-glass coffee table on which sits a cellphone.")
}
} else {
if (Got(cellphone)) {
msg ("There is a smoked-glass coffee table on which sits a gun.")
} else {
msg ("There is a smoked-glass coffee table on which sits a gun and a cellphone.")
}
}
Silver wrote:Why don't you just re-enable the object list?
Silver wrote:Yes you misunderstand. When it is enabled it automatically lists the objects that aren't set as scenery objects. The same as directions are listed if you have that enabled. So, depending on the order you have set you will get this:
Chamber
You are trapped in a chamber. The air is stale and humid. The grey walls are blah blah.
You can see a knife and a set of keys.
__________
The game generates that second line about objects if you have it enabled which means you won't have to write scripts for when they are taken or dropped. But you have it disabled for some reason.
Silver wrote:Well I employ both methods. For each to their own.
jaynabonne wrote:Basically, using the built-in "use" command, you can't use something if it's not there. Just as you can't look at it, take it, etc.
To make "use gun" work everywhere, create a command with the explicit command pattern "use gun" (same steps as for the "use lift" one). This time, be sure it's in the Command list under *game* instead of a specific room, so that it will be in effect everywhere.