- Kaneb1997 wrote:
- Hey all,im new to this whole thing (only started yesterday) so can you please be noob friendly.
My problem is that im want to make a guy that when you talk to him he says go get somthing,then when you talk to him again is does a check to see if u have the item in ur inv,then if u do it removes it and you get a reward,in this case a Knife.
So ive got
[start]talk to weapon dealer#charpresent3#[acts]cmess Weapon Dealer: Hey mate,Sorry but I dont have any weapons in,some idiot stole them.Tell you what if you get me a stick ill give you a Knife.Show me the stick once you get 1.#flag1=1#[end]
then ive got
[start]talk to weapon dealer#charpresent3#flag1=1#check for stick#[acts]cmess Weapon Dealer: So I see you have the stick,ill just take that from you and here is the Knife.#remove stick#add knife[end]
Hi Kaneb1997,
Welcome to the TAB IF Community.
You are on the right track alright. Where you have put "check for stick" you need to use one of the object check CONDITION eg:
#objlocX=501#
or
#carriedX#
(where X is the object number of the stick; checks player carried inventory to see if that object is being carried)
Where you have put "remove stick" you need to use an object manipulation
ACTION such as:
#destroyX#
or
#objlocX=0#
(where X is object number of stick; removes stick from game)
As "weapon dealer" is 2 words you may need to change it to "dealer" in the Character NOUN field in the Character Editor...
/dealer/
and add "weapon" to the deletions vocabulary...
Where you have put #add knife# in the entry you agian use one of the object ACTIONS eg:
#objlocX=501#
(where X is the object number of the KNIFE... puts the object to the player's carried inventory)
You may also need to check that flag1=0 and amend it to hold a value of 2 when the knife has been handed over...
So your entries would look something like this:
[start]talk to dealer#charpresent3#
flag1=0[acts]cmessWeapon Dealer: "Hey mate, Sorry but I dont have any weapons in. Some idiot stole them. Tell you what if you get me a stick I'll give you a Knife. Show me the stick once you get one.#flag1=1[end]
[start]talk to dealer#charpresent3#flag1=1#
carriedX[acts]cmessWeapon Dealer: "So I see you have the stick. I'll just take that from you and here is the knife.#
destroyX#
objlocX=501#
flag1=2[end]
[start]talk to dealer#charpresent3#flag1=2[acts]cmessWeapon Dealer: "I have nothing further to say or tell you!"[end]
The third entry triggers if they talk to the dealer AFTER he has given up the knife.. (flag1=2)
Hope this helps.
Let me know, anyway.
Regards,
catventure.