Error Message

Summa_Civis
19 Nov 2022, 00:11After trying to repair this error for hours now, I come to realize that I need help...
Ok... have three HTML objects set to three separate onclick asl events. Only one of these events presently work, while the other two objects send back a message like this:
Error running script: Error evaluating expression '(not GetBoolean(game.pov.parent, "visited")) and HasScript(game.pov.parent, "beforefirstenter")': GetBoolean function expected object parameter but was passed 'options'Error running script: Error evaluating expression 'GetDirectChildren(game.pov.parent)': GetDirectChildren function expected object parameter but was passed 'options'Error running script: Error evaluating expression 'GetAllChildObjects(room)': GetAllChildObjects function expected object parameter but was passed 'options' Error running script: Error evaluating expression 'GetAllChildObjects(room)': GetAllChildObjects function expected object parameter but was passed 'options' Error running script: Error evaluating expression 'GetBoolean(room, "transparent")': GetBoolean function expected object parameter but was passed 'options'Error running script: Error evaluating expression 'GetAllChildObjects(newParent)': GetAllChildObjects function expected object parameter but was passed 'null
I do not know what I am doing wrong. I checked the html file and functions multiple times and can't find any discrepancies.
mrangel
19 Nov 2022, 11:48OK, it looks like game.pov.parent
(the attribute containing the current room) has been set to options
, which is not a room.
I can easily replicate this error by doing something like:
game.pov.parent = "options"
player.parent = "options"
MoveObject (player, "options")
MoveObject (game.pov, "options")
(those commands are all equivalent)
or similar commands.
Are you setting the player's location to the string "options"
at some point? If you're trying to send them to a room named options
, the command shouldn't have quotes around it.
"options"
is a string consisting of 7 letters
options
is the name of an object, with attributes and so on.
If you're not manually setting the location to a string, the most common way this can happen is when you use ShowMenu
to let the player pick from a list of rooms. In this case, the result will always be converted to a string, so you would need to use GetObject (result)
to get the actual room.

Summa_Civis
20 Nov 2022, 00:41Is the term "Options" problematic when creating a function? It appears when I take the term and make singularly "Option", I don't run into the same problem.
mrangel
20 Nov 2022, 13:00It's nothing to do with the word or its capitalisation. The problem is the quotes around "options"
You have tried setting the players location to a string instead of a room.

Summa_Civis
20 Nov 2022, 23:38Thank you mrangel for the clarification. This forum is really great for learning some of these basic concepts. I'm really new to html programming and feel supported by the guidance that I've received from this forum.