public

Rpg Maker Developers Group

Simple enough for a child, powerful enough for a developer

2 Followers

"Strobing" message boxes?

BMM Archive · July 15, 2026

Preserved forum archive. This topic stores the original first post and locally mirrored RPG Maker Web attachments when available. It is posted by the BMMPlay archive account, not by the original creator.

Original Source

  • Original title: "Strobing" message boxes?
  • Original author: Firgof
  • Original date: October 27, 2015
  • Source thread: https://forums.rpgmakerweb.com/threads/strobing-message-boxes.47761/
  • Source forum path: Game Development Engines > RPG Maker Javascript Plugins > Learning Javascript

Summary

I'm working on an overlay script which produces a sort of strange CRT/LED hybrid effect and though messages display fine on the main menu the moment I go into a Map it starts flickering madly. Additionally, I can't get the overlay to stay persistent between Scenes - it gets really glitchy behavior when I enter and exit menus.  I'm at a total loss as to why the flickering is occurring or how to prevent/fix my plugin. A demo of the script in action, including encountered issues: (You may want to...

Archived First Post

I'm working on an overlay script which produces a sort of strange CRT/LED hybrid effect and though messages display fine on the main menu the moment I go into a Map it starts flickering madly.

Additionally, I can't get the overlay to stay persistent between Scenes - it gets really glitchy behavior when I enter and exit menus.  I'm at a total loss as to why the flickering is occurring or how to prevent/fix my plugin.

A demo of the script in action, including encountered issues: (You may want to hit F4 to be able to see the message boxes on the bottom and top of the screen)

http://firgof.itch.io/dim-resequence?secret=hFGGozCjamVQyQMMgg7s5pd9Ppo

The plugin code itself:

