Wintermute Engine Forum

General Category => General Discussion => Topic started by: Kusurovic on December 04, 2022, 02:44:41 PM

Title: Actor position
Post by: Kusurovic on December 04, 2022, 02:44:41 PM
Hello everyone!

How do I change the starting position of a player (Molly)?

1. I downloaded version 1.9.1
2. I maked test project
3. I created new scene and import new background image
4. I was edit floor where actor can walk

How can I reposition actor Molly to stand where I want to stand on begin of scene?

Thanks in advance.

Kusurović
Title: Re: Actor position
Post by: Mot on December 04, 2022, 08:35:12 PM
Hello Kusurović  :)

For example:

Code: WME Script
  1. // Molly will be placed at the coordinates 139, 428
  2. actor.SkipTo(139, 428);
  3.  
  4. // And she will be facing downwards and to the right
  5. actor.Direction = DI_DOWNRIGHT;
  6.  

In case you want to see a working example, you will find a demo project within the folder where you installed WME Development Kit. Possibly C:\Program Files (x86)\WME DevKit\projects\wme_demo\wme_demo.wpr

The snippet of code you see above, I got it from said demo - more precisely, from the file scene_init.script, located in the project tree pane under scenes > room > scr.