garethfx Experienced Adventurer
Number of posts : 85 Age : 67 Location : Wales Humor : Nothing like having a good laugh - oh and a pint! Adventure Points : 53 Registration date : 2009-09-28
| Subject: multiple objects on a static object Mon May 24, 2010 8:22 pm | |
| Hi Guys Just trying out a some code and got a bit stuck. I have a farmhouse table - its in noun only not in the object list - its static and wont be moved
I have to build a small puzzle around the items on the table (heres the sticking point). Basically there will be 2 items on the table with the potential of 2 others being placed there by the player.
On the table is - A jug and a bowl
When examining the table Ive got this working for first individual item in the response table which is the Bowl. I need to be able to respond to 3 variants 1 - Its a farmouse table with a bowl on it 2 - Its a farmhouse table with a jug on it 3 - Its a farmhouse table with a bowl and jug on it
I tried (in response) [start]examine table#room=3#objloc198=0#[acts]cmessIt`s just a big, well used farmhouse table with a bowl on it.[end]
[start]examine table#room=3#objloc197=0#[acts]cmessIt`s just a big, well used farmhouse table with a milk jug on it.[end]
Of course as said its its the first and stops and I cannot find the correct programming example to to options 1,2 and 3. Any ideas??
G |
|
catventure Admin Adventurer
Number of posts : 410 Age : 72 Location : UK Humor : Enjoys a laugh! Adventure Points : 77 Registration date : 2008-06-08
| Subject: Re: multiple objects on a static object Tue May 25, 2010 9:38 am | |
| Hi Gareth,
One way would be to set an UNUSED LOCATION to hold the objects which are set to be ON the static table object. Then you could go to the Objects Editor and flag the jug and bowl objects to initially start in that non-existing undescribed room....
Say for example you chose location 100 to be the SURFACE location of the table. You will thus set the bowl and jug (and any others required) to start at this location 100. When the player examines the table at any time which is always in room 3 you can then show a custom message followed by a "listobjsX" action which will disclose which items are presently upon it like so:
General purpose examine message for table ============================= [start]examine table/look on table#room=3#anyobjs100[acts]It is a small mahogany table. On the table is:#listobjs100#else#room=3[acts]cmessIt is a small mahogany table. There are no items currently on the table.[end]
You could also ensure that only objects in a particular size range may be placed onto the table... for example smallish objects with a low size value in the Object Editor...
Now if the player wants to GET an object which is on the table:
[start]get %objn1% off table#room=3#objlocn1=100[acts]cmessYou take the %objn1% from the table.#objlocn1=501[end]
Or if you just want them to be able to get it without typing "off table" then place another "get %objn1%" response entry BEFORE the standard default one like so:
[start] get %objn1%#room=3#objlocn1=100[acts]cmessYou pick up the %objn1%.#objlocn1=501[end]
(If the player types "get jug" in room 3 and the jug is ON the table - at loc 100 - then place the jug from loc 100 to the player's carried inventory. Otherwise carry on in response and go and do the normal "get %objn1% entry to give appropriate action reply...)
[start]drop %objn1% on table#room=3#objlocn1=here[acts]cmessYou place the %objn1% on to the table...#objlocn1=100[end]
This allows player to drop (synonym of PUT) an object which is carried, worn or in room on to the table (loc 100)
If you want to limit the size of object which can go on to the table then simply add in a object size condition check:
objn1size [ >= | <= | <> | > | < | = ] X Example: "objn1size<=2" Is the object less than or equal to an object size of 2?
[start]drop %objn1% on table#room=3#objlocn1=here#objn1size<=2[acts]cmessYou place the %objn1% on to the table...#objlocn1=100#else#room=3#objlocn1=here#objn1size>2[acts]cmessThe %objn1% is too large or bulky to fit on the table I'm afraid![end]
In that entry the player cannot put just any object but only certain objects (determined by the size value in this example) on to the table - so you can effectively limit what the player is allowed to place there.
You might also decide to put an entry into Script One (printed after the location description is shown) such as:
Script One entry ===========
[start]room=3#anyobjs100[acts]cmessOn the table is:#listobjs100#else#room=3#notanyobjs100[acts]cmessThere is nothing presently on top of the table.[end]
That is appended to follow the location text each time the player visits or redescribes ("look") the room.
Hope this helps,
Phil.
Last edited by catventure on Fri Mar 18, 2011 6:44 pm; edited 2 times in total |
|
garethfx Experienced Adventurer
Number of posts : 85 Age : 67 Location : Wales Humor : Nothing like having a good laugh - oh and a pint! Adventure Points : 53 Registration date : 2009-09-28
| Subject: Re: multiple objects on a static object Tue May 25, 2010 8:27 pm | |
| Phil..................................... That reply was fantastic. Exactly what I need and now seeing it in the Unused location situation it make great sense.
Just as an added thought on this - regarding size and weights of objects.
is there a table/guide/advice that can be used to estimate what could be set against objects to give a good propotion s in weight and size ?
I didnt see one in the html sections of the site - or did I miss them ?
Thanks again Phil |
|
catventure Admin Adventurer
Number of posts : 410 Age : 72 Location : UK Humor : Enjoys a laugh! Adventure Points : 77 Registration date : 2008-06-08
| Subject: Re: multiple objects on a static object Tue May 25, 2010 9:02 pm | |
| - garethfx wrote:
Is there a table/guide/advice that can be used to estimate what could be set against objects to give a good propotion s in weight and size ?
Hi Gareth. There is no specific rules or tables, but you could decide before hand that objects which had a size value of say 2 only could be objects allowed to be put on the table and then check for them that way or you could even add in weight checks too... but best to keep it fairly simple. If you want to be sure they don't try and put a certain object on to it you could add in condition(s) such as #or_objn1<>7#or_objn1<>10# etc.. Best wishes, Phil. |
|
garethfx Experienced Adventurer
Number of posts : 85 Age : 67 Location : Wales Humor : Nothing like having a good laugh - oh and a pint! Adventure Points : 53 Registration date : 2009-09-28
| Subject: Re: multiple objects on a static object Tue May 25, 2010 9:22 pm | |
| good stuff . Thats fine. I suppose its a bit restrictive when actually setting size/weights against things, even as a guideas after I posted the question I thought about giants and fairy objects - a cup is a cup but in different worlds the size is relative.... |
|
Sponsored content
| Subject: Re: multiple objects on a static object | |
| |
|