Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Buckethead on Sat 02/09/2006 18:01:13

Title: mover over hotspot>show its name
Post by: Buckethead on Sat 02/09/2006 18:01:13
hey,

I want the game to show the name of the hotspot or person where you move the mouse over them. Juts like in all Ben Jordan games. I looked all over the forum and the help file but couldn't find exactly what I was looking for.
Title: Re: mover over hotspot>show its name
Post by: R4L on Sat 02/09/2006 18:10:22
Look in the manual:

@OVERHOTSPOT@

Make a gui, and a label in it that says @OVERHOTSPOT@

Make sure the areas are transparent.

Then under rep_execute:

gStatusLine.Position(mouse.x,mouse.y);

gStatusline would be your GUI name, so if your GUI name was Label, it would be this:

gLabel.Position(mouse.x,mouse.y);

Off my head but im pretty sure it works. Hope I helped.
Title: Re: mover over hotspot>show its name
Post by: Buckethead on Sat 02/09/2006 18:16:22
thnx for the quick reply, i'm going to check it out  :)

EDIT:

err I don't get the rep_execute part... what does that mean?  ???
Title: Re: mover over hotspot>show its name
Post by: Candle on Sat 02/09/2006 19:06:56
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=26306.0
Title: Re: mover over hotspot>show its name
Post by: Buckethead on Sat 02/09/2006 19:12:24
Quote from: Candle on Sat 02/09/2006 19:06:56
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=26306.0

that only cofuses me more to be honest  ???
Title: Re: mover over hotspot>show its name
Post by: Candle on Sat 02/09/2006 19:25:32
It is a module to do that. how could you be confused ?
Title: Re: mover over hotspot>show its name
Post by: Buckethead on Sun 03/09/2006 08:01:37
coz it displays the names in the left corner where my other gui is. Please just explain what Rap4life said a little further  :)
Title: Re: mover over hotspot>show its name
Post by: R4L on Sun 03/09/2006 12:08:56
Rep_execute is in your global script. Open it up and under Game_Start there should be Repeatedly_Execute. Put the code under that. You could have looked it up in the manual pretty easily, but I wanted to save you some time.  :)
Title: Re: mover over hotspot>show its name
Post by: Buckethead on Sun 03/09/2006 15:35:48
It gives this error  ??? :(

(http://img402.imageshack.us/img402/7103/parseerrorzl2.png)
Title: Re: mover over hotspot>show its name
Post by: R4L on Sun 03/09/2006 16:19:49
Hmm.. could you please post up your global script?

EDIT: Actually, it seems your either missing a brace at the end (its this })
or you accidently put the code after the closing brace in your repeatedly execute part.

Here:

#sectionstart repeatedly_executeÃ,  // DO NOT EDIT OR REMOVE THIS LINE
function repeatedly_execute() {
Ã,  // put anything you want to happen every game cycle here
gLabel.Position(mouse.x,mouse.y);
}
#sectionend repeatedly_executeÃ,  // DO NOT EDIT OR REMOVE THIS LINE


Im pretty sure thats it though. Just put the gLabel.Position(mouse.x,mouse.y); in where you see it in my code, into your global script. Also, I hope your putting the GUI name instead of gLabel. Like I said, if your GUI with the @OVERHOTSPOT@ is called Label, then it will be gLabel.Position blah blah.
Title: Re: mover over hotspot>show its name
Post by: Buckethead on Sun 03/09/2006 17:13:28
what did I do wrong now ?  ??? :o :(

(http://img112.imageshack.us/img112/8626/anothererroryr4.th.png) (http://img112.imageshack.us/my.php?image=anothererroryr4.png)

(http://img397.imageshack.us/img397/3509/nowwhatez0.th.png) (http://img397.imageshack.us/my.php?image=nowwhatez0.png)
Title: Re: mover over hotspot>show its name
Post by: Khris on Sun 03/09/2006 17:39:19
It's supposed to be "SetPosition".

There is a manual, and there's the auto-complete function of the script editor. Is it really too difficult to use either one?
Sorry if that sounded rude, but you might want to do some research of your own first when you're stuck, especially if it's just about one line of simple code.
Title: Re: mover over hotspot>show its name
Post by: R4L on Sun 03/09/2006 19:10:50
Yes what KhrisMUC saidÃ,  :D.

As you can tell, I'm not very good at explaining things.Ã,  :)

It should be gLabel.SetPosition(mouse.x,mouse.y);

Hopefully...
Title: Re: mover over hotspot>show its name
Post by: Buckethead on Mon 04/09/2006 15:04:20
I checked the manual but still I didn't expect SetPosition would be the sulution especially because Rap4life kept saying it was position  :P neverless! I shall read the manual untill I can dream scripting now!!
Title: Re: mover over hotspot>show its name
Post by: SSH on Mon 04/09/2006 16:35:46
Or just read the module's instructions that was posted earlier. This is about the 3rd or 4th person reinventing the wheel recently...
Title: Re: mover over hotspot>show its name
Post by: R4L on Mon 04/09/2006 18:08:02
Yeah especially for something so simple. I can't believe I didn't get it right the first time. So this works Buckethead?