SetGlobalInt not working

Started by Kinoko, Mon 11/07/2005 12:23:52

Previous topic - Next topic

RickJ

I wonder if the the FaceLocation moves the characters away from each other?  Perhaps try commenting out the FaceLocation() statements to see what happens.

Kinoko

Commenting that out didn't make any difference (I -really- thought that could be it though, good idea!). The only thing that makes a difference still is taking out the condition of GlobalInt 11 from the line that deals with talking to another character.

When I do that, the character faces me, talks to me, but then doesn't turn back and face their original location. If I then walk away though, and and approach her from a different direction, she'll turn to face me again.

RickJ

Ok, but I bet fawnyaret is still toggling on/off.  Put in some more Display() commands like below to see what is actually going on.
Display("before - fawnuaret=%d, GlobalInt=%d",fawnyaret,(GetGlobalInt(11));
if ((fawnyaret == CD_COLLISION) && (GetGlobalInt(11)==0)) {
Display("if - fawnyaret=%d, GlobalInt=%d",fawnyaret,(GetGlobalInt(11));
  FaceCharacter(FAWNYA, EGO);
  SetGlobalInt(11, 1);
  }
else if ((fawnyaret == CD_NO_COLLISION) && (GetGlobalInt(11)==1)) {
Display("else if - fawnuaret=%d, GlobalInt=%d",fawnyaret,(GetGlobalInt(11));
  SetGlobalInt(11, 0);
  cFawnya.FaceLocation(character[FAWNYA].x, character[FAWNYA].y+5, eNoBlock);
  Wait(1);
}
Display("after - fawnyaret=%d, GlobalInt=%d",fawnyaret,(GetGlobalInt(11));

The collission detect may need to have two thresholds so that once a colission is detected then the characters must move further apart (some adjustable distance) to detect that they are no-longer colliding.

SMF spam blocked by CleanTalk