TAB - thinBasic Adventure Builder

T.A.B. is an interactive fiction/text adventure program for Windows and made with thinBasic.
 
HomeFAQSearchUsergroupsRegisterLog in
Latest topics
» TAB Version 66 Available
Mon Sep 26, 2016 12:02 pm by catventure

» TAB Version 65 Available
Mon Feb 23, 2015 12:04 pm by catventure

» Incubation pt 1
Wed Apr 24, 2013 9:24 am by Kabrinski

» Charecter movements - doors
Wed Mar 20, 2013 2:55 pm by garethfx

» Member feedback on game planning
Sun Mar 03, 2013 1:47 pm by garethfx

» Still alive - just!
Thu Feb 28, 2013 11:34 am by catventure

» TAB 64 crashes ...
Mon Aug 20, 2012 11:31 am by acko

» Idea on addition to object being container
Sat Aug 18, 2012 3:49 pm by catventure

» sizex=y action ...
Thu Aug 09, 2012 11:29 am by catventure


Share | 
 

 inventory command

View previous topic View next topic Go down 
AuthorMessage
stants
Experienced Adventurer
avatar

Number of posts : 71
Age : 43
Location : Maidstone, Kent, UK
Humor : I shall tear your soul Apart!!!!!
Adventure Points : 32
Registration date : 2009-09-16

PostSubject: inventory command   Thu May 26, 2011 10:02 am

Hmmm i have 2 objects.

A bottle and a bottle top.

When use types put top on bottle or screw top to bottle i destroy objects bottle and bottle top and show sealed bottle object.

Works fine the only thing Im not sure how to go about this is when it creates the new object it doesnt keep it in your inventory and places the sealed bottle object into the location.

How can i make it so that when user types screw top to bottle the newly created sealed bottle object starts in your inventory. Is it just a simple case of saying the object is =501 worn.

Many thanks.
Back to top Go down
View user profile
catventure
Admin Adventurer
avatar

Male
Number of posts : 376
Age : 64
Location : UK
Humor : Enjoys a laugh!
Adventure Points : 52
Registration date : 2008-06-08

PostSubject: Re: inventory command   Thu May 26, 2011 11:39 am

Quote :

How can i make it so that when user types screw top to bottle the newly created sealed bottle object starts in your inventory. Is it just a simple case of saying the object is =501 worn.

createX - this action creates the object in the current room only.

objlocX=501 - this will create or move the object to the player carried inventory room and is probably what you are looking for....

However, looks like you've got 2 objects in the game called "bottle"; a sealed one and an unsealed one. This might cause confusion with the parser. Since only ONE of the bottles will exist in the game at any one time you need to tell TAB the state of the current bottle used - so that TAB can make sure the input commands are referring to the correct bottle...

You'll need a RESPONSE entry early on in the list to check which bottle is presently existing in the game, so as to change the parser object noun to be the correct bottle number if required.

I'll show you how to do this in next post.

Phil.




_________________
http://tab.thinbasic.com ; Home of the TAB I.F. project.
Back to top Go down
View user profile http://adventure.rpgdynasty.com
catventure
Admin Adventurer
avatar

Male
Number of posts : 376
Age : 64
Location : UK
Humor : Enjoys a laugh!
Adventure Points : 52
Registration date : 2008-06-08

PostSubject: Re: inventory command   Thu May 26, 2011 12:05 pm

Hi stants,

First a bit of explanation:

When TAB parses an input line typed by the player it will extract the FIRST occurrence in the Vocabulary lists for a matching word or synonym and then convert it to the KEYWORD so as to process the Response list of entries.

This means that either or both the parser variables "objn1" and "objn2" will be holding the corresponding number of the FIRST object in the Object Noun Vocabulary list that it comes across that has the word "bottle", should the player type in a command like:

>examine bottle

Now it may not be the correct bottle currently in the game so you need a RESPONSE entry near the BEGINNING of the list like this to check and change the "objn1" and "objn2" parser variables if necessary - and then JUMP to continue matching the Responses....

==================
[start]%_%#objn1=X#objlocX=0[acts]objn1=Y#updatecommand#jumpbottle[end]
bottle:
[start]%_%#objn2=X#objlocX=0[acts]objn2=Y#updatecommand#jumpbottle2[end]
bottle2:
==================

X should be set to the object number of the FIRST bottle number in the Object List...
Y should be set to the object number of the SECOND bottle number in the Object List (probably the sealed bottle)

Now if the player types eg:

>examine bottle

TAB will see which bottle exists in the game then alter the object number to be the correct bottle number if required then continue on to match the RESPONSES...

Hope you understand that - and please let me know if it works OK.
Now you can see why best to avoid too many objects with same noun name.
With some thought you can come up with alternative and different object names for your items to avoid this kind of thing Very Happy

Phil.

***Response code amended/updated today 17:11

_________________
http://tab.thinbasic.com ; Home of the TAB I.F. project.
Back to top Go down
View user profile http://adventure.rpgdynasty.com
Sponsored content




PostSubject: Re: inventory command   

Back to top Go down
 

inventory command

View previous topic View next topic Back to top 

 Similar topics

+
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
TAB - thinBasic Adventure Builder :: TAB FORUMS :: General Forum-
Jump to: