Help Writing Script Call or Plugin to Clear Shake Screen Effect.

Zaen

Find Me on YouTube
Veteran
Joined
Nov 15, 2016
Messages
115
Reaction score
30
First Language
English
Primarily Uses
Essentially, I have the screen shaking, but in order to keep it shaking for the length of time it needs to continue shaking, after 999 frames have passed, I have to redose it with another Shake Screen 999 frames. The thing is, when I finally switch maps, I need it to immediately stop, no matter how many frames of shaking are queued up.. I imagine this can be accomplished with a simple script call, but if not, I want to write a plugin to make it happen.


I found this in rpg_objects.js


Game_Screen.prototype.clear = function() {
    this.clearFade();
    this.clearTone();
    this.clearFlash();
    this.clearShake();
    this.clearZoom();
    this.clearWeather();
    this.clearPictures();
};




I'm assuming that can be used somehow, but what I entered didn't have an effect.


I've set up a JS class I will take but haven't started yet. I'm sure that would help but in the mean time, anyone know how to do this?
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
In a Script event command, just do this:


$gameScreen.clearShake();


You don't need to write a whole script to do it.
 
Last edited by a moderator:

Zaen

Find Me on YouTube
Veteran
Joined
Nov 15, 2016
Messages
115
Reaction score
30
First Language
English
Primarily Uses
Cool, I knew it was something like that. what I put in was 


    this.clearShake();


So... the "this" only works if the function described has already been established?


Either way, thanks. I thought I was on the right track.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,108
Reaction score
13,713
First Language
English
Primarily Uses
RMMV
'this' only works if the command is being run by the class that owns the function.  Script calls are processed by Game_Interpreter, not by Game_Screen.  So you need to know how to refer to the Game_Screen object from within Game_Interpreter.  Thankfully, there are a number of event commands processed by Game_Interpreter that do things with the screen - Shake Screen is one of them :)   It's just a matter of looking up the existing function in Game_Interpreter and seeing how it makes the reference.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,038
Messages
1,018,466
Members
137,821
Latest member
Capterson
Top