Are there any Earthquake Scripts?

Started by Heretic86, February 18, 2014, 06:38:00 am

Previous topic - Next topic

Heretic86

XP has a screen shake function, but I had to do some tricky eventing to pull off an Earthquake.  Just wondering if there were any scripts out there for it.  Things like Fade In Quake and Fade Out Quake...
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)

G_G


KK20

While we're at it, how about shaking the screen during an animation? I thought that was a feature in other RPG Makers. I have an idea on how to create it, but just wanted to know if someone has heard of something like this already.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Heretic86

February 19, 2014, 07:51:18 am #3 Last Edit: February 19, 2014, 09:11:49 pm by Heretic86
Not during an animation, but that would be interesting.  XP's Animations are quite limited...

(edit)

Here's an idea.  Screen Shake might need to come from a script call in a Common Event, not the animation itself.  The skill itself would call the common event, which can run the script call.  Unfortunately it also means that just running the animation wouldnt cause a Screen Shake to run.  Probably still simpler to do it this way than trying to tie it to Animation ID's in the script itself, probably...
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)

KK20

I was thinking more along the lines of manipulating the Screen Flash function. Set the opacity to 0 and the script now reads it as a Shake Screen command. Red sets the power, Green sets the speed. Set the duration and what frame you want it to pop up on and *boom*.

Also was thinking of ways to move the enemy battler around in much the same way. Take a skill like Piledriver, which sends the enemy up off screen and then crashing back down.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

G_G

That'd be pretty cool KK20. And it could universally effect the screen or the battler sprites.

KK20

I guess I could whip something up in my spare time. I kinda need a script like this anyways. I should also consider making an "application" to create the animation effects easier (probably would get confusing reading flash colors as directions. Plus, you can't really test the animation unless you playtest after every change.)

Glad you think it's a cool idea :)

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

ForeverZer0

Could you not just create an alias method to add a shake to "animation" in RPG::Sprite, with a configuration to determine which animations use screen shake, how long, strength, etc.?
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

KK20

I guess you could, but I would like to be able to change the level of shaking throughout the animation. So if the configuration was something like
[ [frame, power, speed, duration], ...]
it could work that way I think. I'm just not sure if users would prefer that way or not.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

ForeverZer0

It seems to me that it would offer even more flexibility using your own method than using a screen color change. The whole script could literally be two methods, one alias, and another for configuration.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

KK20

Or keep the screen flash and the script would just be one aliased method :P (if you wanna talk numbers)
Poll, anyone? What would you guys prefer?

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Zexion

I think KK20's because it works from the editor with sliders?

KK20

February 21, 2014, 01:27:06 am #12 Last Edit: February 21, 2014, 01:42:01 am by KK20
The basic idea is this:

class RPG::Sprite
   def animation_process_timing(timing, hit)
     if (timing.condition == 0) or
        (timing.condition == 1 and hit == true) or
        (timing.condition == 2 and hit == false)
       if timing.se.name != ""
         se = timing.se
         Audio.se_play("Audio/SE/" + se.name, se.volume, se.pitch)
       end
       case timing.flash_scope
       when 1
         self.flash(timing.flash_color, timing.flash_duration * 2)
       when 2
#=================================================================
         if self.viewport != nil
            if timing.flash_color.alpha != 0
              self.viewport.flash(timing.flash_color, timing.flash_duration * 2)
            else
              $game_screen.start_shake(timing.flash_color.red, timing.flash_color.green, timing.flash_duration * 2)
            end
         end
#=================================================================
       when 3
         self.flash(nil, timing.flash_duration * 2)
       end
     end
   end
end

If I can make an "application" via another RPG Maker project, I can access the Animations.rxdata, translate the movement changes into Screen Flash, and save the file. Otherwise, I'd have to make a textfile output the configuration options that the user would have to copy-paste in their project. Not to mention, I don't know how I'd be able to transfer the current configurations over to this application to interpret.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

ForeverZer0

Very simple script to allow adding a shake to an animation:

Spoiler: ShowHide
module AnimationEx
  #-----------------------------------------------------------------------------
  # * Define screen shakes that will be used during specific animations
  #     animation_id : ID of the animation
  #-----------------------------------------------------------------------------
  def self.shake(animation_id)
    return case animation_id
    # when ANIMATION_ID then [POWER, SPEED, DURATION]
    when 1 then [5, 5, 5]
    when 2 then [10, 10, 10]
    when 3 then [2, 8, 30]
    when 4 then [8, 3, 15]
    when 5 then [10, 2, 40]
    end
  end
end

class RPG::Sprite
 
  alias animation_ex animation
  def animation(animation, hit)
    # Get user-defined data based on the animation being used
    shake = AnimationEx.shake(animation.id)
    # Start screen shake if defined
    if shake != nil
      $game_screen.start_shake(*shake)
    end
    # Execute normal animation
    animation_ex(animation, hit)
  end
end
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

G_G

I don't think you understand what he's trying to accomplish here. He wants to give users more control than that.

I know that he would like the screen to shake at specific frames, not just at the start of the animation and I know he'd also like to allow the shaking to be applied to battler sprites. I think using the slider tools to allow shakes would be cool. Because that window also lets you choose the target. So you can choose the target or the screen and have the shake happen at a certain frame. And allow to only happen if the target has been hit for example, etc..

ForeverZer0

I understand the idea, I was merely showing the idea. A slightly more complicated edit can be done to the actual animation method for timing, and "hit" is passed to the method, so only shaking on hit is a simple check.

As for battler sprites, they are inherit from RPG::Sprite, so that wouldn't affect anything.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

KK20

Quote from: ForeverZer0 on February 22, 2014, 12:11:23 pm
As for battler sprites, they are inherit from RPG::Sprite, so that wouldn't affect anything.

Not sure what you mean.

Anyways, I'll continue with the slider method and see what I can come up with.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Heretic86

I was just looking for something for a full screen shake, but battler sprite shaking is an interesting concept.  Just a quake_fade_in, then maintain that shake until quake_fade_out or quake_stop.
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)

KK20

While thinking about it, Animations could be so much more advanced than what the RMXP editor allows. I've drawn some pictures of what this RMXP application could do. Not only will I include the shake and movement of the enemy sprite, but I can also allow more than 16 sprites, hit/miss conditions to various things, layers (because trying to click sprite #1 is a pain in the ass when everything is on top of it), more than 200 frames, etc.

I'm much too busy at the moment to work on it though. Maybe a summer thing?

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!