Functions only for characters

Started by Joe, Mon 03/07/2006 23:47:11

Previous topic - Next topic

Joe

Hello all AGS users.

On my last post I said that i wanted to add to my game an interface command which displayes Use...with, Give...to, etc.

Well, I finally got it; but now i want to know if i can use the command "Talk to" or "Give to" only for characters. Because if I click on the buttom "TALK TO" and I move the mose over a tree it appears "Talk to tree" :P... And it is quite stupid...

So if there is a way to use a code which makes the name appear onle when the mouse moves over a character, please let me know.

Thanks. ;)
Copinstar © Oficial Site

Ashen

#1
How are you handling the displaying? Have you done it something like I suggested in this thread?
If so, you can add a check of GetLocationType, so it only updates over characters, e.g. (untested, and assumes you're using the status String):
Code: ags

if (mouse.Mode == eModeTalkto) {
  if (GetLocatonType(mouse.x, mouse.y) == eLocationCharacter)
    status = "Talk to @overhotspot@";
  else
    status = "Talk to";
}


Will display Talk to (NAME) if you're over a character, or just Talk to otherwise (you could set it to be blank, if you'd rather).

If you're doing it a different way, someting similar would probably still work.
I know what you're thinking ... Don't think that.

Joe

Thanks Ashen, It works perfectly.
My dreams have been reached. :P ;)
Copinstar © Oficial Site

SMF spam blocked by CleanTalk