MODULE: SlideRoom v1.02 - Updated 02 Dec. 2006

Started by monkey0506, Sat 18/11/2006 03:35:13

Previous topic - Next topic

monkey0506

QuoteVersion:     1.02
Date:        01 December 2006, 12:23 P.M. GMT -6:00
Author:      monkey_05_06
Description: Characters and Objects will now be scaled as appropriate.  Thanks
             to joelphilippage for noticing this  issue!  Also  corrected  the
             Object/View issue which v1.01 broke for Objects with  Views  set.

Thanks to joelphilippage I noticed that Characters and Objects weren't properly scaled during sliding. This has been corrected with v1.02, and I also broke the functionality of Objects with Views set working properly, which is now fixed.

Requires AGS v2.72 or higher!

Download v1.02
v1.02 Mirror

QuoteVersion:     1.01
Date:        29 November 2006, 11:40 P.M. GMT -6:00
Author:      monkey_05_06
Description: Addresses bug for Objects with no View set which would crash  the
             editor.

Update to v1.01 to fix an error on my part in thinking that Objects would always have a valid View set.

Via permission from strazer, I've decided to adopt his SlideRoom module and make some updates:

QuoteVersion:     1.00
Date:        17 November 2006, 9:20 P.M. GMT -6:00
Author:      monkey_05_06
Description: Fixes problems with  RawDraw  functions:  when  changing  between
             rooms  of  different  color  depths,  checking  color  depth   of
             characters and objects before merging them  into  the  background
             (when making the Overlays), and fixes bug  in  8-bit  rooms  when
             using RawDrawImageTransparent. Also added AUTOMOVECHARS parameter
             to SlideRoom.ChangeRoom to fix the bug with characters being cut-
             off. Added functions  GetSlidingDirection,  GetSlidingSpeed,  and
             IsSliding.

strazer directed me to post here instead of in the old thread for those who are wondering. ;)

As denoted by the changelog this version addresses all of the addressable issues with the module, which is why I've bumped it up to v1.0.

Also, it's only vaguely mentioned in the changelog, but the module now used 2 large Overlays instead of depending on RawDraw functions. I opted for this method to prevent the necessity of the two rooms to be of the same color depth.

td

Give me some example code of slideroom someone! I need classic slide effect same as Barrow Hill for the RIGHT and LEFT rotate.

p.s. Readme file heven't example.

monkey0506

#2
Well there's only a few functions...only one of which does anything (the rest are just for testing things, such as whether or not a transition is taking place, if so, which direction, etc.)...so I imagined it wouldn't be too hard to figure out.

Note that this module is designed to create a sliding effect between two rooms similar to AGS's autoscrolling feature for large rooms. I have never played Barrow Hill so I'm not sure if this is what you want (my opinion being summed up from the 1.27 minutes I spent (collectively) doing a Google image and Wikipedia article search).

Based on your posts in the thread for the Panorama module though, I imagine what you want is more along those lines. This module is not for creating a 360 degree effect. It is simply for providing a sliding transition between two rooms, mimicking the scrolling effect applied for large rooms.

However, the requested code:

Code: ags
SlideRoom.ChangeRoom(2); // moves the player to room 2, room 2 sliding in from the left of the screen (I believe, possibly the 
   //right side), the X and Y co-ordinates will be internally determined by AGS (i.e., I don't know what co-ordinates he will be placed at, 
   //they will be the same as if you had called player.ChangeRoom without specifying co-ordinates) the speed will be 1 (i.e., the screen 
   //will move 1 pixel per game loop), and any characters at the left edge of the room (appearing partially off-screen) will moved to room 2
SlideRoom.ChangeRoom(2, 160, 100); // moves the player to room 2 at co-ordinates (X,Y) the room sliding in from the left (I believe), 
   //a speed of 1, and any characters appearing partially off-screen (on the left) being moved to room 2
SlideRoom.ChangeRoom(2, 160, 100, eSlideRoom_Left); // moves the player to room 2 at (X,Y), room 2 sliding in from the left, at a speed 
   //of 1, any characters on the left edge being moved to room 2
SlideRoom.ChangeRoom(2, 160, 100, eSlideRoom_Left, 5); // moves to room 2 at (X,Y) from the left, speed 5, characters being moved to 
   //room 2 where appropriate
SlideRoom.ChangeRoom(2, 160, 100, eSlideRoom_Left, 5, false); // moves to room 2 at (X,Y) from the left, speed 5, characters NOT being 
   //moved if on the edge of the screen


Based on the documentation I think the X and Y co-ordinates may be determined differently than I suggested, but I have to go.
Just put one of those lines in the interaction script where you want the change to occur. (Sorry to leave the examples with so little explanation, I really have to go)

