What direction is the character facing?

Started by Moox, Sun 25/07/2004 03:58:12

Previous topic - Next topic

Moox

Is there a way tell which direction the character is facing? I have searched the forum, manual and variabls but cant find anything.

rtf

#1
Custom Function Time!Ã,  Ã, :D


function faceback () {
FaceLocation(GetPlayerCharacter(),160,-1000);
}
function facefront () {
FaceLocation(GetPlayerCharacter(),160,1000);
}
function faceleft () {
FaceLocation(GetPlayerCharacter(),-1000,100);
}
function faceright () {
FaceLocation(GetPlayerCharacter(),1000,100);
}

Script Header:

import function faceback ();
import function facefront ();
import function faceright ();
import function faceleft ();



I hope that's what you meant.


EDIT:  Aww, crap.  It wasn't.  Sorry, LT.  Can't help you there.
I fail at art.

Hollister Man

 ;D

Well, its kinda round-about, but it should work.  You should be able to detect which loop the character is using with the character[EGO].loop variable, thus giving you a 'up/down/left/right' direction.  Other than that, it'd be pretty hard, I think.
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...

Moox

Ill try that hollister, thanks.


Thanks for posting even though that wasnt what I was after rtf.

Moox

Whats wrong with this script, nothing happens when I use it

//down
if (character[EGO].loop == 0) {
  SetCharacterView (EGO, 2);
  AnimateCharacter (EGO, 0, 1, 0);
ReleaseCharacterView(EGO);

}
//left
if (character[EGO].loop == 1) {
  SetCharacterView (EGO, 2);
  AnimateCharacter (EGO, 1, 1, 0);
ReleaseCharacterView(EGO);

}
//right
if (character[EGO].loop == 2) {
  SetCharacterView (EGO, 2);
  AnimateCharacter (EGO, 2, 1, 0);
ReleaseCharacterView(EGO);

}
//up
if (character[EGO].loop == 3) {
  SetCharacterView (EGO, 2);
  AnimateCharacter (EGO, 3, 1, 0);
ReleaseCharacterView(EGO);

}

Gilbert

That's because AnimateCharacter() is not a blocking function and you release the views before the animations stopped. You can use AnimationCharacterEx() instead:



//down
if (character[EGO].loop == 0) {
Ã,  SetCharacterView (EGO, 2);
Ã,  AnimateCharacterEx (EGO, 0, 1, 0, 0, 1);
ReleaseCharacterView(EGO);

}
//left
if (character[EGO].loop == 1) {
Ã,  SetCharacterView (EGO, 2);
Ã,  AnimateCharacterEx (EGO, 1, 1, 0, 0, 1);
ReleaseCharacterView(EGO);

}
//right
if (character[EGO].loop == 2) {
Ã,  SetCharacterView (EGO, 2);
Ã,  AnimateCharacter (EGO, 2, 1, 0, 0, 1);
ReleaseCharacterView(EGO);

}
//up
if (character[EGO].loop == 3) {
Ã,  SetCharacterView (EGO, 2);
Ã,  AnimateCharacter (EGO, 3, 1, 0, 0, 1);
ReleaseCharacterView(EGO);

}


rtf

I have a question-  it's kindof off the topic, and a little newb-ish, but I have been curious.

  If animations and movements don't work if you don't add a Wait() or use a blocking function, then why are they there?  Is there some awesome purpose that I should know about?

Thanks
I fail at art.

Scorpiorus

Quote from: releasethefrogs on Mon 26/07/2004 19:18:23If animations and movements don't work if you don't add a Wait() or use a blocking function, then why are they there?
You can, for example, run multiple animations simultaneously:

AnimateCharacter(EGO, ...);
AnimateCharacter(MAN, ...);
AnimateCharacter(BART, ...);
AnimateObject(0, ...);

while (<any of them is animating>) Wait(1);

ReleaseCharacterView(EGO, ...);
ReleaseCharacterView(MAN, ...);
ReleaseCharacterView(BART, ...);


Also without Wait() you can animate things and let the player to control the character at the same time.

SMF spam blocked by CleanTalk