PlayerShiftTurn (Turnaround)

tale

Volunteer
Veteran
Joined
Dec 16, 2016
Messages
662
Reaction score
1,127
First Language
English
Primarily Uses
N/A
PlayerShiftTurn - Version 1.0.1 (2016/07/09)

Creator name:
Triacontane

Overview

Player can turnaround

Features
- While holding a certain key [shift by default], change direction of player's facing from arrow key.
- Parameter for KeyName control (shift or control or tab)
- Player does not have to move to face a direction.

Preview


Note: this does not support touch/ mouse control

Credit and Thanks: Triacontane

Terms of Use- Free for commercial and non-commercial use.

License - MIT License: http://opensource.org/licenses/mit-license.php

You can download js file from the thread attachment or Dropbox link: https://www.dropbox.com/s/7brx858kygswug0/PlayerShiftTurn.js?dl=1

Code:
//=============================================================================
// PlayerShiftTurn.js
// ----------------------------------------------------------------------------
// Copyright (c) 2015 Triacontane
// This software is released under the MIT License.
// http://opensource.org/licenses/mit-license.php
// ----------------------------------------------------------------------------
// Version
// 1.0.1 2016/07/09 Fixed an issue with 8 direction (diagonal) movement plugin
// 1.0.0 2016/01/06 First release
// ----------------------------------------------------------------------------
// [Blog]   : http://triacontane.blogspot.jp/
// [Twitter]: https://twitter.com/triacontane/
// [GitHub] : https://github.com/triacontane/
//=============================================================================

/*:
 * @plugindesc Player can turnaround
 * @author Triacontane
 *
 * @param KeyName
 * @desc Holding a certain key, change direction of player's facing from arrow key.
 * (shift or control or tab)
 * @default shift
 *
 * @help Player does not have to move to face a direction.
 * Holding a key and press arrow key will change direction where the player facing.
 *
 * Terms of Service:
 *  It's possible to modify and redistribute without permission from the author.
 *  And this plugin licensed under MIT License.
 */
(function () {
    'use strict';
    var pluginName = 'PlayerShiftTurn';

    var getParamString = function(paramNames) {
        var value = getParamOther(paramNames);
        return value == null ? '' : value;
    };

    var getParamOther = function(paramNames) {
        if (!Array.isArray(paramNames)) paramNames = [paramNames];
        for (var i = 0; i < paramNames.length; i++) {
            var name = PluginManager.parameters(pluginName)[paramNames[i]];
            if (name) return name;
        }
        return null;
    };

    //=============================================================================
    // Parameter formatting
    //=============================================================================
    var paramButtonName = getParamString(['KeyName', 'ボタン名称']).toLowerCase();

    //=============================================================================
    // Game_Player
    //  Holding a specified key, changes the direction without moving the player.
    //=============================================================================
    var _Game_Player_executeMove = Game_Player.prototype.executeMove;
    Game_Player.prototype.executeMove = function(direction) {
        if (Input.isPressed(paramButtonName)) {
            if (direction === Input.dir4) {
                this.setDirection(direction);
            }
        } else {
            _Game_Player_executeMove.apply(this, arguments);
        }
    };
})();
 

Attachments

Last edited:

Yitzi Litt

Made Nepenthe — An RPG that's one giant dad-joke
Veteran
Joined
Jul 31, 2017
Messages
103
Reaction score
29
First Language
english
Primarily Uses
RMMV
so... what's a potential use case?
 

tale

Volunteer
Veteran
Joined
Dec 16, 2016
Messages
662
Reaction score
1,127
First Language
English
Primarily Uses
N/A
@Yitzi Litt I'm not the plugin creator however I think it can be used for events with conditional branch of facing certain directions. Potentially used for puzzles as limiting movement or conveniently place an object on a desired square. Maybe interact a follower who's behind the player.
 

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

Latest Threads

Latest Profile Posts

I FINALLY DID IT! 5 years making my very first game and I just officially released it on STEAM..... OMG..... I can say I finished a game! The feelings!!!!!
Stream will be live shortly! I am going to be playing some Among Us! Feel free to drop by!
Ami
tv program always get the ratings (it's the reason why drama series has 1000+ episode),also full and nonsense of censorship (weird blur, a scene getting cut because the unconvenient viewer,but it unconvenient to me either. you never see what the original is)

i know the reason is to take cover the viewer from the negative thing,but i just laughing and mocking of them that they're always suck :guffaw:
Star Chart Idea - Just something I am working on.
My sister learned spanish the old fashioned way and saw my way of conjugating. I don't use the formal method and just wing it. I thought her heart might explode. Apparently, different words use different endings. Weird part is even though I never learned the difference, I still can tell when the endings "look wrong".

Forum statistics

Threads
104,437
Messages
1,006,347
Members
135,958
Latest member
SitusSlotPoker
Top