Quick question

Gary Brown
10 May 2005, 16:16
I'm trying to get a list of objects in a given room, that isn't the same room the player is in. I'm using QDK and I see the bit about running a script for each objet in a given room, but I'm not sure how to reference each object to get it's name.

Sorry for the amiturish questions, but I'm still new to codeing. Any help is much appreciated.

Gary

METALGod32
10 May 2005, 23:07
Where are you trying to show the List of objects at?, in the players current room?

Gary Brown
10 May 2005, 23:13
no. The list would be printed to the user. It's part of a command.

METALGod32
10 May 2005, 23:19
You could give every object a Variable, So you'd type: #variablesname[userid]#....Give every object a variable....and set it up so when players type a cammand they see it, here is a example:


Player[1] types: objects

#var1[userid]#
#var2[userid]#
etc.....

for Number vars you use: %var[userid]%

but i think you mean names so you use: #var[userid]#


Hope that gives you a idea.

Gary Brown
11 May 2005, 01:38
I'm not sure what I'm asking is clear. What I need is to be able to scroll through a specific room, (which will always be the same room) and get a list of the names of all the objects in that room. I'm just not entirely sure how to set up a variable in a procedure that will iterate, (sp?) through each object in that room and give me it's name.

Gary

METALGod32
11 May 2005, 04:47
is your game multiplayer?

Lets see if i understand, you want the player to beable to type in a command, like for example: "objects", then a list of objects thats in the current room is shown via a list?

are the objects currently visable?

objects usually already appear in the room, on the right...IF the object is Visable and in the room, if it's not then you'll needa use var's...you can make it so when the player types in the command every oject will be listed...wether it's visable or not.

i don't want to lead you astray so if this doesn't help you then let me know...i'll try to understand better...LOL :)

if i understand here is a example


Every object you want on the list needs a var attached to it.

There string vars not num vars, so set up string vars like this.

string #object1#
string #object2#
string #object3#
etc....

you want each var to hold the Name of the object you want there to be on the list.

you dont needa set up a precedure cuz you already set up the vars, unless you put all them vars inside a precedure to help organize things"i usually do this".

I'd name the Precedure: Objectslist.
Have the Procedure start up when the game starts.

now to List each var on screen, you'd do this.

make it so when player types: objects"for example", your list comes back to the user.

print "Objects #objects1#, #objects2#, #object3# etc........"
whatever each var holds, thats what the user will see.

thats just a little example, if i'm still off on where your getting at, let me know.

Cryophile
11 May 2005, 15:39
Use the "for each object in a room script". The string variable #quest.thing# gets the real name of each object and #@quest.thing# gets the alias for it.
If you need a script example I can write one soon.

Gary Brown
11 May 2005, 20:48
Thanks. I think that answers it for me. #quest.thing# is how to reference it. cool. Thanks much. I'll try that when I get home. If it doesen't work I'll let ya know, but that seems like it'll work. Thanks again.

Gary

Cryophile
11 May 2005, 21:06
#quest.thing# gives the name of the object that your script or command is refering to... it's quite useful :)

Gary Brown
12 May 2005, 00:58
Thanks dude. That works great. Thanks both of y'all for helpin' me out. Much appreciated.

Gary