Please login or register.

Login with username, password and session length
Advanced search  

News:

This forum provides RSS feed. To query recent posts use this url. More...


Author Topic: Actor does not turn to "new" direction when talking to "old" direction skipped  (Read 8513 times)

0 Members and 1 Guest are viewing this topic.

HCDaniel

  • Regular poster
  • ***
  • Karma: 8
  • Offline Offline
  • Posts: 168
    • View Profile

Hi,

I think I have found a bug in WME. I can reproduce this with the scene tutorial, step 8, by replacing the original code from desk.script in the following way:

on "LeftClick"
{
  // just walk to the desk
  // actor.GoTo(544, 638);
  actor.GoTo(397, 650);
  // actor.TurnTo(DI_UPRIGHT);
  actor.TurnTo(DI_UP);
}

Now the position of the actor is the same when the chair and the desk are being examined, and the direction the actor has to turn to is similar.

In that case, the actor does not turn from e.g. the chair to the desk (and vice versa) when one item is examined and while the actor is talking, the second item is examined (the actor will turn AFTER the text has been spoken). You have to be rather quick, but this probably depends on the length of the text to talk.

I took a look at the sources and maybe the problem boils down to the code in

void CAdActor::TurnTo(TDirection dir)

where the variable "m_TargetDir" is not set when "abs(delta) < 2" (which is probably not correct as there will be a mismatch between "m_AfterWalkDir" and "m_TargetDir"). But this is just a guess.

Can you reproduce this?
Logged

HCDaniel

  • Regular poster
  • ***
  • Karma: 8
  • Offline Offline
  • Posts: 168
    • View Profile

I experimented a bit and found that changing the code in

void CAdActor::TurnTo(TDirection dir)

to this:

   // already there?
   if(abs(delta) < 2)
   {
      m_Dir = dir;
      m_TargetDir = dir;
      m_State = m_NextState;
      m_NextState = STATE_READY;
      m_TempSprite2 = NULL;
      return;
   }

solved the problem for me. Although I have no idea what "m_TempSprite2" actually does ;)

Any chance that this will be incorporated into the next WME release?
Logged
 

Page created in 0.031 seconds with 18 queries.