TAB - thinBasic Adventure Builder

T.A.B. is an interactive fiction/text adventure program for Windows in Alpha Development and made with thinBasic.
Home­FAQ­Search­Usergroups­Register­Log in
Latest topics
» TAB Alpha Version 57 Available
Fri Mar 12, 2010 5:14 pm by catventure

» TAB Alpha Version 56 Available
Sun Feb 14, 2010 11:44 am by catventure

» TAB Alpha Version 55 Available
Wed Feb 10, 2010 12:21 pm by catventure

» TAB Alpha Version 54 Available
Sat Jan 30, 2010 5:14 pm by catventure

» Alternative Location Descriptions
Tue Dec 29, 2009 8:38 pm by catventure

» TAB Alpha Version 53 Available
Sun Dec 27, 2009 10:37 am by catventure

» Player moving whilst in an object
Fri Nov 27, 2009 6:30 pm by garethfx

» Message text colours.
Mon Oct 19, 2009 8:25 pm by garethfx

» TAB Alpha Version 52 Available
Sun Oct 18, 2009 2:40 pm by catventure

Share | 
 

 Container Scripts

View previous topic View next topic Go down 
AuthorMessage
kaele7
Novice Adventurer


Number of posts: 13
Adventure Points: 0
Registration date: 2008-10-08

PostSubject: Container Scripts   Tue Oct 14, 2008 2:30 pm

I'm trying to do a couple things to make it easier on the user. First is to be able to open say a wardrobe in a certain room and be able to type 'get cloak' instead of 'get cloak from wardrobe'. Second is if there are many objects in it to be able to say 'get all' and get everything from both the room, and any open objs in the room. So far this is what I have:

[start]get %objn1%#objlocn1=roomcont[acts]objlocn1=501#cmessYou have taken the %objn1%.[end]

[start]get all %p% %objn2%#objlocn2=room#anyobjscontn2[acts]all%objlocn2%#objn1=501#cmessYou have taken the %objn1%.[end]
Back to top Go down
View user profile
catventure
Admin Adventurer


Male
Number of posts: 215
Age: 57
Location: UK
Humor: Enjoys a laugh!
Adventure Points: 40
Registration date: 2008-06-08

PostSubject: Re: Container Scripts   Tue Oct 14, 2008 6:16 pm

Hi Kaele,

You've come across something which I am fairly sure is not possible to do yet in TAB... I wouldn't waste too much time on it because there is not a way to check from a "get %objn1%" words conditions that a particular container in the current room is open...
Neither is it possible to "get all" and have it act on all open container objects present in the current room as well as in the current room itself.
Your idea is admirable enough though and I will give some thought to implementation if I can (maybe with some new conditions/actions)
Sorry I cannot be more helpful on this right now.

Best wishes,
Phil

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


Number of posts: 13
Adventure Points: 0
Registration date: 2008-10-08

PostSubject: Re: Container Scripts   Tue Oct 14, 2008 6:27 pm

Well the thing of it is, if I change the %objn2% variables into Wardrobe, and the loc 150 it works just fine, I just can't do a universal one.

[start]get all from wardrobe#objloc150=room#anyobjscont150[acts]all150#objn1=501#cmessYou now have the %objn1%.[end]

The above works just fine.

[start]get all %p% %objn2%#objlocn2=room#anyobjscontn2[acts]allcontn2#objn1=501#cmessYou now have the %objn1%.[end]

The conditions and actions are there in the language file, however when this script is actually implemented it enters into a never-ending loop, with no objects moved at all. It just repeats "You now have the ." over and over.

I had another question as well. I can't seem to get

[start]buy beer from lari#charpresent4#room=4#flag12=0[acts]flag12=1#mess16#objloc7=501#decflag9,5#cmess

You remove 5 silver and give it to Lari.
You now have the Dwarven Brew.[end]

to work. It might be a conflict between nouns because beer is an object noun as well as a regular noun. But I'm not sure how to go about fixing it. The idea is to be able to buy a beer from the barmaid and then have it transferred to your inventory and then give it to another character to get them to talk.
Back to top Go down
View user profile
catventure
Admin Adventurer


Male
Number of posts: 215
Age: 57
Location: UK
Humor: Enjoys a laugh!
Adventure Points: 40
Registration date: 2008-06-08

PostSubject: Re: Container Scripts   Tue Oct 14, 2008 6:36 pm

It *might* be a KEYWORD conflict.

"from" could be SYNONYM of "out"

Try using it with "out" and/or maybe "buy beer off lari"

Are you sure "lari" is KEYWORD and not "barmaid"?

Best just have one "beer" in the object noun vocab...
Set the Object Start Location to 0.

Then create the beer object when it is purchased.

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


Male
Number of posts: 215
Age: 57
Location: UK
Humor: Enjoys a laugh!
Adventure Points: 40
Registration date: 2008-06-08

PostSubject: Re: Container Scripts   Tue Oct 14, 2008 6:44 pm

Quote:

[start]get all from wardrobe#objloc150=room#anyobjscont150[acts]all150#objn1=501#cmessYou now have the %objn1%.[end]

[start]get all %p% %objn2%#objlocn2=room#anyobjscontn2[acts]allcontn2#objn1=501#cmessYou now have the %objn1%.[end]



Hi Kaele,

There is no need for these commands as this entry that already exists in TAB will do the job:

[start]get all out %objn2%[acts]takealloutobj[end]

Maybe you accidentally erased it. It is in all demo files.

However if you DO want to use your code there is a slight error that is causing the unwanted "looping":

[start]get all %p% %objn2%#objlocn2=room#anyobjscontn2[acts]allcontn2#objn1=501#cmessYou now have the %objn1%.[end]

should be:

[start]get all out %objn2%#objlocn2=room#anyobjscontn2[acts]allcontn2#objlocn1=501#cmessYou now have the %objn1%.[end]

Regards,
Phil.

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


Number of posts: 13
Adventure Points: 0
Registration date: 2008-10-08

PostSubject: Re: Container Scripts   Tue Oct 14, 2008 7:51 pm

In all my recent coding, I seem to have messed something up and I can't figure it out. I just added a LOT of scripts and response entries, and just got them all mostly bug free. But now a script that was working before seems to have stopped. It's a simple direction blocking script:

[start]south#room=4#flag8<>4[acts]cmessYou shouldn't leave until you talk to a few of the patrons.[end]

It's located above the

[start]go %directn1%[acts]moveplayer[end]

And I've tested %flag8% and it's 0.
Back to top Go down
View user profile
catventure
Admin Adventurer


Male
Number of posts: 215
Age: 57
Location: UK
Humor: Enjoys a laugh!
Adventure Points: 40
Registration date: 2008-06-08

PostSubject: Re: Container Scripts   Tue Oct 14, 2008 7:55 pm

Hi Kaele,

[start]go south#room=4#flag8<>4[acts]cmessYou shouldn't leave until you talk to a few of the patrons.[end]

That should make it work! Fingers crossed.

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


Male
Number of posts: 215
Age: 57
Location: UK
Humor: Enjoys a laugh!
Adventure Points: 40
Registration date: 2008-06-08

PostSubject: Re: Container Scripts   Fri Oct 17, 2008 4:28 pm

Quote:

I'm trying to do a couple things to make it easier on the user. First is to be able to open say a wardrobe in a certain room and be able to type 'get cloak' instead of 'get cloak from wardrobe'. Second is if there are many objects in it to be able to say 'get all' and get everything from both the room, and any open objs in the room.



Hi Kaele,

I've developed 2 new default auto-actions which I'm tentatively calling:
"getallplus" and "autogetobjplus"...

*NEW. "getallplus" default ACTION firstly tries to get all objects in any OPEN containers in the room and then tries to get any objects in the room itself using the standard normal "getall" action.

*NEW. "autogetobjplus" default ACTION tries to take the named object firstly from any OPEN container which may be held, worn or in the current room if it is in one, otherwise it will then try to get the named object via the the normal standard default "autogetobj" action.

With this action if the cloak was in an open wardrobe in the current room:

>get cloak

Handled by "autogetobjplus" instead of "autogetobj" the cloak would be placed into the player's carried inventory and the default system message:
"You now have the cloak."
printed.

To be present in next release.

Cheers,
Philip.

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

Container Scripts

View previous topic View next topic Back to top 
Page 1 of 1

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