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 | 
 

 Giving and obtaining object with character

View previous topic View next topic Go down 
AuthorMessage
garethfx
Experienced Adventurer


Male
Number of posts : 85
Age : 59
Location : Wales
Humor : Nothing like having a good laugh - oh and a pint!
Adventure Points : 53
Registration date : 2009-09-28

PostSubject: Giving and obtaining object with character   Wed Oct 07, 2009 9:12 pm

Hi All

Just dipping my toe in to the Character pool .

Ive set up a situation where the player "finds" a liard (french money) he needs to purchase a single match from Marie the little matchgirl

I have the character roaming in the locations I need - alls well there.
However, Ive looked through the examples and think Ive written a resonable code to capture the giving on "money" to the character

[start]give marie money#here12#charpresent1#flag1=0[acts]destroy12#create10#flag1=1#cmessThe little match girl smiles and gratefully accepts your money. She hands you single match and says use it wisely sir.[end]

Key: Flag 1 will be used gfor messages later
Obj 12 is the match
obj 10 is the match

Im destroying the money as its not needed again (at least for a while and Ill recreate when I do need it)

I'm creating the 10 (match) with a simple message


I know its not great code but Im just developing the action so that Ill then build around the range of other possibilities - i.e. not offered money but something else which will be refused - running out of matches so player cannot buy more etc

just wondered if Im on the right track as this is pivital to the start of the game.

Im presently getting " cant do that messages

Apart from this code there is nothing else affecting the charactor as yet

Gareth
Back to top Go down
View user profile
catventure
Admin Adventurer
avatar

Male
Number of posts : 376
Age : 65
Location : UK
Humor : Enjoys a laugh!
Adventure Points : 52
Registration date : 2008-06-08

PostSubject: Re: Giving and obtaining object with character   Thu Oct 08, 2009 8:27 am

Hi Gareth,

I looked at the conditions and actions in the code example you posted and it seemed ok. Maybe the problem with receiving the "You can't do that" message is connected with the entry calling "words conditions"??

Check your object noun for the "money" (Obj 12)
Remember TAB works on the FIRST word in the object noun (KEYWORD)
If you have it set something like:

/liard/money/

then

[start]give marie money#here12#charpresent1#flag1=0[acts]destroy12#create10#flag1=1#cmessThe little match girl smiles and gratefully accepts your money. She hands you single match and says use it wisely sir.[end]

will not be done because "money" is a SYNONYM. In that case change to:

[start]give marie liard/give liard to marie#here12#charpresent1#flag1=0[acts]destroy12#create10#flag1=1#cmessThe little match girl smiles and gratefully accepts your money. She hands you a single match and says: "Use it wisely sir."[end]

Another possibility to check is that you haven't already used Flag 1 somewhere else and set it a value > 0 or that you have no verb /give/ in the Vocabulary Verbs List...

If you want the "match" (object 10) to be placed straight into the player's carried inventory instead of being "created" inside the current room then change the action "create10" to a different object moving action "objloc10=501"

Cheers,
Phil.

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


Male
Number of posts : 85
Age : 59
Location : Wales
Humor : Nothing like having a good laugh - oh and a pint!
Adventure Points : 53
Registration date : 2009-09-28

PostSubject: Re: Giving and obtaining object with character   Thu Oct 08, 2009 12:08 pm

You were right phil

In objects Id placed LIARD as the primary word with coin then money - sorted

then I checked in the character file - done the same thing I set matchgirl as primary and marie as secondary - changed and tested each of the word changes and away we went

many thanks for that - I will take on board the move object rather than place it will be quicker for the player and more in line with what would really happen

Gareth
Back to top Go down
View user profile
garethfx
Experienced Adventurer


Male
Number of posts : 85
Age : 59
Location : Wales
Humor : Nothing like having a good laugh - oh and a pint!
Adventure Points : 53
Registration date : 2009-09-28

PostSubject: Re: Giving and obtaining object with character   Thu Oct 08, 2009 9:31 pm

hi all

came across a small situation which Ive tried to sort with little luck

i need to be able to give a character money for a match. - however im using the following to trap anyother object being offered. checking if its object 12 (money) if not then message of rejection

Ive colour coded the code I think I need but of course - it will not work

[start]give %objn1% to marie#charpresent1#objlocn1=here#flag1=0#objlocn1<>12[acts]cmessThe little shakes here head refusing your offer saying I'm sorry I cannot accept that. I must sell my matches to make money.[end]

Summery
I need to test if objlocn1 is NOT the the money (object12) being offered and reject it if its not money

Any ideas??

Gareth
Back to top Go down
View user profile
catventure
Admin Adventurer
avatar

Male
Number of posts : 376
Age : 65
Location : UK
Humor : Enjoys a laugh!
Adventure Points : 52
Registration date : 2008-06-08

PostSubject: Re: Giving and obtaining object with character   Fri Oct 09, 2009 11:38 am

Hi Gareth,

[start]give %objn1% to marie#charpresent1#objlocn1=here#flag1=0#objn1<>12[acts]cmessThe little matchgirl shakes here head refusing your offer saying I'm sorry I cannot accept that. I must sell my matches to make money.[end]

"objlocn1<>12" condition checks to see if the location of the object noun1 is not equal to LOCATION 12 !!

"objn1<>12" condition checks that the object noun1 is not object noun 12 - which is what you are looking for here, I think...

Quote :

Object Noun 1 conditions
objn1 [ >= | <= | <> | > | < | = ] X (200)
Example: "objn1<50"

Hope this helps.

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
garethfx
Experienced Adventurer


Male
Number of posts : 85
Age : 59
Location : Wales
Humor : Nothing like having a good laugh - oh and a pint!
Adventure Points : 53
Registration date : 2009-09-28

PostSubject: Re: Giving and obtaining object with character   Fri Oct 09, 2009 4:28 pm

OOOwww I was close with that one then lol

Yes Phil - Thats what I was looking for - These little bits all help

many thanks
Gareth
Back to top Go down
View user profile
Sponsored content




PostSubject: Re: Giving and obtaining object with character   

Back to top Go down
 

Giving and obtaining object with character

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: