garethfx Experienced Adventurer
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
| Subject: 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 |
|
catventure Admin Adventurer
Number of posts : 412 Age : 72 Location : UK Humor : Enjoys a laugh! Adventure Points : 77 Registration date : 2008-06-08
| Subject: 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. |
|
garethfx Experienced Adventurer
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
| Subject: 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 |
|
garethfx Experienced Adventurer
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
| Subject: 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 |
|
catventure Admin Adventurer
Number of posts : 412 Age : 72 Location : UK Humor : Enjoys a laugh! Adventure Points : 77 Registration date : 2008-06-08
| Subject: 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. |
|
garethfx Experienced Adventurer
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
| Subject: 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 |
|
Sponsored content
| Subject: Re: Giving and obtaining object with character | |
| |
|