generating an "on what?" menu
TriangleGames
21 Feb 2013, 18:38Apparently, I am completely incapable of letting anything be simple. I'm working on my "quick, dirty, git-er-done" flash-fiction game, and I'm trying to do something complex enough that I can't figure it out.
I'm using a custom verb, "blow." When the player blows on a certain item (a pipe) I want a menu to ask "at what?" and display the items in the room he could blow the pipe at. I've tried several things, but this is what it looks like right now.

Please help me understand what needs to be done here to create a list of the objects in the room and show them in an options menu?
EDIT: Just to clarify a little, the menu is essentially a selection of targets to shoot a blowgun at.
RE-EDIT: I THINK I see part of the problem. I am creating an Objects List and trying to display it in a Menu which presumably wants a String List, but I still don't know how to create a string list based on the scope of visible objects.
I'm using a custom verb, "blow." When the player blows on a certain item (a pipe) I want a menu to ask "at what?" and display the items in the room he could blow the pipe at. I've tried several things, but this is what it looks like right now.

Please help me understand what needs to be done here to create a list of the objects in the room and show them in an options menu?
EDIT: Just to clarify a little, the menu is essentially a selection of targets to shoot a blowgun at.
RE-EDIT: I THINK I see part of the problem. I am creating an Objects List and trying to display it in a Menu which presumably wants a String List, but I still don't know how to create a string list based on the scope of visible objects.

Pertex
21 Feb 2013, 20:07This should be something like this:
menulist = NewStringList()
for each (obj, ScopeVisibleNotHeld()){
list add (menulist, obj.name)
}
show menu ("please choose now", menulist, true) {
TriangleGames
22 Feb 2013, 02:04Thank you very much! It's working great.
It took me a minute to understand what was happening there, but I have a MUCH better understanding of how to use ForEach() now.
It took me a minute to understand what was happening there, but I have a MUCH better understanding of how to use ForEach() now.
homeeman
22 Feb 2013, 03:22This feels a lot like deja vu for me, and if it's already working then you can ignore this, but... Quest has a built-in feature for this. When you create a verb there is a drop-down box that says, "Print a message." If you click that box and choose "Require another object" it does exactly what you described (when you choose this option it allows you begin creating an object list with a seperate script for each object. I think the default is the "You can't use it that way" template).
However, For each loops are extremely useful, and you've obviously learned more from Pertex's answer than you would have any other way. I just figured I'd point this out for anyone too lazy to implement four lines of code.
However, For each loops are extremely useful, and you've obviously learned more from Pertex's answer than you would have any other way. I just figured I'd point this out for anyone too lazy to implement four lines of code.