Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Synthetique on Sat 26/07/2003 15:00:17

Title: Mouse over character
Post by: Synthetique on Sat 26/07/2003 15:00:17
hey ho,,

I want a character do disappear when the mouse is over him. How should i script it?
Title: Re:Mouse over character
Post by: Ishmael on Sat 26/07/2003 15:08:20
if (GetCharacterAt(mouse.x,mouse.y)== x) {
 character[char].room=-1
} else if (GetCharacterAt(mouse.x,mouse.y)=! x) {
 character[char].room=currentroom
}

?
Title: Re:Mouse over character
Post by: MachineElf on Sat 26/07/2003 15:16:33
That won't work, as when the character has left the room, the mouse.x mouse.y won't be over the character which means it will just be stuck in sending the character in and out of the room.

If you just want him to disappear, however, the first part of the script would work. Just put it in the repeatedly_executed in your global script.
Title: Re:Mouse over character
Post by: Synthetique on Sat 26/07/2003 15:47:13
but then i have to point exactly on the pixel where he stands.
I want to make a SPECIFIC character disappear when the mouse is pointing at any of his visible pixels.
Title: Re:Mouse over character
Post by: Synthetique on Sat 26/07/2003 16:25:42
I dont need this anymore. But thanks anyway. I came up with a better idea. ;D
Title: Re:Mouse over character
Post by: Pumaman on Sat 26/07/2003 16:53:17
Quote from: Synthetique on Sat 26/07/2003 15:47:13
but then i have to point exactly on the pixel where he stands.
I want to make a SPECIFIC character disappear when the mouse is pointing at any of his visible pixels.

No, TK's script was correct.

if (GetCharacterAt(mouse.x,mouse.y) == CHARID) {
character[CHARID].room = -1;
}

will do what you want.