RMMV Disable functions of a plugin with if statement, var, etc.

Veeter

Villager
Member
Joined
Nov 12, 2020
Messages
14
Reaction score
0
First Language
English
Primarily Uses
RMMV
Problem:
- Using Rhyme_MapSmoothScrolling.js that comes with LeTBS. But it causes multiple visual issues outside of battles, most notably a shake/jitter. My current work around is to set the script call Divider to (1), which isn't ideal.

List of other posts inquiring about this same issue:
One
Two
Three (similar question, nearly 3 years ago)
My own post where I mention it under a Side Note.

Goal:
Inject code that allows disabling and re-enabling certain functions of the plugin via a switch or variable.
(assuming it's startQuasiScroll or doQuasiScroll)

An if statement (nested?):
if ($gameSwitches.value(id) === true) {
return true;

Or a variable:
if $gameVariables.value(id)



Originally got the idea from:
Here

I'm willing to trial&error anything. Even if there's a tedious solution I'm willing to try it.
Any advice, suggestions are greatly appreciated.
 

Aerosys

Regular
Regular
Joined
Apr 23, 2019
Messages
1,045
Reaction score
1,107
First Language
German
Primarily Uses
RMMZ
You need to replace (in the Plugin, not the core code)

JavaScript:
Game_Map.prototype.updateScroll = function(){

With

JavaScript:
var alias_GameMap_updateScroll = Game_Map.prototype.updateScroll;
Game_Map.prototype.updateScroll = function(){
   
    if (!($gameSwitches.value(XY))) {
        alias_GameMap_updateScroll.call(this);
        return;
    }

Replace XY with your Switch Id.

Let me know if it works for you.
 
Last edited:

Veeter

Villager
Member
Joined
Nov 12, 2020
Messages
14
Reaction score
0
First Language
English
Primarily Uses
RMMV
You need to replace (in the Plugin, not the core code)

JavaScript:
Game_Map.prototype.updateScroll = function(){

With

JavaScript:
var alias_GameMap_updateScroll = Game_Map.prototype.updateScroll;
Game_Map.prototype.updateScroll = function(){
   
    if (!gameSwitches.value(XY)) {
        alias_GameMap_updateScroll.call(this);
        return;
    }

Replace XY with your Switch Id.

Let me know if it works for you.

Thanks for the quick followup!
I tried your suggestion but got an error right after launching the playtest.

I changed one part of the code:
- !gameSwitches to $gameSwitches

Please let me know if that change is incorrect, and that I simply didn't insert the code correctly.

This change (! to $) allowed the game to launch, but the issue is:
- Switch on: Map scrolling stops functioning, so the camera isn't following the player anymore.
- Switch off: default plugin behavior resumes, which is a very promising result .

So this enables activating/disabling functions in the plugin seemingly without breaking anything.

Switch 15
in this case.
Code:
var alias_GameMap_updateScroll = Game_Map.prototype.updateScroll;
Game_Map.prototype.updateScroll = function(){
    
  if ($gameSwitches.value(15)) {
        alias_GameMap_updateScroll.call(this);
        return;
    }
  if(this._displayX != this._tDisplayX) {
    var xSpeed = Math.abs(this._displayX - this._tDisplayX) / this._Divider;
    if(this._displayX > this._tDisplayX) {
      this._displayX = Math.max(this._displayX - xSpeed, this._tDisplayX);
    } else if (this._displayX < this._tDisplayX) {
      this._displayX = Math.min(this._displayX + xSpeed, this._tDisplayX);
    }
    this._parallaxX = this._displayX;
  }
 

Aerosys

Regular
Regular
Joined
Apr 23, 2019
Messages
1,045
Reaction score
1,107
First Language
German
Primarily Uses
RMMZ
Yes, you are absolutely right, I did a typo. I updated my post above.

I think you need to copy-paste my trick into other functions as well. Basically, for all the functions that override a function in the core code (rpg_objects.js).
 

Veeter

Villager
Member
Joined
Nov 12, 2020
Messages
14
Reaction score
0
First Language
English
Primarily Uses
RMMV
Basically, for all the functions that override a function in the core code (rpg_objects.js).

Unfortunately the revised code gave an error. Am I doing it wrong?
Code:
var alias_GameMap_updateScroll = Game_Map.prototype.updateScroll;

Game_Map.prototype.updateScroll = function(){

    

  if (!($gameSwitches.value(15))) {

        alias_GameMap_updateScroll.call(this);

        return;

    }

Sections of plugin isolated with your var (changed these, excluded others):
scrollDistanceX/Y
updateScroll
setDisplayPos
doQuasiScroll
startQuasiScroll
scrollTowards

- Basically all of it. I also tried the code only in every function that this plugin shares with the core rpg_objects.js with no luck.
- Also tested including/excluding the do/startQuasi and scrollDistanceX/Y functions, etc. since they aren't found in rpg_objects.
- Doing anything to "scrollDown, Left, Right, Up" causes a black screen after the PC moves a couple steps.
- setDisplayPos in particular seems to cause an error when changing maps.

I also tried swapping every iteration of if ($gameSwitches.value with (minus quotes""):
Code:
    if ""(!($""gameSwitches.value(XY))"")"" {
just in case but no luck there either.
 

Aerosys

Regular
Regular
Joined
Apr 23, 2019
Messages
1,045
Reaction score
1,107
First Language
German
Primarily Uses
RMMZ
Basically what I did is an extended form of "aliasing" a method. I recommend you to google what it means.

Depending on the original function and the function in the plugin code, your alias looks different. In my example above, I aliased a "void" method, i.e., a method that does not return anything. Methods that return a value (e.g., getScrollDistance) need a different alias, i.e., you need to update your functions.

This trick that I'm using is like a junction that either calls the RPG Maker core code or the Plugin code. When it does not work then a proper solution might be a lot more expensive because a developer must understand how the plugin works to add patches individually.
 

kyonides

Reforged is laughable
Regular
Joined
Nov 17, 2019
Messages
1,934
Reaction score
983
First Language
English
Primarily Uses
RMXP
Well, the Game_Map needs to naturally scroll up and down and sideways so using the switch like you initially did would not prevent the player from walking off screen.

Try this snippet of mine.

JavaScript:
//=============================================================================
// KyonSwitch for Rhyme MSS
//=============================================================================
// @author Kyonides Arkanthes
// @help Date: 2023-01-25
// Include this plugin below Rhyme_MapSmoothScrolling.
// Then set the KyonSwitch4RhymeMSS.switchID variable to the desired Switch ID
// and that's it!
//=============================================================================

function KyonSwitch4RhymeMSS() {
  throw new Error('This is a static class');
}

KyonSwitch4RhymeMSS.switchID = 1;

Game_Map.prototype.updateScroll = function() {
  if (this.isScrolling()) {
    let lastX = this._displayX;
    let lastY = this._displayY;
    this.doScroll(this._scrollDirection, this.scrollDistance());
    if (this._displayX === lastX && this._displayY === lastY) {
      this._scrollRest = 0;
    } else {
      this._scrollRest -= this.scrollDistance();
    }
  }
};

Game_Map.prototype.updateScrollRMSS = function() {
  if(this._displayX != this._tDisplayX) {
    let xSpeed = Math.abs(this._displayX - this._tDisplayX) / this._Divider;
    if(this._displayX > this._tDisplayX) {
      this._displayX = Math.max(this._displayX - xSpeed, this._tDisplayX);
    } else if (this._displayX < this._tDisplayX){
      this._displayX = Math.min(this._displayX + xSpeed, this._tDisplayX);
    }
  }
  if(this._displayY != this._tDisplayY){
    let ySpeed = Math.abs(this._displayY - this._tDisplayY) / this._Divider;
    if(this._displayY > this._tDisplayY) {
      this._displayY = Math.max(this._displayY - ySpeed, this._tDisplayY);
    } else if (this._displayY < this._tDisplayY){
      this._displayY = Math.min(this._displayY + ySpeed, this._tDisplayY);
    }
  }
  if(this.isScrolling()){
    let lastX = this._tDisplayX;
    let lastY = this._tDisplayY;
    // code from Quasi coding
    if (this._scrollDirection.constructor === Array) {
      this.doQuasiScroll(this._scrollDirection[0], this._scrollDirection[1],
                         this.scrollDistanceX(), this.scrollDistanceY());
    } else {
      this.doScroll(this._scrollDirection, this.scrollDistance());
    }
    if(this._tDisplayX === lastX && this._tDisplayY === lastY){
      this._scrollRest = 0;
    } else {
      this._scrollRest -= this.scrollDistance();
    }
  }
};

Game_Map.prototype.updateScroll = function(){
  if ($gameSwitches.value(KyonSwitch4RhymeMSS.switchID) == true) {
    this.updateScrollRMSS();
  } else {
    this.updateScrollDefault();
  }
};
 

Veeter

Villager
Member
Joined
Nov 12, 2020
Messages
14
Reaction score
0
First Language
English
Primarily Uses
RMMV
Well, the Game_Map needs to naturally scroll up and down and sideways so using the switch like you initially did would not prevent the player from walking off screen.

Try this snippet of mine.

JavaScript:
//=============================================================================
// KyonSwitch for Rhyme MSS
//=============================================================================
// @author Kyonides Arkanthes
// @help Date: 2023-01-25
// Include this plugin below Rhyme_MapSmoothScrolling.
// Then set the KyonSwitch4RhymeMSS.switchID variable to the desired Switch ID
// and that's it!
//=============================================================================

function KyonSwitch4RhymeMSS() {
  throw new Error('This is a static class');
}

KyonSwitch4RhymeMSS.switchID = 1;

Game_Map.prototype.updateScroll = function() {
  if (this.isScrolling()) {
    let lastX = this._displayX;
    let lastY = this._displayY;
    this.doScroll(this._scrollDirection, this.scrollDistance());
    if (this._displayX === lastX && this._displayY === lastY) {
      this._scrollRest = 0;
    } else {
      this._scrollRest -= this.scrollDistance();
    }
  }
};

Game_Map.prototype.updateScrollRMSS = function() {
  if(this._displayX != this._tDisplayX) {
    let xSpeed = Math.abs(this._displayX - this._tDisplayX) / this._Divider;
    if(this._displayX > this._tDisplayX) {
      this._displayX = Math.max(this._displayX - xSpeed, this._tDisplayX);
    } else if (this._displayX < this._tDisplayX){
      this._displayX = Math.min(this._displayX + xSpeed, this._tDisplayX);
    }
  }
  if(this._displayY != this._tDisplayY){
    let ySpeed = Math.abs(this._displayY - this._tDisplayY) / this._Divider;
    if(this._displayY > this._tDisplayY) {
      this._displayY = Math.max(this._displayY - ySpeed, this._tDisplayY);
    } else if (this._displayY < this._tDisplayY){
      this._displayY = Math.min(this._displayY + ySpeed, this._tDisplayY);
    }
  }
  if(this.isScrolling()){
    let lastX = this._tDisplayX;
    let lastY = this._tDisplayY;
    // code from Quasi coding
    if (this._scrollDirection.constructor === Array) {
      this.doQuasiScroll(this._scrollDirection[0], this._scrollDirection[1],
                         this.scrollDistanceX(), this.scrollDistanceY());
    } else {
      this.doScroll(this._scrollDirection, this.scrollDistance());
    }
    if(this._tDisplayX === lastX && this._tDisplayY === lastY){
      this._scrollRest = 0;
    } else {
      this._scrollRest -= this.scrollDistance();
    }
  }
};

Game_Map.prototype.updateScroll = function(){
  if ($gameSwitches.value(KyonSwitch4RhymeMSS.switchID) == true) {
    this.updateScrollRMSS();
  } else {
    this.updateScrollDefault();
  }
};


If I'm understanding this correctly:
1.
Target "Game_Map.prototype.updateScroll = function(){" in Rhyme_MapSmoothScrolling.js with the alias function:
Code:
var alias_GameMap_updateScroll = Game_Map.prototype.updateScroll;
Game_Map.prototype.updateScroll = function(){
 
    if (!($gameSwitches.value(XY))) {
        alias_GameMap_updateScroll.call(this);
        return;
    }

2.
Place your plugin under RhymeMSS

3.
Change "KyonSwitch4RhymeMSS.switchID = X" to my desired switch (in my case 15).


^^^
By doing the above, the current result is:
- The switch must be on (I turned it on with an Autorun) or it results in an error. Turning off the switch manually results in error, almost like a middleman to RhymeMSS's updateScroll.
Ideally, turning on/off the switch would change back and forth between rpg_objects.js and RhymeMSS updateScroll.

- With your plugin, RhymeMSS seems to retain full functionality (battle entry, map transition, etc.), the problem is it still retains the jitter issue.


Thanks very much for your input.
I'm still doing trial & error as I type this and will update.
 
Last edited:

kyonides

Reforged is laughable
Regular
Joined
Nov 17, 2019
Messages
1,934
Reaction score
983
First Language
English
Primarily Uses
RMXP
Err, nope. In my case, you don't need the alias.
When exactly does the jitter become the most noticeable?
 

Veeter

Villager
Member
Joined
Nov 12, 2020
Messages
14
Reaction score
0
First Language
English
Primarily Uses
RMMV
Err, nope. In my case, you don't need the alias.
When exactly does the jitter become the most noticeable?
I also tried without the alias.

This is the error I get when I don't turn on my switch (15) with an autorun.
Or if the switch is manually turned off ingame.
YEP_CoreEngine.js:1098 TypeError: this.updateScrollDefault is not a function
at Game_Map.updateScroll (KyonSwitch4RhymeMSS.js:69)
at Game_Map.update (rpg_objects.js:6024)
at Scene_Map.updateMain (rpg_scenes.js:608)
at Scene_Map.updateMainMultiply (rpg_scenes.js:600)
at Scene_Map.update (rpg_scenes.js:589)
at Scene_Map.update (YEP_CoreEngine.js:1425)
at Scene_Map.update (KNT_Editor.js:2531)
at Function.SceneManager.updateScene (rpg_managers.js:2024)
at Function.SceneManager.updateMain (rpg_managers.js:1983)
at Function.SceneManager.update (rpg_managers.js:1907)


When the switch is turned on, it's as if all normal functions are retained, including the jitter.

A basic description of the jitter experienced is:
(see posts from other users linked in OP).
- What looks like a 1 pixel constant micro-shaking back and forth while the PC is walking.
- Parallax map elements will shift 1 pixel left
(specifically left I've noticed, but it might different for others (-1,0)) randomly when the player is standing still.
e.g. I have this large parallax object one of my maps, and that 1 little pixel shift is very noticeable.
- There might be other issues that I haven't even discovered yet, but all we know for sure is that it's something in RhymeMSS.

For me personally, I could live with that 1 pixel shift left (something to do with a rounding error?) it's that micro-shaking while the PC walks that I can't get past. Hence why my workaround was to set RhymeMSS Divider to (1) because it completely eliminates the jitter/shake but at another great cost:
- Player movement becomes extremely jumpy/fast which is also not a great result.

Basically:
For the last 4-6 years some who use LeTBS have wanted a way to disable RhymeMSS outside of battle and use RMMV default scrolling to to get rid of these jitters.

The parallax plugin I use is Yep Doodads.
 

kyonides

Reforged is laughable
Regular
Joined
Nov 17, 2019
Messages
1,934
Reaction score
983
First Language
English
Primarily Uses
RMXP
I forgot to add the Default part of the function's name. :oops:
Now it should work normally if the switch is turned off.

EDITED The Code!

JavaScript:
//=============================================================================
// KyonSwitch for Rhyme MSS
//=============================================================================
// @author Kyonides Arkanthes
// @help Date: 2023-01-25
// Include this plugin below Rhyme_MapSmoothScrolling.
// Then set the KyonSwitch4RhymeMSS.switchID variable to the desired Switch ID
// and that's it!
//=============================================================================

function KyonSwitch4RhymeMSS() {
  throw new Error('This is a static class');
}

KyonSwitch4RhymeMSS.switchID = 1;

Game_Map.prototype.updateScrollDefault  = function() {
  if (this.isScrolling()) {
    let lastX = this._displayX;
    let lastY = this._displayY;
    this.doScroll(this._scrollDirection, this.scrollDistance());
    if (this._displayX === lastX && this._displayY === lastY) {
      this._scrollRest = 0;
    } else {
      this._scrollRest -= this.scrollDistance();
    }
  }
};

Game_Map.prototype.updateScrollRMSS = function() {
  if(this._displayX != this._tDisplayX) {
    let xSpeed = Math.abs(this._displayX - this._tDisplayX) / this._Divider;
    if(this._displayX > this._tDisplayX) {
      this._displayX = Math.max(this._displayX - xSpeed, this._tDisplayX);
    } else if (this._displayX < this._tDisplayX){
      this._displayX = Math.min(this._displayX + xSpeed, this._tDisplayX);
    }
  }
  if(this._displayY != this._tDisplayY){
    let ySpeed = Math.abs(this._displayY - this._tDisplayY) / this._Divider;
    if(this._displayY > this._tDisplayY) {
      this._displayY = Math.max(this._displayY - ySpeed, this._tDisplayY);
    } else if (this._displayY < this._tDisplayY){
      this._displayY = Math.min(this._displayY + ySpeed, this._tDisplayY);
    }
  }
  if(this.isScrolling()){
    let lastX = this._tDisplayX;
    let lastY = this._tDisplayY;
    // code from Quasi coding
    if (this._scrollDirection.constructor === Array) {
      this.doQuasiScroll(this._scrollDirection[0], this._scrollDirection[1],
                         this.scrollDistanceX(), this.scrollDistanceY());
    } else {
      this.doScroll(this._scrollDirection, this.scrollDistance());
    }
    if(this._tDisplayX === lastX && this._tDisplayY === lastY){
      this._scrollRest = 0;
    } else {
      this._scrollRest -= this.scrollDistance();
    }
  }
};

Game_Map.prototype.updateScroll= function(){
  if ($gameSwitches.value(KyonSwitch4RhymeMSS.switchID) == true) {
    this.updateScrollRMSS();
  } else {
    this.updateScrollDefault();
  }
};
 

Veeter

Villager
Member
Joined
Nov 12, 2020
Messages
14
Reaction score
0
First Language
English
Primarily Uses
RMMV
I forgot to add the Default part of the function's name. :oops:
Now it should work normally if the switch is turned off.

EDITED The Code!

JavaScript:
//=============================================================================
// KyonSwitch for Rhyme MSS
//=============================================================================
// @author Kyonides Arkanthes
// @help Date: 2023-01-25
// Include this plugin below Rhyme_MapSmoothScrolling.
// Then set the KyonSwitch4RhymeMSS.switchID variable to the desired Switch ID
// and that's it!
//=============================================================================

function KyonSwitch4RhymeMSS() {
  throw new Error('This is a static class');
}

KyonSwitch4RhymeMSS.switchID = 1;

Game_Map.prototype.updateScrollDefault  = function() {
  if (this.isScrolling()) {
    let lastX = this._displayX;
    let lastY = this._displayY;
    this.doScroll(this._scrollDirection, this.scrollDistance());
    if (this._displayX === lastX && this._displayY === lastY) {
      this._scrollRest = 0;
    } else {
      this._scrollRest -= this.scrollDistance();
    }
  }
};

Game_Map.prototype.updateScrollRMSS = function() {
  if(this._displayX != this._tDisplayX) {
    let xSpeed = Math.abs(this._displayX - this._tDisplayX) / this._Divider;
    if(this._displayX > this._tDisplayX) {
      this._displayX = Math.max(this._displayX - xSpeed, this._tDisplayX);
    } else if (this._displayX < this._tDisplayX){
      this._displayX = Math.min(this._displayX + xSpeed, this._tDisplayX);
    }
  }
  if(this._displayY != this._tDisplayY){
    let ySpeed = Math.abs(this._displayY - this._tDisplayY) / this._Divider;
    if(this._displayY > this._tDisplayY) {
      this._displayY = Math.max(this._displayY - ySpeed, this._tDisplayY);
    } else if (this._displayY < this._tDisplayY){
      this._displayY = Math.min(this._displayY + ySpeed, this._tDisplayY);
    }
  }
  if(this.isScrolling()){
    let lastX = this._tDisplayX;
    let lastY = this._tDisplayY;
    // code from Quasi coding
    if (this._scrollDirection.constructor === Array) {
      this.doQuasiScroll(this._scrollDirection[0], this._scrollDirection[1],
                         this.scrollDistanceX(), this.scrollDistanceY());
    } else {
      this.doScroll(this._scrollDirection, this.scrollDistance());
    }
    if(this._tDisplayX === lastX && this._tDisplayY === lastY){
      this._scrollRest = 0;
    } else {
      this._scrollRest -= this.scrollDistance();
    }
  }
};

Game_Map.prototype.updateScroll= function(){
  if ($gameSwitches.value(KyonSwitch4RhymeMSS.switchID) == true) {
    this.updateScrollRMSS();
  } else {
    this.updateScrollDefault();
  }
};

Interesting!

So current result is:
- Scrolling just stops working when it's turned off.
- But I can turn the switch on and off now and battles retain full functionality, map transitions work, etc.
 

kyonides

Reforged is laughable
Regular
Joined
Nov 17, 2019
Messages
1,934
Reaction score
983
First Language
English
Primarily Uses
RMXP
So is it behaving as expected or not?
Please be clear enough as to let us know if the thread can be closed or tagged as resolved or not.
 

Veeter

Villager
Member
Joined
Nov 12, 2020
Messages
14
Reaction score
0
First Language
English
Primarily Uses
RMMV
So is it behaving as expected or not?
Please be clear enough as to let us know if the thread can be closed or tagged as resolved or not.

Map scroll does not work when the switch is off.

When it's on, it's just identical behavior to the original issue with the RhymeMSS plugin (screen jitter/shaking).
 

kyonides

Reforged is laughable
Regular
Joined
Nov 17, 2019
Messages
1,934
Reaction score
983
First Language
English
Primarily Uses
RMXP
What about this new version of my pluginlet? XD

JavaScript:
//=============================================================================
// KyonSwitch for Rhyme MSS
//=============================================================================
// @author Kyonides Arkanthes
// @help Date: 2023-01-25
// Include this plugin below Rhyme_MapSmoothScrolling.
// Then set the KyonSwitch4RhymeMSS.switchID variable to the desired Switch ID
// and that's it!
//=============================================================================

function KyonSwitch4RhymeMSS() {
  throw new Error('This is a static class');
}

KyonSwitch4RhymeMSS.switchID = 1;

Game_Map.prototype.scrollDistance = function() {
  if ( !$gameSwitches.value(KyonSwitch4RhymeMSS.switchID) )
    return Math.pow(2, this._scrollSpeed) / 256;
  }
  if (this._scrollFrames) {
    return Math.abs(this._scrollDistance / this._scrollSpeed);
  }
};

Game_Map.prototype.updateScrollDefault = function() {
  if (this.isScrolling()) {
    let lastX = this._displayX;
    let lastY = this._displayY;
    this.doScroll(this._scrollDirection, this.scrollDistance());
    if (this._displayX === lastX && this._displayY === lastY) {
      this._scrollRest = 0;
    } else {
      this._scrollRest -= this.scrollDistance();
    }
  }
};

Game_Map.prototype.updateScrollRMSS = function() {
  if(this._displayX != this._tDisplayX) {
    let xSpeed = Math.abs(this._displayX - this._tDisplayX) / this._Divider;
    if(this._displayX > this._tDisplayX) {
      this._displayX = Math.max(this._displayX - xSpeed, this._tDisplayX);
    } else if (this._displayX < this._tDisplayX){
      this._displayX = Math.min(this._displayX + xSpeed, this._tDisplayX);
    }
  }
  if(this._displayY != this._tDisplayY){
    let ySpeed = Math.abs(this._displayY - this._tDisplayY) / this._Divider;
    if(this._displayY > this._tDisplayY) {
      this._displayY = Math.max(this._displayY - ySpeed, this._tDisplayY);
    } else if (this._displayY < this._tDisplayY){
      this._displayY = Math.min(this._displayY + ySpeed, this._tDisplayY);
    }
  }
  if(this.isScrolling()){
    let lastX = this._tDisplayX;
    let lastY = this._tDisplayY;
    // code from Quasi coding
    if (this._scrollDirection.constructor === Array) {
      this.doQuasiScroll(this._scrollDirection[0], this._scrollDirection[1],
                         this.scrollDistanceX(), this.scrollDistanceY());
    } else {
      this.doScroll(this._scrollDirection, this.scrollDistance());
    }
    if(this._tDisplayX === lastX && this._tDisplayY === lastY){
      this._scrollRest = 0;
    } else {
      this._scrollRest -= this.scrollDistance();
    }
  }
};

Game_Map.prototype.updateScroll = function(){
  if ($gameSwitches.value(KyonSwitch4RhymeMSS.switchID) == true) {
    this.updateScrollRMSS();
  } else {
    this.updateScrollDefault();
  }
};
 

Veeter

Villager
Member
Joined
Nov 12, 2020
Messages
14
Reaction score
0
First Language
English
Primarily Uses
RMMV
[Outdated info]
 
Last edited:

kyonides

Reforged is laughable
Regular
Joined
Nov 17, 2019
Messages
1,934
Reaction score
983
First Language
English
Primarily Uses
RMXP
As you can see, Archeia had posted this on GitHub long... time... ago...
 

Veeter

Villager
Member
Joined
Nov 12, 2020
Messages
14
Reaction score
0
First Language
English
Primarily Uses
RMMV
Sadly, none of the "Jitter fixes" I came across online fixed the micro-shake/jitter either.
I've tried 4 different ones I found online, including the one shared in that github.
 

kyonides

Reforged is laughable
Regular
Joined
Nov 17, 2019
Messages
1,934
Reaction score
983
First Language
English
Primarily Uses
RMXP
In that case, it might take you even longer to get rid of it. The floating number nature of the issue will force them to narrow it down to floor or ceil values. Problaby, it'll never be exact except for a few moments every other frame.
 

Gilgameshed

Regular
Regular
Joined
Jun 25, 2021
Messages
73
Reaction score
20
First Language
English
Primarily Uses
RMMV
Any luck with this @Veeter? Experiencing this same issue which is quite noticeable for the sprites I am using. I am wondering if using kyonides script (the one that turns map movement off completely when the switch is off) combined with a different map scrolling plugin would work. Something else I didn't see mentioned is that this plugin was adapted for LeTBS, so the code to modify might actually be LeTBS_RhymeSmoothMapScrolling.js instead of RhymeSmoothMapScrolling.js.

Code:
/*
#=============================================================================
# LeTBS: Rhyme Smooth Map Scrolling Support
# LeTBS_RhymeSmoothMapScrolling.js
# By Lecode
# Version 1.0
#-----------------------------------------------------------------------------
# TERMS OF USE
#-----------------------------------------------------------------------------
# https://github.com/LecodeMV/leTBS/blob/master/LICENSE.txt
#-----------------------------------------------------------------------------
# Version History
#-----------------------------------------------------------------------------
# - 1.0 : Initial release
#=============================================================================
*/
var Imported = Imported || {};
Imported["LeTBS_RhymeSmoothMapScrolling"] = true;

var Lecode = Lecode || {};
Lecode.S_TBS.RhymeSmoothMapScrolling = {};
/*:
 * @plugindesc Compatibility patch for Rhyme's plugin
 * @author Lecode
 * @version 1.0
 *
* @help
 * ============================================================================
 * Introduction
 * ============================================================================
 *
 * This plugin is just a compatibility patch for Rhyme's smooth map scrolling.
 * This add-on should be above
 */
//#=============================================================================

BattleManagerTBS.centerCell = function (cell) {
    $gameMap.scrollTowardsPos(cell.x, cell.y, 4, 90);
};

Game_Map.prototype.scrollTowardsPos = function(x, y, speed, frames) {
  var centerX = this._tDisplayX + this.screenTileX() / 2;
  var centerY = this._tDisplayY + this.screenTileY() / 2;
  if (!this.isLoopHorizontal()) {
    if (centerX < this.screenTileX() / 2) {
      centerX = this.screenTileX() / 2;
    }
    if (centerX > this.width() - this.screenTileX() / 2) {
      centerX = this.width() - this.screenTileX() / 2;
    }
  }
  if (!this.isLoopVertical()) {
    if (centerY < this.screenTileY() / 2) {
      centerY = this.screenTileY() / 2;
    }
    if (centerY > this.height() - this.screenTileY() / 2) {
      centerY = this.height() - this.screenTileY() / 2;
    }
  }
  var distanceX = (x + 0.5) - centerX;
  var distanceY = (y + 0.5) - centerY;
  this.startQuasiScroll(distanceX, distanceY, speed || 4, frames);
};
 

Latest Threads

Latest Posts

Latest Profile Posts

Tiny setback. Turns out my Title Screen image and one of my primary background & avatar images are AI Generated. Glad I went back and checked all my resource links. So I am in hot pursuit of replacement images. Which is fine since I was still missing some images that I need anyway.
Watching Vibrato Chain Battle System is too awesome! watch I wish had this gfx and animation skill to make such game!
Got drawn back by a notification about QPlugins. For those who want the MZ versions I was using, they're on my Github. https://github.com/ImaginaryVillain/QPlugins I literally don't care what you do with them, have fun! :LZSlol:

Meanwhile.. I'm glorying over these 550 new Victorian house models Epic gave me this month. See next post for examples....
Got my new monitor. Good news is, my display issues with linux are okay now. Bad news is, the readability of letters is a bit worse compared to the previous one.
Also, why the heck did I buy a 21.5" one when it's no longer sufficient for my needs?


It's a Christmas miracle. I finally got a recording to actually capture sound.

Forum statistics

Threads
136,892
Messages
1,271,109
Members
180,668
Latest member
ianfox
Top