Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Declaring War on Transitions

I've got everything working in hi or lo res with the single exception of transitions.  And I'm working past that one.

I'm not the only one who wants a transition class rewrite.  Without taking apart the encrypted DLL, though... I don't really see it happening.

So here's my plan.

The basics of transitions is this: load an image to use as the transition (doesn't have to be greyscale).  Scan the pixels of it, and, starting with a luminosity of 0 (black), add these pixels to the transparency map of the image.  Increase the luminosity to 3.  Add these pixels to the map.  Then raise it to 5.  Rinse, repeat until you hit 255 luminosity (white).

Unfortunately, Ruby doesn't appear to have native get_pixel functionality.  So we're going to have to outsource this.
I plan to use the freeware library netpbm to convert the image to pnm format- scan and make the adjustments, then pass it through to RMXP, which will in turn display the image, immediately dispose it, and display the next image.

As a base image, we can take and display a screenshot, then begin to use our loaded and changing "transparency map" to perform the transition.

Right now I'm learning to call DLLs from RMXP.  I am a low-level scripter, but have a nack for figuring things out.  Once I get past this, within a week I should have a functional (although laggy, still functional) transition rewrite.

What I'm looking for is support, assistance, ideas, anything that anyone wants to offer, that might be of use in this quest.
 
Hummmm... I don't know how exactly f0tz!baerchen (sorry if I've make a mistake with your name, guy :pissed:) Pixelmovement Script works, but it has an interesting option that maybe can help to carry out your idea:
*drumroll* ... ... ... tadaaaaa Pixel-based passability tilesets
I think that, in order to make this option to work, f0tz! used a kind of get_pixel method.

regards
 
The bitmap class has a get_pixel and set_pixel methods. But using this to scan and modify a bitmap can be time consuming and you can expect a script hangup. I don't recommend using that on large pictures.
 
Can you alias a hidden class?  I'd like to try something like:


class Transition
  alias zzhacktrans initialize
  def initialize
      zzhacktrans
      self.viewport = viewport.new(800,600)
  end
end

Okay, so that code is wayyy off and finding actual methods and variables will be a bit of shooting in the dark...
But the question itself, is just can you alias into an existing hidden method?
 
Yes, you can alias hidden classes. I often do that :)
Also, transition is a part of the Graphics module. So if you're planning to alias the transition method, you should do it like that:
Code:
module Graphics
  class << self
    alias new_transition transition
    def transition(duration=8,file=nil,vague=40)
      new_transition
      # your code here
    end
  end
end
Also, here's the part on Graphics.transition in the Help file:
Graphics.transition([duration[, filename[, vague]]])
Carries out a transition from the screen fixed in Graphics.freeze to the current screen.

duration is the number of frames the transition will last. When omitted, this value is set to 8.

filename specifies the transition graphic file name. When not specified, a standard fade will be used. Also automatically searches files included in RGSS-RTP and encrypted archives. File extensions may be omitted.

vague sets the ambiguity of the borderline between the graphic's starting and ending points. The larger the value, the greater the ambiguity. When omitted, this value is set to 40.

Hope it helps!
-Dargor
 
Is there any kind of a debug or trace engine for RMXP?  So I know how to access and even alias the class (thanks dargor, that helps a lot).  I'm assuming that a simple fix would be to find what viewport it's calling and change it's dimensions.

I don't know if self.viewport would be a valid argument.  I don't think so...  I'll post the result of my experimentation in a bit.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top