kaele7 Novice Adventurer
Number of posts: 13 Adventure Points: 0 Registration date: 2008-10-08
 | Subject: Container Object error Wed Oct 08, 2008 2: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. |
|
catventure Admin Adventurer

 Number of posts: 215 Age: 57 Location: UK Humor: Enjoys a laugh! Adventure Points: 40 Registration date: 2008-06-08
 | Subject: Re: Container Object error Wed Oct 08, 2008 1: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. |
|
kaele7 Novice Adventurer
Number of posts: 13 Adventure Points: 0 Registration date: 2008-10-08
 | Subject: Re: Container Object error Wed Oct 08, 2008 3: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] |
|
catventure Admin Adventurer

 Number of posts: 215 Age: 57 Location: UK Humor: Enjoys a laugh! Adventure Points: 40 Registration date: 2008-06-08
 | Subject: Re: Container Object error Wed Oct 08, 2008 3: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! 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) |
|
catventure Admin Adventurer

 Number of posts: 215 Age: 57 Location: UK Humor: Enjoys a laugh! Adventure Points: 40 Registration date: 2008-06-08
 | Subject: Re: Container Object error Wed Oct 08, 2008 4: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 Regards, Phil.
Last edited by catventure on Wed Oct 08, 2008 4:21 pm; edited 3 times in total |
|
kaele7 Novice Adventurer
Number of posts: 13 Adventure Points: 0 Registration date: 2008-10-08
 | Subject: Re: Container Object error Wed Oct 08, 2008 4: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. |
|
catventure Admin Adventurer

 Number of posts: 215 Age: 57 Location: UK Humor: Enjoys a laugh! Adventure Points: 40 Registration date: 2008-06-08
 | Subject: Re: Container Object error Wed Oct 08, 2008 4:27 pm | |
| World of Warcraft... Interesting material for an IF game. 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. |
|