Collective naming?

XanMag
I know I am being a pest here, but I must continue to ask! Sorry! :?

In my game I have four keys hanging on a peg board. The number of keys match the number of vehicles they can be used on. All four vehicles are essentially identical, thus so are the keys. When you look at the peg board with the keys on it, it says "It contains unknown key 1, unknown key 2, unknown key 3, and unknown key 4." For obvious reasons, I'd rather it not read this way, but I still want to have four keys instead of resorting to swapping out an object called 'four keys', 'three keys', and 'two keys'. If there is more than one key on the peg board, is there a way I can make it read "If contains 4 similar keys" or "It contains 3 similar keys" or "It contains 2 similar keys"?

Is there a VERY easy way to do this? If not, no big deal, especially if I have to dork around with code. It's more of a cosmetic thing. Thanks again!

The Pixie
Set the keys to be scenery, and have the room description say how many keys are present, perhaps like this:
msg("This is a great room.")
keycount = 0
foreach (o, GetDirectChildren(this)) {
if(StartsWith(o.name, "unknown")) {
keycount = keycount + 1
}
}
if (keycount = 1) {
msg("It contains a key.")
}
else if (keycount > 1) {
msg("It contains " + keycount + " similar keys.")
}

XanMag
That should do the trick I think. You know I will let you know if I have problems with it. lol

Thanks again!

Father thyme
How about the pegboard (named ' pegboard with four pegs') is a container (surface) containing all 4 keys ( described ' key tagged 1, key tagged 2. --- etc)
Description 'a pegboard with four pegs'
Alter container list prefix to ' hanging on them you see'
Set 'hide children' ' display children when looked at.
I think this works . I ran a test game.

Forgewright
Pixie said....

msg("This is a great room.")
keycount = 0
foreach (o, GetDirectChildren(this)) {
if(StartsWith(o.name, "unknown")) {
keycount = keycount + 1
}
}
if (keycount = 1) {
msg("It contains a key.")
}
else if (keycount > 1) {
msg("It contains " + keycount + " similar keys.")
}



Man, someday I want to grow up and be just like Pixie.......

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums