Problem setting what a verb does

Eaten By A Grue
In the game I'm working on for the interactive fiction contest, the protagonist eventually gets the power to drink water and use it to summon a small rain cloud. Once she uses the power once, she has to find a source of water to refill. There are a few spots where it's used to solve puzzles, but I also want the player to be able to summon rain on anything and get a general message about the thing getting wet, and this action still has to obey the rules I've set for the power (if her water reserves are filled, they empty, if empty, you get a message saying you can't do it), so it has to be a script, not just printing a line. I also put in a message just in case someone uses the verb before having gotten the power. I set this up and made it a 'script' under the 'defaultexpression' attribute of the verb -- here is what it looks like in code view:

if (GetBoolean(pearl idol, "touched")) {
if (GetBoolean(player, "waterlogged")) {
msg ("Summoning a small storm, you thoroughly soak " + object.article + ".")
SetObjectFlagOff (player, "waterlogged")
}
else {
msg ("Your water reserves are empty.")
}
}
else {
msg ("You doubt you've got enough spit to do that on the spittiest day of your life.")
}

However, here is the message I get when trying to use the 'drench' verb in game:

Error running script: Error compiling expression 'Eval(this.defaultexpression, params)': FunctionCallElement: Could find not function 'Eval(LazyLoadScript, QuestDictionary`1)

Can anyone tell me what I'm doing wrong? Is there a way to set up the game so that it will do what I want? Usually I've been able to figure things out, but this one has me baffled. I don't want to attach the game file because the rules say it's not supposed to be made publicly available, but if someone wants to look at it, send me a message!

Alex
defaultexpression shouldn't be a script. It should be a string that contains an expression.

You could probably make a function, then have defaultexpression point to that, but that seems overstretching what a verb is supposed to be. I think what you really want is a command here instead, then you have total flexibility.

Eaten By A Grue
It seems like that works. Thank you very much for your help!

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums