Mnemonic can you detail this futhur with some demo code??
A test picture and test code would be great and I am sure the forum members would like this in their adventures or even the hole adventure made of it.
*hem*
Actually Mnemonic already gave all necessary information to check it out, if he'd write all plugins and game codes himself, he couldn't develop the engine anymore.
(And some "please" might be nice, too...
)
But well ok, I needed something to relax anyway, this is the result of a 20 minutes try-out.
http://wme.jerrot.de/panorama.zip (about 1 MB)
I never played Myst, so I don't know exactly how it should work, but this example is so simple and dirty
that the only code I'm going to publish of it for now is the following short part in the game_daemon.script. Maybe I'll clean it up and publish it in the "Scripts, plugins, utilities, goodies" section when I've got more time (marrying in two weeks...).
I had a little problem with setting the Scene.OffsetX, so basically I decided simply to move the invisible actor on left-click to that position by SkipTo(). [e.g. I changed the scene.script and replaced GoTo by SkipTo and saved the clicked x/y coordinates in two variables, because I need them to calculate the new position - where the engine should scroll to - after a "walk over the borders".]
Ok, and here is the short part how to check the borders:
var i = 0;
while (true)
{
...
// this is only necessary because - for whatever reason - Scene.OffsetX
// is not initialized to its correct value in the first iteration of this loop.
if(i==0) { i = 1; Sleep(100); continue; }
// checking if we reached the left border:
if (Scene.OffsetX == 0)
{
Scene.OffsetX = 2000;
actor.SkipTo(posX+1600, posY);
Sleep(10);
continue;
}
// checking if we reached the right border:
if (Scene.OffsetX == 1600)
{
Scene.OffsetX = 0;
actor.SkipTo(posX-1600, posY);
}
Sleep(10);
}
The values depend on your resolution and the picture size of course. But that's all.
And this is the picture I used (small version). Actually it's too small, but it works anyway as example. You will see, that the first 800 pixels (which is the game width resolution) are exactly the same as the last 800 pixels, everything in between is normal scrolling anyway.
Could you also look up and down??
Yes, the standard WME behaviour remains.
Enjoy.