I have a working tooltip where if the mouse is on any object, it first checks if it has a description to show. If it does, it runs a script which displays the object's description.
Now, in order to do this, I had this code:
with (all)
{
if (mouse_x >= x and mouse_x <= x + real(sprite_width) and mouse_y >= y and mouse_y <= y + real(sprite_height))
{
//For equipment
if (description == "ITEM")
{
showItemTooltip(adjective, type, noun, effectType, value);
}
else
{
//For other objects
if (description != "")
{
showTooltip(description, info);
}
}
}
}
As you can see, this checks with ALL objects whether the mouse is on them or not.
However, sometimes, the game errors, saying that it cannot find the "description" variable. However, I went through EVERY object I had to ensure they had the "description" variable.
So... can anyone help me figure out what else could be the problem? I know it's something to do with this code, the way it checks if the mouse is on an object but I can't seem to figure it out.
Thanks.











