ACTOR
{
NAME = "sally"
CAPTION="Sally"
SCALABLE = TRUE
INTERACTIVE = TRUE
X = 460
Y = 400
SCRIPT="actors\sally\sally.script"
global molly;
global sally;
// load our main actor
actor = Game.LoadActor("actors\molly\molly.actor");
Game.MainObject = actor;
// load our main actor
molly = Game.LoadActor("actors\molly\molly.actor");
sally = Game.LoadActor("actors\sally\sally.actor");
actor = molly;
Game.MainObject = actor;
#include "scripts\base.inc"
// here comes the stuff which initializes the scene
actor.SkipTo(206, 582);
actor.Direction = DI_RIGHT;
actor.Active = true;
sally.SkipTo(288, 575);
sally.Direction = DI_RIGHT;
sally.Active = true;
// load our main actor
actor = Game.LoadActor("actors\molly\molly.actor");
Game.MainObject = actor;
Regions must have at least three vertices.
is just commands executed in sequence with the user having no control. What I mean is that you can simply code your cut-scene any way you want
OK, when we tested the scene, it didn’t scroll, right? Let’s fix it.And make sure you follow the rules of scrolling, which is setting the main layer dimensions to be larger than the game's resolution.
About the scrolling, I don't know how much you have learned so far. I haven't used scrolling in my game. I suggest that you take a look at the basics if you are not certain:
http://docs.dead-code.org/wme/inside_scenes_step1.html
And make sure you follow the rules of scrolling, which is setting the main layer dimensions to be larger than the game's resolution.
Apart from that, in order for the actor to move beyond the edge and for scrolling to start, you have to extend your floor region to the whole scene. Furthermore, you can force the scene to scroll by using Scene.ScrollTo() or Scene.SkipTo().
ScrollTo(X, Y)
ScrollTo(Object)
ScrollToAsync(X, Y)
ScrollToAsync(Object)
Scrolls the scene to the given point / object.
Parameters
X
X coordinate of the target scroll position
Y
Y coordinate of the target scroll position
Object
An object (actor/entity) to be used as a new target scroll position
Remarks
The Scene.AutoScroll attribute must be set to true for this method to work. ScrollTo method blocks the script execution until the scrolling is over, while the ScrollToAsync method returns immediately.
Furthermore, you can force the scene to scroll by using Scene.ScrollTo() or Scene.SkipTo().
Scene.Autoscroll: Specifies whether scene automatically scrolls to the Game.MainObject
MainObject: The object which is used for the scene's auto scrolling, can be (set to) null
As I said above, I am working blindly, but from what I read in the documentation, the behaviour you observe does make sense, so I think this will work.
ScrollSpeedX: Horizontal scrolling speed (in milliseconds, default=10)
ScrollSpeedY: Vertical scrolling speed (in milliseconds, default=10)
ScrollPixelsX: Horizontal scrolling shift (in pixels, default=1)
ScrollPixelsY: Vertical scrolling shift (in pixels, default=1)
OffsetX: Current horizontal scrolling offset of the scene
OffsetY: Current vertical scrolling offset of the scene
You can play with these to get what you want.
19:10: Runtime error. Script 'scenes\Room\scr\scene_init.script', line 73
19:10: Call to undefined method 'ScrollSpeedX'. Ignored.
What goes around comes around. This forum helped me a lot in my game, so I am simply returning the kindness I received. Kindness breeds kindness, I am sure you will do the same some day.
Scene.ScrollSpeedX is an attribute, not a method. You get the error because you try to use it as a method
a correct use would be:Code: WME Script
What if we offer scene auto-scrolling as a tutorial for WME Knowledge base? I think this feature is quite frequent for adventure games. What do you think?
That sounds like a wonderful idea! I am afraid you will have to do it on your own though since I don't have enough time to contribute.
Hey anarchist! The tutorial based on your advice is now available in "How-to" articles in Knowledge Base. You can find it here http://res.dead-code.org/doku.php/kbase:how_to_make_scene_auto-scrolling_in_wintermute_engine (http://res.dead-code.org/doku.php/kbase:how_to_make_scene_auto-scrolling_in_wintermute_engine).Great article! :)
Great article! :)