Code:
//=============================================================================// FirgofCRTMode.js//=============================================================================/*: * @plugindesc Creates a CRT-like overlay effect. * @author James "Firgof" Woodall and ocean pollen * * @help To be filled. */function rgb2hex(r,g, {    if (g !== undefined)         return Number(0x1000000 + r*0x10000 + g*0x100 + .toString(16).substring(1);    else         return Number(0x1000000 + r[0]*0x10000 + r[1]*0x100 + r[2]).toString(16).substring(1);}  function getRandomArbitrary(min, max){	return Math.random() * (max - min) + min;};(function() {  function prepend(obj, name, func) {    var orig = obj.prototype[name]    obj.prototype[name] = function() {      func.call(this)      orig.call(this)    }  }  function extend(obj, name, func) {    var orig = obj.prototype[name]    obj.prototype[name] = function() {      orig.call(this)      func.call(this)    }  }	var firstTime = 1;	var minTimeAchieved = 0;		$crt_overlay1 = new Sprite_Base();	$crt_overlay2 = new Sprite_Base();	$crt_overlay3 = new Sprite_Base();	$crt_overlay4 = new Sprite_Base();	$crt_overlay4b = new Sprite_Base();	$crt_overlay5 = new Sprite_Base();	$crt_overlay8 = new Sprite_Base();	$crt_overlay11 = new Sprite_Base();		$crt_glitch_base = new Sprite_Base(); // For BLT corruption	$crt_glitch = new Sprite_Base(); // Actual glitch image		var overlayList = [$crt_overlay1, $crt_overlay2, $crt_overlay3,	$crt_overlay8, $crt_overlay11, $crt_overlay4, $crt_overlay5];		$crt_overlay1.bitmap = ImageManager.loadPicture("crt_phosphor_grid");	$crt_overlay2.bitmap = ImageManager.loadPicture("crt_wave");	$crt_overlay3.bitmap = ImageManager.loadPicture("crt_linedcolor");	$crt_overlay5.bitmap = ImageManager.loadPicture("crt_border_merged");	$crt_overlay8.bitmap = ImageManager.loadPicture("crt_interiorlight");		$crt_overlay1.blendMode = 1;	$crt_overlay1.opacity = 40;	$crt_overlay1.blendMode = 0;		$crt_overlay2.blendMode = 1;	$crt_overlay2.opacity = 120;		$crt_overlay3.blendMode = 1;	$crt_overlay3.opacity = 50;		$crt_overlay5.blendMode = 0;	$crt_overlay5.opacity = 255;		$crt_overlay8.blendMode = 1;	$crt_overlay8.opacity = 10;  	$crt_overlay8.y = 12			$crt_overlay4.bitmap = ImageManager.loadPicture("majorglitch");	$crt_overlay4b.bitmap = ImageManager.loadPicture("majorglitch");  /*  var desiredFPS = 1,      fpsLimit = 10000/desiredFPS,      nextUpdate = 0  $crt_overlay4.update = function() {	var now = Date.now()+30*Math.random();	if (now < nextUpdate) { minTimeAchieved = 0; return;}	else{		minTimeAchieved = 1;		nextUpdate = now + fpsLimit + 5*Math.random();	}  }*/      var nextUpdate = 0;  $crt_overlay4.update = function(){	  	  var now = Date.now();	  if (now <= nextUpdate){		  var target = $crt_overlay4.bitmap;		  var height = SceneManager._screenHeight*Math.random();		  var off = SceneManager._screenHeight*Math.random();		  $crt_overlay4.bitmap = ImageManager.loadPicture("majorglitch");		  //$crt_overlay4.bitmap = ImageManager.loadPicture("crt_phosphor_grid");		  //$crt_overlay4.bitmap = Bitmap.snap();		  $crt_overlay4.bitmap.clearRect(0,off,SceneManager._screenWidth,height);		  //return;		  //		  myRenderTexture.render(Scene_Base, matrix);		  	  }	  else{		  var target = $crt_overlay4.bitmap;		  var height = SceneManager._screenHeight*Math.random();		  var off = SceneManager._screenHeight*Math.random();		  var w = SceneManager._screenWidth;		  var h = SceneManager._screenHeight;		  		  if (Math.random() > 0.1){ 		    //target.fillAll("#FF0000");			$crt_overlay4.bitmap.blt( $crt_overlay4b.bitmap , 0, 0, $crt_overlay4b.bitmap.width, $crt_overlay4b.bitmap.height, 0, 0, $crt_overlay4b.bitmap.width, $crt_overlay4b.bitmap.height);			//$crt_overlay4.bitmap.blt( $crt_overlay4b.bitmap , 240, SceneManager.scene_Height, $crt_overlay4b.bitmap.height, $crt_overlay4b.bitmap.width, w*Math.random(), h*Math.random());			$crt_overlay4.bitmap = ImageManager.loadPicture("majorglitch"); 			$crt_overlay4.update();		  }		  		  target.fillRect( (SceneManager._screenWidth*Math.random()), off+(height*Math.random()), SceneManager._screenWidth,SceneManager._screenHeight,"#FF0000");		  target.fillRect( (SceneManager._screenWidth*Math.random()), off+(height*Math.random()), SceneManager._screenWidth,SceneManager._screenHeight,"#00FF00");		  target.fillRect( (SceneManager._screenWidth*Math.random()), off+(height*Math.random()), SceneManager._screenWidth,SceneManager._screenHeight,"#0000FF");		  		  var r = Math.floor(256*Math.random());		  var g = Math.floor(256*Math.random());		  var b = Math.floor(256*Math.random());		  		  var out = "#"+rgb2hex(r,g,;		  		  var r = Math.floor(256*Math.random());		  var g = Math.floor(256*Math.random());		  var b = Math.floor(256*Math.random());		  		  var out2 = "#"+rgb2hex(r,g,;		  		  if (Math.random() > 0.5) { var grad = true; } else{ var grad = false; }		  		  if (Math.random()> 0.90){			  target.gradientFillRect ( Math.random()*w , Math.random()*h , Math.random()*w , Math.random()*h , out , out2, grad )			  if (Math.random() > 0.5) { var grad = true; } else{ var grad = false; }			  				var r = Math.floor(256*Math.random());				var g = Math.floor(256*Math.random());				var b = Math.floor(256*Math.random());		  				var out = "#"+rgb2hex(r,g,;				target.gradientFillRect ( Math.random()*w , Math.random()*h , Math.random()*w , Math.random()*h , out , out2, grad )		  }		  		  		  target.blt(target, w*Math.random(), h*Math.random(), $crt_overlay4b.bitmap.width, $crt_overlay4b.bitmap.height, w*Math.random(), h*Math.random());		  target.blt(target, w*Math.random(), h*Math.random(), w*Math.random(), h*Math.random(), w*Math.random(), h*Math.random());		  target.blt(target, w*Math.random(), h*Math.random(), $crt_overlay4b.bitmap.width, $crt_overlay4b.bitmap.height, w*Math.random(), h*Math.random());		  target.blt(target, w*Math.random(), h*Math.random(), w*Math.random(), h*Math.random(), w*Math.random(), h*Math.random());		  target.blt(target, w*Math.random(), h*Math.random(), w*Math.random(), h*Math.random(), w*Math.random(), h*Math.random());		  target.blt(target, w*Math.random(), h*Math.random(), w*Math.random(), h*Math.random(), w*Math.random(), h*Math.random());		  target.blt(target, w*Math.random(), h*Math.random(), w*Math.random(), h*Math.random(), w*Math.random(), h*Math.random());		  $crt_overlay4.bitmap.clearRect(w*Math.random(),h*Math.random(),w,h);		  //var r = Math.floor(256*Math.random());		  //var g = Math.floor(256*Math.random());		  //var b = Math.floor(256*Math.random());		  		  		  //target.adjustTone ( r , g , b )		  		  //target.blendMode = 0;		  //target.opacity = Math.random()*255;		  		  nextUpdate = now + Math.random()*2000;	  }	    }    function zsorter(a,  {    if (!a.z && !b.z) return 0    if (!a.z) return -1;    if (!b.z) return 1;    return a.z - b.z  }  extend(Scene_Map, 'initialize', function() {    for (var i = 0; i < overlayList.length; i++) {      overlayList[i].z = i + 1      this.addChild(overlayList[i])    }  })    extend(Scene_MenuBase, 'create', function() {	  $gameSwitches[0] = !$gameSwitches[0];  })    prepend(Scene_Map, 'updateChildren', function() {	  if($gameSwitches[0] === false){			if(firstTime === 0){				firstTime = 1; 				$crt_overlay1.visible = false;				$crt_overlay2.visible = false;				$crt_overlay3.visible = false;				$crt_overlay4.visible = false;				$crt_overlay8.visible = false;								$crt_overlay11.visible = false;			}				  }	  else{		  if (firstTime === 1){			  	$crt_overlay1.visible = true;				$crt_overlay2.visible = true;				$crt_overlay3.visible = true;				$crt_overlay4.visible = true;				$crt_overlay8.visible = true;				$crt_overlay11.visible = true;		  }		  if (minTimeAchieved == 1){			  $crt_overlay11.bitmap = Bitmap.snap(this);			  $crt_overlay11.opacity = 180*Math.random();			  minTimeAchieved = 0;			  var offx = getRandomArbitrary(-1,1);				offx*= Math.floor(Math.random()*2) == 1 ? 1 : -1;				offx*= Math.floor(Math.random()*2) == 1 ? 6 : 1;			var offy = getRandomArbitrary(-1,1);				offy*= Math.floor(Math.random()*2) == 1 ? 1 : -1;				offy*= Math.floor(Math.random()*2) == 1 ? 6 : 1;							$crt_overlay11.x = offx;			$crt_overlay11.y = offy;		  }		  else{			$crt_overlay11.opacity = 0;			var op = 0+getRandomArbitrary(16,80);									$crt_overlay2.opacity = 70;			$crt_overlay2.y += 1;						if ($crt_overlay2.y >= SceneManager._screenHeight + 180){ $crt_overlay2.y = -180; }						$crt_overlay4.opacity = op;			$crt_overlay8.opacity = 120+(op*0.001);			$crt_overlay4.blendMode = 0;		  }	  		this.children = this.children.sort(zsorter)	}  })})()

Downloads / Referenced Files

Log in to download

Log in, then follow the RPG Maker Developers Group to see these download links.

Log in to download
Creator Claims / Removal

If you are the original creator and want this listing reassigned, edited, or removed, join BMMPlay and contact the moderators with proof that matches the original RPG Maker Web profile, linked GitHub, itch.io page, or another public creator identity.

#039#ff0000#00ff00#0000ff#rpg-maker-archive

Replies (0)

No replies yet.

0 replies 1 view

Log in to reply.

User Avatar