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.

Map Enhancement script request! (Please read, it is awesome!)

Kraft

Sponsor

I had an awesome Idea for a script that would bring stunning realism to events!

Basically, I would like charactersets that have their animations fade from frame frame (crossfade, not fade out, fade in).

My example (what gave me the idea) was those sparkles in the RTP. I think they look cool on the water, when they are changing, it looks like sparkles.

Only thing it, it only has 4 frames... so when you are watching it, it is like, Blip, blip, blip, blip, and then back again. Like watching a repeating avatar or something.

What I would like is a script that makes every event with a certain comment or script call or something in them, fade the current frame into the next with a settable frame rate of fade in between. (in the comment or script in the event)
So if there are 10 frames of fade, it will take 10 frames of crossfading to fade from one to another.

This script would have tons of uses, for glowing objects, for lanterns, slices of pizza, you know, tons!

And it would be a great thing for enhancing maps.

And it is so simple!

Thanks for reading this, please dont just skip over it like all of my other requests!

Kraft
 
After hours of searching (ok a few seconds...)

Insert this below Game_Character
Code:
class Game_Character
  attr_accessor :anime_reset
  alias_method :seph_animereset_gmchr_init, :initialize
  def initialize
    @frame_reset = 18
    seph_animereset_gmchr_init
  end
end

Go into Game_Character 2 under def update

Replace the line below:
Code:
    if @anime_count > 18 - @move_speed * 2
# to
    if @anime_count > @frame_reset - @move_speed * 2

Then you can do things like

Code:
$game_map.events[event_id].anime_reset = n
$game_player.anime_reset = n
 

Kraft

Sponsor

Hmm... how do I get this to work?
I tried like 10 different things, but nothing seems to work...

I am not a very good scripter, so I wouldnt know how to fix it...

Thanks!
 
If you want to test it, just chance the @frame_reset = 18 to 6 or something.

But you might want to change the entire line instead.

Whenever you step, the @step_anime increases by 1.5 (1 if you are stopping).

Once this number is greater than your frame reset variable - your move speed * 2, it increases the pattern by 1.

I will do a quick something to read event comment lines. Give me a second...

Insert below Game_Event
Code:
class Game_Event < Game_Character
  alias_method :seph_framereset_gmevt_refresh, :refresh
  def refresh
    seph_framereset_gmevt_refresh
    unless @list.nil?
      for event_command in @list
        if event_command.code == 108
          if event_command.parameters[0].upcase.include?('FRAME RESET')
            event_command.parameters[0].dup.gsub!(/\((.+?)\)/) do
              @frame_reset = $1.to_i
            end          
          end
        end
      end
    end
  end
end

Now just use

Code:
Comment :frame reset (n)

It isn't case sensitive.
 

Kraft

Sponsor

*sigh*
I am really sorry, but I have no idea how to get this working.
I suck at scripting, and I am not sure what to do...

I made a new script slot under game_event, and copied that script thing into it, and then in the event that I want fading frames into each other I put the comment with the frame rate thing of (20).

The event that I want to fade is the RTP sparkles (194-support-001) and this event does not move at all. (move as in walking from place to place) but it has the Stop animation enabled, so that it changes frames as it is sitting there.
I would like them to fade the frames into each other, giving it a smooth transition, rather than a blip, blip changing picture one.

Please tell me what I must do to get this thing to work, I am still in the dark...

Thank you so much for putting up with my lousy scripting ability!

Thanks!

Kraft
 

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