RMMV JavaScript Unofficial Bugfix Snippets

orcomarcio

Veteran
Veteran
Joined
Nov 26, 2015
Messages
106
Reaction score
20
First Language
Italian
I found a bug where if you play a video the event doesn't wait for it to end to continue his instructions. This is due to the fact that the code checks if a video is playing after launching it to know if it ended, but the video takes up a few cicles to start so the code thinks it finished playing the cicle after it was launched.


Here is the link to my fix wait for video end fix


Also i put it in the master plugin list but if this will be fixed in the source code i guess it should be deleted, let me know
 

DK

Veteran
Veteran
Joined
Mar 30, 2016
Messages
194
Reaction score
244
First Language
Russian
Primarily Uses
RMMV
Code:
/**
* Changes the color tone of the entire bitmap.
*
* @method adjustTone
* @param {Number} r The red strength in the range (-255, 255)
* @param {Number} g The green strength in the range (-255, 255)
* @param {Number} b The blue strength in the range (-255, 255)
*/
Bitmap.prototype.adjustTone = function(r, g, b) {
    if ((r || g || b) && this.width > 0 && this.height > 0) {
        var context = this._context;
        var imageData = context.getImageData(0, 0, this.width, this.height);
        var pixels = imageData.data;
        for (var i = 0; i < pixels.length; i += 4) {
            pixels[i + 0] += r;
            pixels[i + 1] += g;
            pixels[i + 2] += b;
        }
        context.putImageData(imageData, 0, 0);
        this._setDirty();
    }
};

The function will not work if r, g, b are equal to 0

How can I restore a normal tone?
 
Last edited:

Hackateck

Villager
Member
Joined
Aug 14, 2018
Messages
28
Reaction score
3
First Language
English
Primarily Uses
RMMV
To those who use Mog_TimeSystem with Mog_TimeSystem_HUD plugin and want to display 01:00 pm instead of 13:00
maybe this code i add will help you.
open your Mog_TimeSystem_Hud.js and search the "SpriteTimeEngine.prototype.refresh_timer"
copy this code then replace it.

Code:
SpriteTimeEngine.prototype.refresh_timer = function() {
var x = this.width - 130;
var y = 26;
var pmTime = "PM";
var amTime = "AM";
this._timer_old = $gameSystem.minute();
this._timer.bitmap.clear();
var text = $gameSystem.hour_pm().padZero(2) + ":" + $gameSystem.minute().padZero(2)
this._timer.bitmap.drawText(text,0,0,120,32,"center")
if ($gameSystem.hour()>=12 )
this._timer.bitmap.drawText(pmTime,0,0,107,32,"right")
else{
this._timer.bitmap.drawText(amTime,0,0,107,32,"right")
}
};
hope it help guys,
credits: Moghunter
for a wonderful script.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

My pumpkin! Anyone like Fallout?

It's not terrible, but could be better. This thing took me over an hour to carve. :kaophew:

Dad's watching a WWII documentary while I work on some cool assets for my games. I just love RPG Maker!
Also Happy Halloween! Dad's friend won't be coming unfortunately, but Dad will still be taking me to Boxi Park to have some fun tonight! I'll be posting a video on my YouTube channel of the show, and I'll be sure to post a link here.
"Nightmares exist outside of logic and there's little fun to be had in explanations. They're antithetical to the poetry of fear. In a horror story the victim keeps asking why, but there can be no explanation and there shouldn't be one..." - Stephen King
I feel people seek explanation and demand it sometimes in games, but in the horror genre, well, maybe you shouldn't have one. Silent Hill 1 comes to mind...
Managed to implement QSprite.

Always double check your plugin order.


Finally! I've been puzzling over why it wasn't working for two days now. Turns out all of my calculations were correct, I just forgot to give some events hitboxes. :kaoswt: Now my randomly generated maps check for collision errors, and move stuff around in real time if they finds any. :LZSexcite:

Forum statistics

Threads
104,682
Messages
1,008,067
Members
136,171
Latest member
emcautley1
Top