TAB - thinBasic Adventure Builder
Would you like to react to this message? Create an account in a few clicks or log in to continue.

TAB - thinBasic Adventure Builder

T.A.B. is an interactive fiction/text adventure program for Windows and made with thinBasic.
 
HomeLatest imagesSearchRegisterLog in
Latest topics
» Incubation pt 1
inventory command I_icon_minitimeYesterday at 3:34 pm by Somsnosa

» refine player-available gender/name options
inventory command I_icon_minitimeYesterday at 2:32 pm by Somsnosa

» Happy New Year 2024!
inventory command I_icon_minitimeSun Dec 31, 2023 4:04 pm by catventure

» TAB Version 71
inventory command I_icon_minitimeMon Aug 21, 2023 12:17 pm by catventure

» TAB Version 70
inventory command I_icon_minitimeSun Oct 02, 2022 1:49 pm by catventure

» TAB Version 70
inventory command I_icon_minitimeFri Sep 30, 2022 10:23 pm by catventure

» TAB Version 70
inventory command I_icon_minitimeMon May 23, 2022 4:08 pm by catventure

» TAB Version 70
inventory command I_icon_minitimeSat Apr 30, 2022 11:15 am by catventure

» TAB Version 70
inventory command I_icon_minitimeSat Apr 23, 2022 2:32 pm by catventure


Share | 
 

 inventory command

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

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

inventory command Empty
PostSubject: inventory command   inventory command I_icon_minitimeThu 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
catventure
Admin Adventurer
catventure

Male
Number of posts : 404
Age : 72
Location : UK
Humor : Enjoys a laugh!
Adventure Points : 77
Registration date : 2008-06-08

inventory command Empty
PostSubject: Re: inventory command   inventory command I_icon_minitimeThu 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.



Back to top Go down
https://adventure.forumotion.com
catventure
Admin Adventurer
catventure

Male
Number of posts : 404
Age : 72
Location : UK
Humor : Enjoys a laugh!
Adventure Points : 77
Registration date : 2008-06-08

inventory command Empty
PostSubject: Re: inventory command   inventory command I_icon_minitimeThu 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
Back to top Go down
https://adventure.forumotion.com
Sponsored content




inventory command Empty
PostSubject: Re: inventory command   inventory command I_icon_minitime

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: