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
» How was it done? Implementing in-game clocks
Container Scripts I_icon_minitimeToday at 9:54 am by catventure

» How to engage in intelligent conversation with NPCs?
Container Scripts I_icon_minitimeYesterday at 9:01 pm by catventure

» refine player-available gender/name options
Container Scripts I_icon_minitimeMon Nov 18, 2024 6:04 pm by catventure

» Incubation pt 1
Container Scripts I_icon_minitimeSun Nov 17, 2024 4:22 pm by catventure

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

» TAB Version 71
Container Scripts I_icon_minitimeMon Aug 21, 2023 12:17 pm by catventure

» TAB Version 70
Container Scripts I_icon_minitimeSun Oct 02, 2022 1:49 pm by catventure

» TAB Version 70
Container Scripts I_icon_minitimeFri Sep 30, 2022 10:23 pm by catventure

» TAB Version 70
Container Scripts I_icon_minitimeMon May 23, 2022 4:08 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

Container Scripts Empty
PostSubject: Container Scripts   Container Scripts I_icon_minitimeTue Oct 14, 2008 3: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
catventure
Admin Adventurer
catventure

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

Container Scripts Empty
PostSubject: Re: Container Scripts   Container Scripts I_icon_minitimeTue Oct 14, 2008 7: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
Back to top Go down
https://adventure.forumotion.com
kaele7
Novice Adventurer


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

Container Scripts Empty
PostSubject: Re: Container Scripts   Container Scripts I_icon_minitimeTue Oct 14, 2008 7: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
catventure
Admin Adventurer
catventure

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

Container Scripts Empty
PostSubject: Re: Container Scripts   Container Scripts I_icon_minitimeTue Oct 14, 2008 7: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
Back to top Go down
https://adventure.forumotion.com
catventure
Admin Adventurer
catventure

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

Container Scripts Empty
PostSubject: Re: Container Scripts   Container Scripts I_icon_minitimeTue Oct 14, 2008 7: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.
Back to top Go down
https://adventure.forumotion.com
kaele7
Novice Adventurer


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

Container Scripts Empty
PostSubject: Re: Container Scripts   Container Scripts I_icon_minitimeTue Oct 14, 2008 8: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
catventure
Admin Adventurer
catventure

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

Container Scripts Empty
PostSubject: Re: Container Scripts   Container Scripts I_icon_minitimeTue Oct 14, 2008 8: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.
Back to top Go down
https://adventure.forumotion.com
catventure
Admin Adventurer
catventure

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

Container Scripts Empty
PostSubject: Re: Container Scripts   Container Scripts I_icon_minitimeFri Oct 17, 2008 5: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.
Back to top Go down
https://adventure.forumotion.com
Sponsored content




Container Scripts Empty
PostSubject: Re: Container Scripts   Container Scripts I_icon_minitime

Back to top Go down
 

Container Scripts

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: