I think you will need to create a new command, rather than use the built-in USE facility. Put in a pattern like this, then it should work as you expect.
use #object1# on #object2#
if (object1.real=true) {
if (object2.real=true) {
if (object1 = paper) {
msg ("You use the paper on that.")
}
if (object1 = ball) {
msg ("You use the ball on that.")
}
else {
msg ("..")
}
}
else {
msg ("error!")
}
}
else {
msg ("error!")
}
Unfortunately, you do now have to put in code to allow for each object in your game to be used, and if you have only half a dozen objects, that will get messy. What you could do is set up a script on each object, say called "usescript", and call that (with "invoke", so we can use object2 as a local variable in the script).
if (object1.real=true) {
if (object2.real=true) {
object1.object2 = object2
params = NewObjectDictionary()
dictionary add (params, "object2", object2)
invoke (object1.usescript, params)
}
else {
msg ("error!")
}
}
else {
msg ("error!")
}
Your "usescript" (set up the attributes tab) on paper might look like this:
msg("You use the paper on the " + object2.name)