Stop the camera that follows the player

Status
Not open for further replies.

Poupouille

Veteran
Veteran
Joined
Mar 1, 2017
Messages
162
Reaction score
26
First Language
Russian, french
Primarily Uses
RMMV
Hello :kaohi:

For the need of a map, I need the camera is fixed and doesn't follow the player in his movements.
Is it possible ? Is there a way to configure this?
 

Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,623
Reaction score
1,439
First Language
French
Primarily Uses
RMMV
yes you need to hack the scroll method called from Game_Player
PHP:
    Game_Player.prototype.updateScroll = function(lastScrolledX, lastScrolledY) {
        var x1 = lastScrolledX;
        var y1 = lastScrolledY;
        var x2 = this.scrolledX();
        var y2 = this.scrolledY();
        if (y2 > this.centerY()+5) {
            $gameMap.scrollDown(y2 - y1+9); // do ease
        }
        if (x2 < this.centerX()-6) {
            $gameMap.scrollLeft(x1 - x2+13);
        }
        if (x2 > this.centerX()+6) {
            $gameMap.scrollRight(x2 - x1+13);
        }
        if (y2 < this.centerY()-5) {
            $gameMap.scrollUp(y1 - y2+10);
        }
    };
and also rewrite all directions method with what your need.
Example for my side
PHP:
Game_Map.prototype.scrollDown = function(distance) {
        this._camDir = 2;
        if (this.height() >= this.screenTileY() && !this.camMoving) {
            this.camMoving = true;
            this._camEASING._fromDir = 2;
            this._camEASING._valuesStart._displayY = this._displayY;
            this._camEASING._valuesEnd._displayY = (this._displayY + distance);
            this._camEASING.duration(100);
            this._camEASING.start();
        };
    };

    Game_Map.prototype.scrollLeft = function(distance) {
        this._camDir = 4;
        if (this.width() >= this.screenTileX() && !this.camMoving) {
            this.camMoving = true;
            this._camEASING._fromDir = 4;
            this._camEASING._valuesStart._displayX = this._displayX;
            this._camEASING._valuesEnd._displayX = (this._displayX - distance);
            this._camEASING.duration(100);
            this._camEASING.start();
        };
    };

    Game_Map.prototype.scrollRight = function(distance) {
        this._camDir = 6;
        if (this.width() >= this.screenTileX() && !this.camMoving) {
            this.camMoving = true;
            this._camEASING._fromDir = 6;
            this._camEASING._valuesStart._displayX = this._displayX;
            this._camEASING._valuesEnd._displayX = (this._displayX + distance);
            this._camEASING.duration(100);
            this._camEASING.start();
        };
    };

    Game_Map.prototype.scrollUp = function(distance) {
        this._camDir = 8;
        if (this.height() >= this.screenTileY() && !this.camMoving) {
            this.camMoving = true;
            this._camEASING._fromDir = 8;
            this._camEASING._valuesStart._displayY = this._displayY;
            this._camEASING._valuesEnd._displayY = (this._displayY - distance);
            this._camEASING.duration(100);
            this._camEASING.start();
        };
    };
 

Poupouille

Veteran
Veteran
Joined
Mar 1, 2017
Messages
162
Reaction score
26
First Language
Russian, french
Primarily Uses
RMMV
Salut !
I'm not used to doing this kind of manipulation a little technical for me.:dizzy:

Is it possible to do this for a single map, and disable it after?
Do I need a plugin to do that?
Where should I copy the codes?

Can you tell me more about how to do this please? :D
 

Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,623
Reaction score
1,439
First Language
French
Primarily Uses
RMMV
Salut !
I'm not used to doing this kind of manipulation a little technical for me.:dizzy:

Is it possible to do this for a single map, and disable it after?
Do I need a plugin to do that?
Where should I copy the codes?

Can you tell me more about how to do this please? :D
yes you will need a plugin if you don't know JS, sorry

Or maybe you can try to force the map width, and height with a script call.
 

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
15,351
Reaction score
8,532
First Language
English
Primarily Uses
RMMV

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,981
Members
137,563
Latest member
cexojow
Top