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 | 
 

 Container Object error

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 Object error   Wed Oct 08, 2008 3:06 am

I'm trying to build a universal open container response script and this is what I have:

[start]open %objn1%#closedobjn1[acts]openobjn1#cmessYou slowly open the %objn1%.#lookinobj#else#openedobjn1[acts]cmessIt's already opened![end]

I searched through the language file and openobjn1 is in there but TAB keeps giving me an error saying it's invalid. I can get it to work just fine if I gear it toward one specific object, but I plan on having 100+ rooms with many chests and containers. Any help would be great.
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: Container Object error   Wed Oct 08, 2008 2:40 pm

kaele7 wrote:

[start]open %objn1%#closedobjn1[acts]openobjn1#cmessYou slowly open the %objn1%.#lookinobj#else#openedobjn1[acts]cmessIt's already opened![end]

Hi kaele7 and welcome to TAB forum. Thanks for your feedback. I've checked and your code is almost perfect. You are right. Somehow the "openobjn1", "openobjn2", "closeobjn1" and "closeobjn2" ACTIONS have gone MISSING!!

However, not to worry because I have added them now and re-posted a new release 44.1 just now.

http://tab.thinbasic.com/

Please download that (remember to save your database somewhere safe before deleting the older TAB package)

Then is two slight adjustments to your code:

[start]open %objn1%#closedobjn1[acts]openobjn1#cmessYou slowly open the %objn1%.#objn2=objn1#lookinobj#else#openobjn1[acts]cmessIt's already opened![end]

"lookinobj" is a special default action made for TAB that only works correctly on the objn2 parser variable.

Therefore to have it respond correctly you need to do a "objn2=objn1" action before calling "lookinobj" above so that objn2 holds the number of the correct object noun.

conditions "openobjn1" and "closedobjn1" is the correct syntax.

Finally, I would just mention to read the thread about container objects for more info and also probably best if you have your chests and containers use differentiated nouns. This is because TAB has difficulty handling more than one object with the same noun name. You can do it but it requires extra code to implement - but its advisable, and it will certainly cause less trouble to have each object use a different noun.
eg: box, chest, cabinet, drawer, basket, wardrobe etc..

Thanks again for your report and let me know if it now works for you.

Best wishes,
catventure.

_________________
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 Object error   Wed Oct 08, 2008 4:15 pm

It works beautifully but I'm confused about the openobjn1 condition. I'm trying to develop the code to close the obj and I don't want it to run if the wardrobe is already opened. openobjn1 works as a condition but the closeobjn1 action doesn't seem to actually close the wardrobe.

[start]close %objn1%#openobjn1[acts]closeobjn1#cmessYou gently close the %objn1%.#else#closedobjn1[acts]cmessIt's closed already![end]
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: Container Object error   Wed Oct 08, 2008 4:51 pm

kaele7 wrote:

[start]close %objn1%#openobjn1[acts]closeobjn1#cmessYou gently close the %objn1%.#else#closedobjn1[acts]cmessIt's closed already![end]

Hi kaele7,

Hmm! Embarassed
That's because in my haste I made a stupid coding error with "closeobjn1"
action.!!!

Your code is perfectly correct though. I have to be *very* careful when making changes...

Please bear with me whilst I fix it and upload again. Apologies. Please watch for new forum announcement!

catventure (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: Container Object error   Wed Oct 08, 2008 5:08 pm

OK. Fixed it.

You might want to consider using the below CONDITIONS which check if the specific object actually IS a container object first...

objn1container - is objn1 a container?
objn2container
objn1notcontainer - is objn1 not a container?
objn2notcontainer

[start]open %objn1%#objn1container#closedobjn1[acts]openobjn1#cmessYou slowly open the %objn1%.#objn2=objn1#lookinobj#else#objn1container#openobjn1[acts]cmessIt's already opened![end]

[start]close %objn1%#objn1container#openobjn1[acts]closeobjn1#cmessYou gently close the %objn1%.#else#objn1container#closedobjn1[acts]cmessIt's closed already![end]


Release 44.2 uploaded.

Please download from:

http://tab.thinbasic.com/

or use TAB Online Updater on Editor Main Window.

Thanks for your feedback report. I'm glad it is OK now.
Sorry you had trouble.

What sort of game you making Question

Regards,
Phil.

_________________
http://tab.thinbasic.com ; Home of the TAB I.F. project.


Last edited by catventure on Wed Oct 08, 2008 5:21 pm; edited 3 times in total
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 Object error   Wed Oct 08, 2008 5:16 pm

Have you heard of World of Warcraft? It's a game based in that universe. It begins with a horrific dream of Northrend and of the evil there, and subsequent story of how your character works his/her way to discover the mystery of it all and helps to thwart the danger.
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: Container Object error   Wed Oct 08, 2008 5:27 pm

World of Warcraft... Interesting material for an IF game. Surprised

Haven't actually played that. Looks good from what I can see.

Don't hesitate to post if you need any further clarification or advise etc.

Good Luck,
Phil.

Since the bug is fixed I will lock this topic.

_________________
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: Container Object error   

Back to top Go down
 

Container Object error

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 :: Bug Reports-
Jump to: