Galv's Move Route Extras

● ARCHIVED · READ-ONLY
Started by Galv 32 posts Page 2 of 2 View original ↗
  1. Seems like this tidbit does what I'm looking for:


    Changed boolean && to bitwise & (woops)

    Spoiler
    // Added by GIL 2016.02.26
    Game_Character.prototype.four_way = function(code) {
    this.fourway = code;
    }

    var GIL_Game_Map_checkPassage = Game_Map.prototype.checkPassage;
    Game_Map.prototype.checkPassage = function(x, y, bit) {
    var ev = this.eventsXy(x,y)[0];
    if (ev && ev.fourway) return ev.fourway & bit;
    return GIL_Game_Map_checkPassage.call(this, x, y, bit);
    };

    Now it works just like the tileset 4-way passage options only you can set it on any event tile and dynamically change the passage options as desired. Have to use my handy binary table in previous post to determine what number to pass into the function to set the desired directions. URLD standing for Up Right Left Down. Coincidentally my bits were set the same way that checkPassage bit works so that was fortunate. I'll likely start a separate thread once I get a nifty bridge puzzle working to demonstrate.
  2. I'm glad you found what you were looking for
  3. Thanks for the plugin Galv.


    this.step_toward(); is very useful, but can you RUN towards an event?
  4. By default running is just increased move speed. You use this in a move route so you could just increase the move speed before using that command
  5. [Deleted] 


    I found the solution to my problem and it had nothing to do with your amazing plugin ^^
  6. Hi Galv! I'm using the set frame this.set_frame("set1",3,1,2) in a farming system. Basically, if the player meets the conditions, the plot of land will change sprite and show the designated frame using your script. However, every time I exit the map of where I changed the sprite and come back, it reverts to the original sprite. Is this supposed to happen? 
  7. Yes, that is normal RPG Maker functionality. If you want to permanently change an event sprite then you need to change the event page.
  8. Hey!

    I have an event where it is battle processing. When I use the "escape" function, I want to jump away from event. Currently the event is turning away from the player, which looks kind of stupid if u escaped.

    Is this possibla?

    best regards,
    Bishiba von Truffelsnout

    EDIT*
    Yeah, I'm blind!
    I bring shame to the mighty house of Truffelsnouts.
  9. Did you work it out?
    There's a move route command to face the player without using a plugin.
  10. Is there a way to ''Start" the set movement route with a script call ?
    And then write the (plugins commands-scripts) Inside it?
    Example Script

    START

    Script = Set movement route (player, wait for complation, etc..)
    Script = this.set_frame("$ActorWoodAxeSt1",1,1,4) //Plugin command
    Script = Wait that frames //Wait for that seconds

    END


    How can i convert this into script ?
  11. Is this working with 1.6.x?
    I tried it with this.set_frame(“Dennsen_Char”,1,3,2)

    but it dosent work :o

    111.png
  12. Not sure if this is still being developed, but here's an extension that really helped me out. I added a patrol route function.

    Similar to the step_rand function, this allows a monster to follow a pathway made from regions. It will continue in a straight line until it comes to some sort of junction, then randomly choose a new direction. The only condition is that you must place the starting position at the start/end of a path, or on a corner, or at a junction.

    patrol_route.PNG


    Drop this code after the Game_Character.prototype.step_rand function:

    JavaScript:
    // FOLLOW PATHWAY AT RANDOM ON REGION
    Game_Character.prototype.patrol_route = function() {
    
        // check available directions
        const available_dir = [];
        for (var d = 2 ; d <= 8 ; d+=2) {
            // check which directions are valid
            var region_test = false;
            var x2 = $gameMap.roundXWithDirection(this.x, d);
            var y2 = $gameMap.roundYWithDirection(this.y, d);
            for (var i = 0; i < arguments.length; i++) {
                if (arguments[i] === $gameMap.regionId(x2, y2)) {
                    region_test = true;
                    break;
                };
            };
            // add available direction to array
            if ( region_test && $gameMap.isValid(x2, y2) && this.canPass(this.x, this.y, d) ) {
                available_dir[available_dir.length] = d;
            };
        };
        // more than one direction?
        if (available_dir.length > 1) {
            // don't go backwards
            if ( !( available_dir.length === 2 && available_dir[0] + available_dir[1] === 10 ) ){
                // choose a random direction
                this.curr_dir_patrol = available_dir[Math.randomInt(available_dir.length)];
            }
        } else {
            this.curr_dir_patrol = available_dir[0];
        }
        this.moveStraight(this.curr_dir_patrol);
    };

    I hope this helps someone else.

    Cheers.