Ok, what I want is to make the script for a label that works like the @OVERHOTSPOT@ and Iv'e run into a problem.
(http://www.xtreem.nu/jonas/error.png)
I get the error when I put this script in the repeatedly_execute section:
function repeatedly_execute() {
// put anything you want to happen every game cycle here
if (Game.GetLocationName(mouse.x, mouse.y) != "") {
Names_Label.Text = Game.GetLocationName(mouse.x, mouse.y);
}
if (Game.GetLocationName(mouse.x, mouse.y) == "") {
Names_Label.Text = "Nothing of interest";
}
}
Is there a work around or am I just not clever enough? :P Im not a scripter, so please reply as simple as possible. ;)
Thanks!
/A-Hed
Just a silly sort of question...but what version of AGS are you actually using?
Also, it's kind of odd that you have used 'if (... != "")' and then 'if (... == "")'. Might I suggest usage of the keyword, else?
function repeatedly_execute() {
// put anything you want to happen every game cycle here
if (Game.GetLocationName(mouse.x, mouse.y) != "")
Names_Label.Text = Game.GetLocationName(mouse.x, mouse.y);
else Names_Label.Text = "Nothing of interest";
}
Plus, brackets are only necessary around blocks of code. Seeing as you only have one line to execute for each statement (the if and the else statements respectively) the brackets aren't necessary. But, you said you're not a scripter, so it's okay....:D