Need Addon for a GALV plugin

JulioManeiiro

Villager
Member
Joined
Jul 19, 2017
Messages
20
Reaction score
3
First Language
Portuguese
Primarily Uses
RMMV
Hello everyone!

I'm using a great GALV (Move Route Extras) plugin, but I've noticed some possibilities that can be added (because I'm really needing a lot for my project).

I wonder if there is a possibility that when an event is in the ID of Region 4, it is moved to the Right or to the Left or Up or Down as many times as necessary.
Like the random-move script command below:
this.step_rand (id, id, id);

Examples of how scripts can be:

this.step_left (id, id, id, x);
this.step_right (id, id, id, x);
this.step_up (id, id, id, x);
this.step_down (id, id, id, x);

x = The "x" can refer to the number of times the event will move in that direction.

id = The "id" refer to REGION ID.

I talked to Galv through a page from a social network, and he told me he did not have enough time to add these functions as they are busy with work.
So I talked to him about the possibility of requesting an Addon for the plugin in some forum, and he told me that I can.

Could someone please please create an Addon from the Galv plugin and add these functions because I really need the addition of these commands because this would make my project more fluid and I would not need to use many and many variables in my project.
 
Last edited:

Magnus0808

Software Developer
Veteran
Joined
Feb 2, 2019
Messages
147
Reaction score
166
First Language
Danish
Primarily Uses
RMMV
Here you go :)
I changed the script command to be this.step_down (x, id, id, id); (since that made the coding much easier)
As requested it allows the user to step out of the region, but it will only be triggered if it is in the region.

If you encounter any problems or it does not work as imagined feel free to message me :)

Code:
//=============================================================================
// GALV Move Route Extras - Step Directions Extension
// MRP_GALV_MoveRouteExtras_StepDirections.js
// By Magnus0808 || Magnus Rubin Peterson
//=============================================================================

/*:
 * @plugindesc Extension to GALV Move Route Extras. Adds directions for the step
 * command
 * @author Magnus0808
 *
 * @help Adds the following options:
 *      * this.step_right(x, id, id, id);
 *      * this.step_left(x, id, id, id);
 *      * this.step_up(x, id, id, id);
 *      * this.step_down(x, id, id, id);
 * Where x = the amount of steps and id = the region id.
 */

 var Imported = Imported || {};
 Imported.MRP_GALV_MoveRouteExtras_StepDirections = true;
 
 var MRP = MRP || {};
 MRP.MRP_GALV_MoveRouteExtras_StepDirections = MRP.MRP_GALV_MoveRouteExtras_StepDirections ||{};
 
(function() {
    
    Game_Character.prototype.step_repeat_start_index = 0;
    
    Game_Character.prototype.step_direction = function(x, d, args) {
        if(!this.step_repeats || this.step_repeats <= 0) {
            var region_test = false;       
            for (var j = 1; j < args.length; j++) {
                if (args[j] === $gameMap.regionId(this.x, this.y)) {
                    region_test = true;
                    break;
                };
            };
            if (!region_test) return false;
            this.step_repeat_begin(x+1);
        }
        var x2 = $gameMap.roundXWithDirection(this.x, d);
        var y2 = $gameMap.roundYWithDirection(this.y, d);       
        if (!$gameMap.isValid(x2, y2)) {
            this.step_repeats = 0;
            return false;
        }
        if (this.canPass(this.x, this.y, d)) {
            this.moveStraight(d);
        };
        this.step_repeat_end();
    };
    
    Game_Character.prototype.step_repeat_begin = function(times) {
        this.step_repeats = times - 1;
        console.log(this._moveRouteIndex);
        this.step_repeat_start_index = this._moveRouteIndex - 1;
    };

    Game_Character.prototype.step_repeat_end = function() {
        this.step_repeats -= 1;
        if (this.step_repeats > 0) {
            this._moveRouteIndex = this.step_repeat_start_index;
        };
    };
    
    Game_Character.prototype.step_right = function(x) {
        var d = 6;   
        this.step_direction(x, d, arguments);
    };   
    
    Game_Character.prototype.step_left = function(x) {
        var d = 4;
        this.step_direction(x, d, arguments);
    };
    
    Game_Character.prototype.step_up = function(x) {
        var d = 8;
        this.step_direction(x, d, arguments);
    };
    
    Game_Character.prototype.step_down = function(x) {
        var d = 2;
        this.step_direction(x, d, arguments);
    };
        
})();
 

Attachments

Last edited:

JulioManeiiro

Villager
Member
Joined
Jul 19, 2017
Messages
20
Reaction score
3
First Language
Portuguese
Primarily Uses
RMMV
Magnus !!!
You're awesome, thank you very much for working on the plugin, soon I'll do the right tests and if there is any problem, I'll send you a message!

(Please do not close the thread yet, so in case there are future updates to the plugin, it will be posted here so someone else can use it as well).
 

Magnus0808

Software Developer
Veteran
Joined
Feb 2, 2019
Messages
147
Reaction score
166
First Language
Danish
Primarily Uses
RMMV
Sorry I am actually really tired so it was buggy. I have fixed it now :)
My original reply have been edited.

EDIT: BTW I should note that when using step_right etc. it does NOT work with repeat_begin. If you need it to please tell me and I'll make it work.

EDIT: I decided to make it work with repeat_begin anyway. Edited original reply.
 
Last edited:

JulioManeiiro

Villager
Member
Joined
Jul 19, 2017
Messages
20
Reaction score
3
First Language
Portuguese
Primarily Uses
RMMV
Hii Magnus!!

You're awesome, thank you very much for working on the plugin and your patience!!
Your plugin work great now, after your make "repeat_begin" option work.
 

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

Latest Threads

Latest Profile Posts

Don't forget, aspiring writers: Personality isn't what your characters do, it is WHY they do it.
Hello! I would like to know if there are any pluggings or any way to customize how battles look?
I was thinking that when you start the battle for it to appear the eyes of your characters and opponents sorta like Ace Attorney.
Sadly I don't know how that would be possible so I would be needing help! If you can help me in any way I would really apreciate it!
The biggest debate we need to complete on which is better, Waffles or Pancakes?
rux
How is it going? :D
Day 9 of giveaways! 8 prizes today :D

Forum statistics

Threads
106,049
Messages
1,018,547
Members
137,835
Latest member
yetisteven
Top