Skip to content

Instantly share code, notes, and snippets.

View triacontane's full-sized avatar

トリアコンタン triacontane

View GitHub Profile
@triacontane
triacontane / SaveWindowResize.js
Created August 23, 2023 13:25
セーブ画面のウィンドウサイズを変更するためのプラグイン
/*:
* @plugindesc Changes the size of the save window in RPG Maker MZ.
* @author YourName
* @target MZ
*
* @param Window Width
* @desc The width of the save window.
* @type number
* @default 816
*
@triacontane
triacontane / HideSaveHelpWindow.js
Created August 23, 2023 13:13
セーブ画面のヘルプウィンドウを非表示にします
/*:
* @plugindesc セーブ画面のヘルプウィンドウを非表示にします
* @author ChatGPT
* @target MZ
*
* @help
* このプラグインをプラグインマネージャで追加するだけで、
* セーブ画面およびロード画面のヘルプウィンドウが非表示になります。
*/
@triacontane
triacontane / TitleCommandWidthMZ.js
Last active September 12, 2023 14:59
タイトルコマンドのウィンドウ幅を変更します。
/*:
* @target MZ
* @plugindesc Changes the width of the title command window.
* @orderBefore NRP_N_TitleMap
*
* @param width
* @text Window Width
* @desc The width of the title command window.
* @type number
* @default 400
@triacontane
triacontane / PictureStop.js
Created June 14, 2023 14:02
指定されたスイッチがONのとき指定された番号のピクチャの動きを止める
(function(alias) {
Game_Picture.prototype.update = function() {
if (!$gameSwitches.value(1) || $gameScreen.picture(1) !== this) alias.apply(this, arguments);
};
})(Game_Picture.prototype.update);
@triacontane
triacontane / SellEquip.js
Created June 11, 2023 12:32
所持している武器と防具をすべて売却する
var allItems = $gameParty.allItems();
for (var i = 0; i < allItems.length; i++) {
var item = allItems[i];
if (DataManager.isWeapon(item) || DataManager.isArmor(item)) {
var num = $gameParty.numItems(item);
var price = Math.floor(item.price / 2);
$gameParty.gainGold(price * num);
$gameParty.loseItem(item, num);
}
}
@triacontane
triacontane / RemoveAnimationMv.js
Created June 3, 2023 05:58
IDを指定して再生中のアニメーションを消去
SceneManager._scene._spriteset._characterSprites.forEach(function(sprite) {
if (sprite._character instanceof Game_Player) {
sprite._animationSprites.forEach(function(animation) {
if (animation._animation.id === 28) {
animation.remove();
}
});
}
});
@triacontane
triacontane / GetStateRate.js
Created May 27, 2023 08:37
ステート有効度を取得するスクリプト
$gameActors.actor(1).stateRate(4) * 100
@triacontane
triacontane / ChackSeccion.rpgmv
Created May 7, 2023 06:29
実行時にロードを挟んでいるかどうかのチェック
◆スクリプト:$gameTemp.session = true;
◆セーブ画面を開く
◆注釈:セーブ前と同一セッションだった場合はここを通る
:  :ロードし直した場合は通らない
◆条件分岐:スクリプト:$gameTemp.session
◆タイトル画面に戻す
:それ以外のとき
◆場所移動:転移の間 (10,13)
@triacontane
triacontane / ActorNameChange.js
Created March 22, 2023 14:47
アクターの名前をスクリプトから変更(by GPT-4)
// アクターのID (1, 2, 3, ...) と新しい名前を指定
const actorId = 1;
const newName = "新しい名前";
// アクターを取得し、名前を変更
const actor = $gameActors.actor(actorId);
if (actor) {
actor.setName(newName);
}
@triacontane
triacontane / ShowTouchUIForNumberInput.js
Created March 16, 2023 23:53
キー入力でイベントを起動させた場合もタッチUIを表示(GPT-4で出力)
/*:
* @plugindesc Show touch UI for number input when triggered by key input
* @author YourName
*
* @help This plugin does not have any plugin commands.
* Generated by GPT-4
*/
(function() {
var _Window_NumberInput_start = Window_NumberInput.prototype.start;