td

Thanks Monkey!
This effect such what I represented it. In some cases it is similar "to turn of a head"...

p.s. One detail:
eSlideRoom_FromLeft
instead
eSlideRoom_Left

2p.s. U didn't played in Barrow Hill? Wah! ;)

monkey0506

Glad to hear I was of use. Sorry if the example code was a bit off. I really did have to get off the computer. My step-dad was getting...bothersome. ;D

From the screenshots I viewed and the minimal time I spent looking into it, I didn't figure this would actually achieve the effect you were looking for. However, it's good that you've gotten it worked out.

And no, I never played Barrow Hill. Realistically I don't play a lot of games. It's not necessarily by choice...I love games...but with limited funding, unreliable systems, etc. Life, eh? :=

bradf

Hello there.

Recently I had a dream where I was making an ags game. This game had a feature where the transition to the next room was a scroll, rather than the usual fade out. It was very hard to script (considering I couldn't actually script very well), but needless to say I was very satisfied with the result.

When I woke up I was disappointed, as this new feature was added only in my dream. In reality, my game was an amateurish bundle of stuff. A bundle of stuff without wonderful sliding transitions.

After rethinking my life and the direction it was headed in, I convinced myself that this feature must actually exist in the first place having influenced my dreams in the way it did. Either that or I was inventing new ags functionality in my dreams that didn't exist.

After a fruitless search, I decided to look on this very forum.

That was when I found this thread.

It was several years old, but it had what I was looking for. It seemed almost familiar... Perhaps I had glanced at it once before, back when I was younger, more naive, in the days when room transitions held no interest for me. Maybe then, it
planted the subconscious seed of the sliding room concept in my mind and the idea lay dormant. Until now.

With enthusiasm I clicked upon the link.

The site was down.
My expression changed from enthusiasm to disappointment. Of course. The thread was years old. I cursed myself for my naiveity.

BUT WAIT!

I noticed that the author had put up a mirror.

I seized the glimmer of hope and clicked.

The numbers 404 sent me into the depths of despair.

However, I resolved myself not to give up and decided to ressurrect the thread, even if it killed me!

Or would my dreams forever be damned with transitions to various different rooms, but with a distinct lack of any fancy sliding transition and only that default fade to black effect?




But yes. Please could someone re-upload this module? It would be very helpful. Thank you.

monkey0506

You just so happen to be in luck good sir. The links have been renewed!

bradf

Thank you very much!

I will return in ten years with a complete game that will contain so many sliding transitions that it will change the world. Those that play it will be so profoundly inspired that they will no longer be capable of entering rooms in the same way again. They shall be compelled to slide into any room they move into in real life, regardless of any social reprecussions and the perplexed expressions of those that have not experienced the game in all of its sliding glory.

Having said all that, I have noticed that the scirpt is suited to version 2.72 of AGS, the RawDrawImage function being obsolete.  After attempting to replace it with the new DrawImage function I realized it is likely beyond my current meager scripting ability.

Would it be difficult for a simple cabbage farmer such as myself (this is a blatant LIE, as I have not been near a cabbage since the unspecified cabbage-related incident of '76 and I am unlearnt in the ways of agriculture) to update - is it simply a matter of learning how they work and then replacing the functions, or does the entire script need to be overhauled?
Would it be better to just start using version 2.72?

monkey0506

#8
Although I normally wouldn't recommend it, disabling "Enforce object-based scripting" might be a valid option for you to use..in the mean time. But, I can look into providing a new version that will work with DrawingSurfaces.

Edit: I was actually about ready to release the new version when I realized that nothing was getting merged into the background..at all (meaning all objects and characters are disappearing during the slide). I checked and this seems to be a regression even when disabling object-based scripting. I'm going to continue looking into this (for example checking if 1.02 somehow created a bug in this).

Actually that was my fault on using sprites/backgrounds of different color depths. I'm working on improving the way that the player gets handled if they are only partly on-screen in each room during the transition (i.e., at the edge of the room).

bradf

By disabling Enforce object-based scripting, it works like a charm. However, as you mentioned the player sprite gets cut off if they are moving from the bottom edge of the room to the next room. I can probably get around this by placing an object obscuring the player at the threshold to the next room - to simulate the player passing underneath an arch or doorway.

Although it is just a work-around and i'd have to think of something else for sliding transitions between outdoor areas.

But regardless, this is a very useful module and has made my game feel much more impressive than it actually is! Creating the illusion of a huge interconnected area, rather than many seperate areas (punctuated by fade to black, or other such lesser and inferior (CONTROVERSAL STATEMENT) transitions) will hopefully make the game feel more open.

SMF spam blocked by CleanTalk