Jibble

Author Topic: MODULE: Smooth Scrolling & Parallax v1.7.1  (Read 64234 times)

Re: MODULE: Smooth Scrolling & Parallax v1.7.1
« Reply #180 on: 24 Mar 2019, 17:31 »
Hi Ali! I'm porting (Chicky's) Guard Duty to Linux and Mac, and I noticed that I cannot seem to get targetCharacter to work in Linux. The exact same code works fine in Mac and Windows, but for some reason Linux seems to be completely ignoring targetCharacter?

Curiously, we have reported Linux-related bug many years ago: https://www.adventuregamestudio.co.uk/forums/index.php?topic=33142.msg636472912#msg636472912
but it was supposed to be fixed.

Try searching for "eOSLinux" in the script.

On the other hand, this may be a new engine's bug too.


Ali

  • What will become of the baron?
    • Ali worked on one or more games that won an AGS Award!
    •  
    • Ali worked on one or more games that was nominated for an AGS Award!
Re: MODULE: Smooth Scrolling & Parallax v1.7.1
« Reply #181 on: 24 Mar 2019, 17:41 »
Yes, originally the module would cause a fatal crash on Linux, so it was disabled by default. But, as you can see, that line is now commented out. Frankly I have no idea what the problem is. The module doesn't do anything fancy in terms of scrolling. It just decides where to setviewport based on the co-ordinates of a particular character. So I can't see why that wouldn't work on Linux.

I'm afraid I don't have a Linux OS here to test it on. But I would try to narrow down the cause of the problem. Does setting *targetCharacter in the script succeed (i.e. the pointer is changed to cCharacter2, but the screen doesn't move)? Or does it fail for some reason and the pointer stays set to cCharacter1?

For instance, if you modify game_start in the module to:

Code: Adventure Game Studio
  1. function game_start(){
  2.   if (cEgo.Room == TEST ROOM)  targetCharacter = cCharacter2;
  3.   else targetCharacter = player;
  4.  
  5.   system.vsync=true;
  6. }
  7. (Pseudocode)
  8.  

And run the room, does it follow the other character instead?

Re: MODULE: Smooth Scrolling & Parallax v1.7.1
« Reply #182 on: 24 Mar 2019, 22:21 »
Pretty embarrassing that I didn't catch the     if (System.OperatingSystem != eOSLinux) line in the script XD
This must have been an old script that somehow didn't get updated to the commented version? I don't know how it happened, but nonetheless .. it's now commented out :D

Thank you - I've commented out the line and its matching closing brace, and will recompile with both. I'll update this thread when I see the outcome.
« Last Edit: 24 Mar 2019, 22:23 by vga256 »

Re: MODULE: Smooth Scrolling & Parallax v1.7.1
« Reply #183 on: 25 Mar 2019, 00:34 »
Recompiled and it's running perfectly in Linux now. Thanks again! :D

Monsieur OUXX

  • Mittens Vassal
  • Cavefish
  • Mittens Half Initiate
    • I can help with proof reading
    • I can help with translating
    • I can help with voice acting
    • Monsieur OUXX worked on one or more games that won an AGS Award!
    •  
    • Monsieur OUXX worked on one or more games that was nominated for an AGS Award!
Re: MODULE: Smooth Scrolling & Parallax v1.7.1
« Reply #184 on: 03 Feb 2020, 14:21 »
If you're planning on using this module, then also consider using the module "Rellax" ( https://www.adventuregamestudio.co.uk/forums/index.php?topic=57489.msg636611474#msg636611474 )
 

Re: MODULE: Smooth Scrolling & Parallax v1.7.1
« Reply #185 on: 27 May 2020, 15:06 »
Does anyone know how to install this module on the 3.5 AGS engine? The new changes have me a bit confused.

Ali

  • What will become of the baron?
    • Ali worked on one or more games that won an AGS Award!
    •  
    • Ali worked on one or more games that was nominated for an AGS Award!
Re: MODULE: Smooth Scrolling & Parallax v1.7.1
« Reply #186 on: 27 May 2020, 15:18 »
Sorry, I haven't used 3.5 at all yet. Maybe try Rellax, which seems more up to date?

Re: MODULE: Smooth Scrolling & Parallax v1.7.1
« Reply #187 on: 27 May 2020, 16:25 »
Does anyone know how to install this module on the 3.5 AGS engine? The new changes have me a bit confused.

In General Settings set "Script compatibility level" to 3.4.1.

Re: MODULE: Smooth Scrolling & Parallax v1.7.1
« Reply #188 on: 27 May 2020, 17:44 »
Sorry, I haven't used 3.5 at all yet. Maybe try Rellax, which seems more up to date?
Well, I wanted to use this module as I'm working on a MAGS project and wanted to have something I was familiar with when working on a time limit, but I might try it out on my next project. Still, it would be interesting to see what you could do with this module for the latest version if you find the time for it.
Does anyone know how to install this module on the 3.5 AGS engine? The new changes have me a bit confused.

In General Settings set "Script compatibility level" to 3.4.1.
Thanks, I tried that and it seems to work!

Re: MODULE: Smooth Scrolling & Parallax v1.7.1
« Reply #189 on: 01 Aug 2020, 13:13 »
Hi Ali, I'm having a bit of a problem with this module. Is it ok to post here (might be helpful in case anybody else has the same issue?), or should I PM you?

Ali

  • What will become of the baron?
    • Ali worked on one or more games that won an AGS Award!
    •  
    • Ali worked on one or more games that was nominated for an AGS Award!
Re: MODULE: Smooth Scrolling & Parallax v1.7.1
« Reply #190 on: 01 Aug 2020, 13:49 »
Yes, you can post it here for exactly that reason. The module is a little out-of-date now, but I'll help if I can.

Re: MODULE: Smooth Scrolling & Parallax v1.7.1
« Reply #191 on: 01 Aug 2020, 14:16 »
Thank you!

The issue I'm having is that I want to activate smooth scrolling for only one room, but when I put SmoothScroll_ScrollingOn(); in my room_Load(), the viewport gets stuck to the top left corner and doesn't move from there.

My game's resolution is 320x200, and this room is 480x300. I'm using AGS 3.4.3 P1.

In case it helps shed some light, previous to this I have called SmoothScroll_ScrollingOff(); in game_start because I wanted to use the parallax effect for the main menu but not the smooth scroll functionality, because I'm scrolling the viewport with tweens instead.

Thanks again!

Ali

  • What will become of the baron?
    • Ali worked on one or more games that won an AGS Award!
    •  
    • Ali worked on one or more games that was nominated for an AGS Award!
Re: MODULE: Smooth Scrolling & Parallax v1.7.1
« Reply #192 on: 01 Aug 2020, 16:20 »
Is the target character (by default, the player character) in the room? If they are, then I'm not sure. If you want, you could PM me the room and I could have a look. You could also check whether the newer module Rellax works for you: https://www.adventuregamestudio.co.uk/forums/index.php?topic=57489.0

Re: MODULE: Smooth Scrolling & Parallax v1.7.1
« Reply #193 on: 01 Aug 2020, 17:23 »
Well, that's interesting. The player character is indeed in the room, but for some reason it's not being set as the target character. I explicitely set targetCharacter = cTestCharacter; and everything works as it should, with one exception: the viewport "snaps" into place vertically after the room fades in. I thought the character might be too close to the edges, but it's happening regardless of where I start him off. Have you ever had this happen before?

Re: MODULE: Smooth Scrolling & Parallax v1.7.1
« Reply #194 on: 01 Aug 2020, 18:09 »
Managed to fix it, although I have no idea what's going on.

If I use cTestCharacter.SetAsPlayer() in the previous room, I get this weird viewport "snap" after the next room loads. But if I do player.ChangeRoom(51, 348, 217, eDirectionLeft) instead, then everything works fine.

In any case, I definitely need to explicitely set targetCharacter = player. For some reason, the module is not doing it automatically.

In any case, I managed to get it running, so thanks a lot for your help! :)
« Last Edit: 01 Aug 2020, 18:17 by Laura Hunt »

Ali

  • What will become of the baron?
    • Ali worked on one or more games that won an AGS Award!
    •  
    • Ali worked on one or more games that was nominated for an AGS Award!
Re: MODULE: Smooth Scrolling & Parallax v1.7.1
« Reply #195 on: 01 Aug 2020, 19:15 »
I'm not sure why that's happening, but I'm glad you've found a workaround! Sorry I haven't been able to keep this up-to-date.

Ali

  • What will become of the baron?
    • Ali worked on one or more games that won an AGS Award!
    •  
    • Ali worked on one or more games that was nominated for an AGS Award!
Re: MODULE: Smooth Scrolling & Parallax v1.7.1
« Reply #196 on: 04 Aug 2020, 16:38 »
Based on Laura's issue, I'm going to add a couple of known issues which are work-aroundable.

If your character changes view from a tall to a short sprite, the module screen will snap into a new position. This is because it's aiming for the 'head' of the sprite. To get around this, switch targetCharacter to a dummy character (at the same co-ordinates) while you make the transition.

If you're playing as a different character to the player character at game start, and the module has been off, then when you switch it on you the camera will pan from the old character it was following to the current character*. To get around this, set the targetCharacter to the player before calling ChangeRoom, so the camera starts out looking in the right place.

Similarly, if you change a player's X and Y position in room_load, the module will pan from where they used to be to where they are now. If you can, include the desired co-ordinates in the ChangeRoom function. If not, try using a Dummy character who's already in the right place.

*This would be desirable behaviour if you were using it to pan between characters in a cutscene, etc.
« Last Edit: 05 Aug 2020, 21:48 by Ali »

Re: MODULE: Smooth Scrolling & Parallax v1.7.1
« Reply #197 on: 04 Aug 2020, 16:38 »
Edit: Ali and I posted at exactly the same time, but his explanation is so much better than mine, so I'm editing mine out so as not to add any confusion :)

Thanks again Ali for going above and beyond the call of duty!
« Last Edit: 04 Aug 2020, 16:40 by Laura Hunt »

Re: MODULE: Smooth Scrolling & Parallax v1.7.1
« Reply #198 on: 06 Aug 2020, 17:28 »
I had similar problems with Smoothscroll that were connected to changing the player character. I didn't understand what was going on, but simpy using the targetCharacter  = player again seems to have fixed the situation. Feels good that I can remove my own messy fixes!

Thanks Ali, Laura and Crimson Wizard!