Displaying what objects are in rooms.

StarshipUK
01 Feb 2009, 01:48
I have only just started playing with Quest Pro, and am trying to convert an old game to it.

I have switched off the Panes, but cannot work out how to get it to display if there are any objects in the rooms.

E.g. at the top of the birds nest I where there is an egg I would like it to say:

There is also:-
A bird's egg

and also if any objects are dropped in any other rooms, for it to tell the player those objects are there in a similar way, beneath the room description and before a line saying What Shall I Do Now?

I am entering directions in manually, so just need it to be able to display what objects are in the room.

I read the help guide several times, but still cannot seem to get it to work.

Also is there a way to limit the game to only be able to carry 3 objects at any one time?

Any help would be very appreciated.

Thanks,
Steve.

StarshipUK
01 Feb 2009, 18:49
I have made a little bit of progress with this problem today.

I have turned every room into a script and it runs this:
#quest.lookdesc#
If "#quest.object#" is in the current room Then print "[NEW LINE]I can also see:-[NEW LINE]#quest.formatobjects#"

If there is one object in the room it will then display it.

The problem is if there is more than one object in the room it does not display it and I am not sure why.

I still also can't figure out how to limit the player to only being able to carry 3 objects at once.

If anyone could help, I would be very grateful.

Jhames
01 Feb 2009, 20:14
Hi. I'm spanish guy, so sorry my bad english. But I think this piece of code work with your problem of more than 3 objects in intentory:

You must put the code in "run script" for every object you wish take:

Change the contents of numeric variable "number_objects" to "0" 
For each object in "inventory" Increment "number_objects" by "1"
If "%number_objects%" is equal to "3" Then Print "You can't take more objects.[NEW LINE]" Else {
Print "You take the object"
Give "#quest.lastobject#" to the player }


I hope work for you.

Redsun
02 Feb 2009, 04:48
Yes there is a way to limit how many items a player can carry.

Create a num var first.
set it's starting number to 0

now make a proc that runs a if statement to check if "your num var is 3 or less" if so then pick up object, if the var
is 4 then display a message letting the player know he cannot carry any more items.

Set up another proc so that every object that is picked up adds 1 to the var, if the object is dropped or
used then subtract 1 from the var.

StarshipUK
04 Feb 2009, 01:22
Thank you both for your help. What you have said makes sense, and I will have a go at adding this shortly.

Has anyone got any ideas on the other problem where it will not display the objects in the room, if there are more than two objects in that room?

Elexxorine
04 Feb 2009, 10:15
Have you edited the description script at all?

StarshipUK
15 Feb 2009, 12:37
No, I have not edited the descriptions script.

StarshipUK
15 Feb 2009, 14:56
I am beginning to wonder if this is a Bug in Quest or a problem with the , between two objects in the same room (and a Bug in Quest).

I have started a new game from scratch and have a room with a cash machine and a fruit machine inside it.

If I have this set:
If "#quest.object#" is in the current room Then print "[NEW LINE]I can also see:-[NEW LINE]#quest.formatobjects#"

Then it does not display the objects in the room when I enter it.

If I have this set:
If "A Fruit Machine" is in the current room Then print "[NEW LINE]I can also see:-[NEW LINE]#quest.formatobjects#"

Then it displays a Fruit Machine and a Cash Machine in the room.

This does not make much sense.... Can someone please help?

Elexxorine
15 Feb 2009, 16:57
Hmm.... can you please upload your game. Simply make a new post and click 'upload attachment' below the box where you type stuff in and upload the file, I can then have a look at it and fiddle around till it works.

paul_one
15 Feb 2009, 19:20
Does "quest.object" actually exist (as one of those undocumented ones)?

I know "quest.objects" exists - and is a list of current objects in the room.

.. Perhaps have "if #quest.objects# NOT equal "" then..." ?

EDIT: fixed a missing #..

StarshipUK
16 Feb 2009, 16:52
Thank you for looking into this. The game file is attached.

If you go to the pub car park you will see Parked Cars.

If you go to the Side Bar you are suppose to see A cash machine and A fruit machine but it will not show these.

Likewise if you take a Dog Turd and drop it in the car park with the parked cars it will then not show anything as being in the room.

I have attached the game file.

StarshipUK
16 Feb 2009, 16:59
paul_one wrote:Does "quest.object" actually exist (as one of those undocumented ones)?

I know "quest.objects" exists - and is a list of current objects in the room.

.. Perhaps have "if #quest.objects# NOT equal "" then..." ?

EDIT: fixed a missing #..


Sorry I meant #quest.objects#

I just tried "if #quest.objects# NOT equal "" then..." but it still does not display the objects in the room :(

Elexxorine
16 Feb 2009, 18:46
Here's a fixed version. I've changed only three things, put the description code in the game object rather than each room, left the extra bit in the first room as a script to run when you enter, and changed the bit about viewing the objects from 'if here' to 'if #quest.objects# is not equal to ""', it now works on my computer.

If you have any more problems, let me know.

StarshipUK
16 Feb 2009, 22:47
Thats wonderful! Thank you so much for your help.

I guess I was trying to make things harder rather than easier by doing what I did.

Out of interest, just to understand this better, do you know why it did not work the way I was trying it, but it does work this way?

Thanks again.

Elexxorine
17 Feb 2009, 12:41
quest.objects is a string, not a single object, that's why 'if here' didn't work. That was the main issue.