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 to engage in intelligent conversation with NPCs?
Giving and obtaining object with character I_icon_minitimeSun Dec 08, 2024 3:52 pm by catventure

» How was it done? Implementing in-game clocks
Giving and obtaining object with character I_icon_minitimeMon Dec 02, 2024 4:18 pm by catventure

» refine player-available gender/name options
Giving and obtaining object with character I_icon_minitimeMon Nov 18, 2024 6:04 pm by catventure

» Incubation pt 1
Giving and obtaining object with character I_icon_minitimeSun Nov 17, 2024 4:22 pm by catventure

» Happy New Year 2024!
Giving and obtaining object with character I_icon_minitimeSun Dec 31, 2023 4:04 pm by catventure

» TAB Version 71
Giving and obtaining object with character I_icon_minitimeMon Aug 21, 2023 12:17 pm by catventure

» TAB Version 70
Giving and obtaining object with character I_icon_minitimeSun Oct 02, 2022 1:49 pm by catventure

» TAB Version 70
Giving and obtaining object with character I_icon_minitimeFri Sep 30, 2022 10:23 pm by catventure

» TAB Version 70
Giving and obtaining object with character I_icon_minitimeMon May 23, 2022 4:08 pm 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 : 67
Location : Wales
Humor : Nothing like having a good laugh - oh and a pint!
Adventure Points : 53
Registration date : 2009-09-28

Giving and obtaining object with character Empty
PostSubject: Giving and obtaining object with character   Giving and obtaining object with character I_icon_minitimeWed 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
catventure
Admin Adventurer
catventure

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

Giving and obtaining object with character Empty
PostSubject: Re: Giving and obtaining object with character   Giving and obtaining object with character I_icon_minitimeThu 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.
Back to top Go down
https://adventure.forumotion.com
garethfx
Experienced Adventurer


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

Giving and obtaining object with character Empty
PostSubject: Re: Giving and obtaining object with character   Giving and obtaining object with character I_icon_minitimeThu 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
garethfx
Experienced Adventurer


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

Giving and obtaining object with character Empty
PostSubject: Re: Giving and obtaining object with character   Giving and obtaining object with character I_icon_minitimeThu 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
catventure
Admin Adventurer
catventure

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

Giving and obtaining object with character Empty
PostSubject: Re: Giving and obtaining object with character   Giving and obtaining object with character I_icon_minitimeFri 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.
Back to top Go down
https://adventure.forumotion.com
garethfx
Experienced Adventurer


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

Giving and obtaining object with character Empty
PostSubject: Re: Giving and obtaining object with character   Giving and obtaining object with character I_icon_minitimeFri 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
Sponsored content




Giving and obtaining object with character Empty
PostSubject: Re: Giving and obtaining object with character   Giving and obtaining object with character I_icon_minitime

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: