Moving Ego Head

Started by Tiki, Fri 07/05/2004 20:20:22

Previous topic - Next topic

Tiki

Is there anyway to make the ego's head follow the cursor while he's idle?  I suppose I could use regions, but that could get very complicated.  Are there any easier ways to do this?  Are there any at all?

Ashen

#1
Something like:
if (character[EGO].view == IDLE-1) {
Ã,  FaceLocation (EGO, mouse.x, mouse.y);
}

in the repeatedly execute might do it, but I'm not sure if turning EGO would take him out of idle. If it does:

if ((character[EGO].walking == 0) && (character[EGO].animating == 0)) {
Ã,  FaceLocation (EGO, mouse.x, mouse.y);
}

might be better. Not had time to test these, but hope they help.
I know what you're thinking ... Don't think that.

Pumaman

Yep, Ashen's suggestion looks good. I'd modify it slightly to cope with scrolling rooms:

if ((character[EGO].walking == 0) && (character[EGO].animating == 0)) {
  FaceLocation (EGO, mouse.x + GetViewportX(), mouse.y + GetViewportY());
}

Hollister Man

On the note of problems with it, maybe TikiTikiman wanted something to make him look up, diag, straight, down, at the camera, etc.  I think it could be done in the global script, by cutting the virtual screen into a grid of, lets say, nine squares.  When its directly over his head, he'll look up, etc.  Couldn't code it without the editor here, though. :)
That's like looking through a microscope at a bacterial culture and seeing a THOUSAND DANCING HAMSTERS!

Your whole planet is gonna blow up!  Your whole DAMN planet...

Ashen

What if you create a view that includes diagonals, where only the face/head moves, then use:

if ((character[EGO].walking == 0) && (character[EGO].animating == 0)) {
  SetCharacterView (EGO, FACEVIEW);
  FaceLocation (EGO, mouse.x + GetViewportX(), mouse.y + GetViewportY());
}
else ReleaseCharacterView(EGO);

would that work? Or at least something like it.
I know what you're thinking ... Don't think that.

Tiki

Thanks for the help.  Personally, I like Hollister Man's idea, but I might as well try the others before I get to crazy with the square grids.  Thanks again.

SMF spam blocked by CleanTalk