Use *object* with *object* function
Videogamez Boy
07 Jan 2016, 17:47Hello, everyone. I just want to figure out if we can use the function as I already mentioned.
For example, say you found the box (a container), which was sealed in masking tape. So, in order to open it, you must have some kind of knife in your inventory. And then, use the command 'Cut box with knife'. Even I just found out using the lock function within container function is not so effective for this one. Another example also can be 'Open bottle with bottle opener'.
Any ideas?
For example, say you found the box (a container), which was sealed in masking tape. So, in order to open it, you must have some kind of knife in your inventory. And then, use the command 'Cut box with knife'. Even I just found out using the lock function within container function is not so effective for this one. Another example also can be 'Open bottle with bottle opener'.
Any ideas?

jaynabonne
07 Jan 2016, 21:12Assuming you have an object called "box" and an object called "knife"...
Click on "box".
Click the Verbs tab
Click Add
For the verb, type "cut", then hit OK. You should see the "cut" verb in the list and under the Verbs tab in the left pane.
Click the "cut" verb you just created on the box object's Verbs tab (the same place you just created it)
Change "print a message" to "require another object"
Click Add under "require another object"
Select the knife object from the dropdown and click ok.
Now add whatever script you want to happen when the knife is used to cut the box.
That's it!
With the above:
If you want to see where the "with" comes in, click the "cut" Verb in the main Verbs folder under "game". The "object separator" determines what will work. So with the defaults of "with; using", both of these will work: "cut box with knife" and "cut box using knife".
Click on "box".
Click the Verbs tab
Click Add
For the verb, type "cut", then hit OK. You should see the "cut" verb in the list and under the Verbs tab in the left pane.
Click the "cut" verb you just created on the box object's Verbs tab (the same place you just created it)
Change "print a message" to "require another object"
Click Add under "require another object"
Select the knife object from the dropdown and click ok.
Now add whatever script you want to happen when the knife is used to cut the box.
That's it!
With the above:
> cut box with knife
You cut the box with the knife, proving the verb thingy works with "with"
If you want to see where the "with" comes in, click the "cut" Verb in the main Verbs folder under "game". The "object separator" determines what will work. So with the defaults of "with; using", both of these will work: "cut box with knife" and "cut box using knife".
Videogamez Boy
08 Jan 2016, 16:02Thanks. I tried and it''s working. But, how to put some restriction on the 'open' verb applied to the box, like print a message when player press or type 'open' with 'The box is sealed, you can't open it unless with knife', thus forcing the player to find the 'knife' object.

OurJud
08 Jan 2016, 16:09Run an if/else script which checks if the player is carrying the knife, and print the appropriate messages.
if (Got(knife)) {
msg ("You open the box.")
}
else {
msg ("You don't have the knife.")
}
Videogamez Boy
08 Jan 2016, 17:10It works with 'cut' verb, but only one problem is, it doesn't applied to the 'open' verb.
P/S: Sorry for my question, but thanks for the answers anyway.
P/S: Sorry for my question, but thanks for the answers anyway.
