Please login or register.

Login with username, password and session length
Advanced search  

News:

IRC channel - server: waelisch.de  channel: #wme (read more)

Author Topic: TurnTo(object) problem  (Read 1444 times)

0 Members and 1 Guest are viewing this topic.

Dionysius

  • Frequent poster
  • ****
  • Karma: 3
  • Offline Offline
  • Gender: Male
  • Posts: 361
    • View Profile
    • On the Tracks of Dinosaurs
TurnTo(object) problem
« on: February 15, 2008, 07:12:48 AM »

How to TurnTo(object) method works?  I use this code for scene objects (region entities):
Code: [Select]
#include "scripts\base.inc"

on "LeftClick"
{
  actor.TurnTo(this);
  actor.Talk("blah-blah");
}
Sometimes I don't like how the actor is turned. How TurnTo() method calculates the direction?
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5679
    • View Profile
    • Dead:Code Site
Re: TurnTo(object) problem
« Reply #1 on: February 15, 2008, 08:21:32 AM »

It uses the base point of the entity (i.e. its X and Y coordinates you can see in SceneEdit).
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: TurnTo(object) problem
« Reply #2 on: February 15, 2008, 08:46:40 AM »

I sometimes use this trick (especially when I need to force 3d running/flying actor to turn correctly to any direction I need):

Code: [Select]
on "LeftClick"
{
   var dummy = Scene.CreateEntity();
   dummy.X = 100;
   dummy.Y = 100;

   someactor.TurnTo(dummy);
   Scene.DeleteEntity(dummy);

}

:)
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet
 

Page created in 0.133 seconds with 23 queries.