Please login or register.

Login with username, password and session length
Advanced search  

News:

Forum rules - please read before posting, it can save you a lot of time.

Author Topic: Horizontal Scrolling  (Read 5467 times)

0 Members and 1 Guest are viewing this topic.

The Man

  • Occasional poster
  • **
  • Karma: 1
  • Offline Offline
  • Posts: 67
    • View Profile
Horizontal Scrolling
« on: July 26, 2012, 06:35:42 PM »

Hi, everybody! I've been experiencing a problem with my last scene. I'll explain briefly!
The scene is a 1000x800 scene. What I wanted to achieve was a scene in which the screen would only scroll horizontally. I created then a 800x600 new scene and changed the scene's dimensions to 1000x600(In the "main" field), thinking this would do the trick.
It didn't.

Now, I don't understand where's the mistake! I followed the WME documentation and the procedure looks right... there must be some detail I misunderstood in the process! Can somebody help me figure it out?
Logged

HelLRaiseR

  • I don't want to make a Monkey Island clone :(
  • Wiki editor
  • Frequent poster
  • ****
  • Karma: 4
  • Offline Offline
  • Posts: 270
    • View Profile
    • Adventure Box Studios
Re: Horizontal Scrolling
« Reply #1 on: July 27, 2012, 01:47:56 PM »

Hmmm! I'm afraid that you have made a mistake. I've tried in my own project and works OK.

- My project has a 1024 x 768 resolution
- My scene has a 1300 x 768 resolution
- I've changed the game resolution in Project Manager / Startup Settings/ Resolution to 800 x 600 (are you changed the resolution here?)
- I've changed the scene resolution in the Layer properties option in SceneEdit to 1300 x 600

And the scene works ok with 800 x 600 resolution, as the scene has 1300 pixels width, the layer scroll horizontally.  As the project and the scene has 600 pixels height, the bitmap has clipped to 600 pixels.

Review the resolution in Project Manager and SceneEdit, becouse don't need other options.

Note that the game resolution is changed in the Project Manager, the scenes can be less, equal or greater than the game resolution, if the size of the scene is greater than the game resolution, WME scrolls the scene when the actor moves through this one.
« Last Edit: July 27, 2012, 01:56:07 PM by HelLRaiseR »
Logged
Regards,

    Fernando

The Man

  • Occasional poster
  • **
  • Karma: 1
  • Offline Offline
  • Posts: 67
    • View Profile
Re: Horizontal Scrolling
« Reply #2 on: July 27, 2012, 02:30:01 PM »

I don't know, everything is set as you said(I almost rhymed, here!)
Project has a 800x600 resolution and scene has a 1000x600 resolution, but still the scene doesn't scroll.... I don't know, couldn't I write a script that forces the game to follow the actor in this particular scene? And if so, how should it looks like?
Logged

HelLRaiseR

  • I don't want to make a Monkey Island clone :(
  • Wiki editor
  • Frequent poster
  • ****
  • Karma: 4
  • Offline Offline
  • Posts: 270
    • View Profile
    • Adventure Box Studios
Re: Horizontal Scrolling
« Reply #3 on: July 27, 2012, 03:43:27 PM »

I don't know, I can't think of anything, only stupids questions, but... here are:

- Do you have defined a floor region with the suficient size to permit to the actor go to the position of the scene when WME made the scroll?

- Try this:
   in scene_init write this code.

   actor.SkipTo(900, 400); This position is outside the screen
   Scene.ScrollTo(actor); This force to scroll the scene to actor position.

   If this works, there isn't any problem with the scene.

I don't know what's the problem, becouse WME  should scroll the scene automatically.
Logged
Regards,

    Fernando

The Man

  • Occasional poster
  • **
  • Karma: 1
  • Offline Offline
  • Posts: 67
    • View Profile
Re: Horizontal Scrolling
« Reply #4 on: July 27, 2012, 04:08:01 PM »

I tried that, and the scene initially scrolls to reach the actor's position. But then when I walk toward the left of the screen the scene doesn't scroll anymore!

I'd need a script that tells the game to CONTINUOSLY check the actor's position and scroll the scene properly. I would attach this script to the scene and the trick would be done... problem is, I'm not such a good programmer... I'm more into graphic and animation...
Logged

The Man

  • Occasional poster
  • **
  • Karma: 1
  • Offline Offline
  • Posts: 67
    • View Profile
Re: Horizontal Scrolling
« Reply #5 on: July 27, 2012, 04:16:32 PM »

Ok, I managed to make it!
I wrote a simple code similar to scene.script:

Code: [Select]
#include "scripts\base.inc"

////////////////////////////////////////////////////////////////////////////////
on "LeftClick"
{
  Scene.ScrollToAsync(Game.MouseX, Game.MouseY);
  actor.GoTo(Scene.MouseX, Scene.MouseY);
 
}

And I attached it to the scene. Now the scene scrolls depending on the point in which the player clicks. It's even better than the normal scrolling system!
Anyway, Hellraiser, thank you very much for your patience!
« Last Edit: July 27, 2012, 04:22:59 PM by The Man »
Logged

Spellbreaker

  • Supporter
  • Frequent poster
  • *
  • Karma: 4
  • Offline Offline
  • Gender: Male
  • Posts: 376
    • View Profile
    • Apeiron Studios
Re: Horizontal Scrolling
« Reply #6 on: July 27, 2012, 05:25:09 PM »

I'd guess you simply forgot to set Game.MainObject :

From Demo Project:
Code: [Select]
actor = Game.LoadActor("actors\molly\molly.actor");
Game.MainObject = actor;

Then the Games scrolls using molly.

I personally for RotT only use event based scrolling. Means: I created two regions, like two lines going from top to bottom of the screen, and when the player walks over that line, the whole screen scrolls to the Scenes end. I personally don't like it when the game scrolls all the time, it looks kinda nervous  to me.

Greets,

Spellbreaker
Logged

HelLRaiseR

  • I don't want to make a Monkey Island clone :(
  • Wiki editor
  • Frequent poster
  • ****
  • Karma: 4
  • Offline Offline
  • Posts: 270
    • View Profile
    • Adventure Box Studios
Re: Horizontal Scrolling
« Reply #7 on: July 27, 2012, 05:38:55 PM »

Anyway, Hellraiser, thank you very much for your patience!

 ::thumbup
Logged
Regards,

    Fernando
 

Page created in 0.019 seconds with 20 queries.