|
Author | Message |
---|
kaele7 Novice Adventurer
Number of posts : 13 Adventure Points : 0 Registration date : 2008-10-08
| Subject: Container Scripts Tue 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] |
|
| |
catventure Admin Adventurer
Number of posts : 410 Age : 72 Location : UK Humor : Enjoys a laugh! Adventure Points : 77 Registration date : 2008-06-08
| Subject: Re: Container Scripts Tue 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 |
|
| |
kaele7 Novice Adventurer
Number of posts : 13 Adventure Points : 0 Registration date : 2008-10-08
| Subject: Re: Container Scripts Tue 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. |
|
| |
catventure Admin Adventurer
Number of posts : 410 Age : 72 Location : UK Humor : Enjoys a laugh! Adventure Points : 77 Registration date : 2008-06-08
| Subject: Re: Container Scripts Tue 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 |
|
| |
catventure Admin Adventurer
Number of posts : 410 Age : 72 Location : UK Humor : Enjoys a laugh! Adventure Points : 77 Registration date : 2008-06-08
| Subject: Re: Container Scripts Tue 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. |
|
| |
kaele7 Novice Adventurer
Number of posts : 13 Adventure Points : 0 Registration date : 2008-10-08
| Subject: Re: Container Scripts Tue 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. |
|
| |
catventure Admin Adventurer
Number of posts : 410 Age : 72 Location : UK Humor : Enjoys a laugh! Adventure Points : 77 Registration date : 2008-06-08
| Subject: Re: Container Scripts Tue 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. |
|
| |
catventure Admin Adventurer
Number of posts : 410 Age : 72 Location : UK Humor : Enjoys a laugh! Adventure Points : 77 Registration date : 2008-06-08
| Subject: Re: Container Scripts Fri 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. |
|
| |
Sponsored content
| Subject: Re: Container Scripts | |
| |
|
| |
|