Показано с 1 по 10 из 113

Тема: Помощь c плагинами(JS)

Древовидный режим

Предыдущее сообщение Предыдущее сообщение   Следующее сообщение Следующее сообщение
  1. #38

    По умолчанию

    Здравствуйте. Использую для проекта на Maker MV плагин PreventPartySwap.js для блокировки положения лидера в партии. Чтобы его нельзя было сменить на другого персонажа. Но он блокирует не только попытку изменить положение лидера, но также попытки посмотреть его экипировку, состояние и навыки. Что нужно изменить, чтобы работал правильно?
    Code:

    /*:
    * @plugindesc Allows a variable and switch to specify an actor Id to be "locked"
    * to the party such that they cannot be moved with the change party command
    *
    * @help If the switch number configured in the parameters is set to ON, then
    * the actor whose Id matches the actorId variable configured in the
    * parameters cannot be moved from their position in the party.
    *
    * By default, the switch is switch number 15 and the unmovable actor is
    * actor 1.
    *
    * @param switchNumber
    * @text Prevent swap switch #
    * @type switch
    * @desc The switch number to set ON if the actorId cannot be removed
    * from the party
    * @default 15
    *
    * @param actorId
    * @text Actor Id to lock to party
    * @type number
    * @desc The Id of the actor who can't be swapped
    * @default 1
    */

    (function(module) {
    'use strict';

    var Zevia = module.Zevia || {};
    var parameters = PluginManager.parameters('PreventPartySwap');
    var switchNumber = parseInt(parameters.switchNumber);
    var actorId = parseInt(parameters.actorId);
    [switchNumber, actorId].forEach(function(requiredParameter, index) {
    if (isNaN(requiredParameter)) {
    throw new Error(
    'Configuration Error: PreventPartySwap requires a valid switch number and actorId to be' +
    ' specified in the setup parameters, but ' + requiredParameter + ' is not a valid value'
    );
    }
    });

    Zevia.menuProcessOk = Window_MenuStatus.prototype.processOk;
    Window_MenuStatus.prototype.processOk = function() {
    if ($gameSwitches.value(switchNumber) && $gameParty.members()[this.index()].actorId() === actorId) {
    SoundManager.playBuzzer();
    return;
    }
    Zevia.menuProcessOk.call(this);
    };
    })(window);
    Последний раз редактировалось WishM; 10.04.2024 в 22:54.

Информация о теме

Пользователи, просматривающие эту тему

Эту тему просматривают: 1 (пользователей: 0 , гостей: 1)

Метки этой темы

Социальные закладки

Социальные закладки

Ваши права

  • Вы не можете создавать новые темы
  • Вы не можете отвечать в темах
  • Вы не можете прикреплять вложения
  • Вы не можете редактировать свои сообщения
  •  
Помощь c плагинами(JS)