求大佬解答RPG maker中制作位移插件的一些问题,重谢!
rpgmaker吧
全部回复
仅看楼主
level 1
各位大佬们好,小弟刚接触RPG maker。准备制作一款武器,名叫鞭子。
作用1:可以让玩家通过拖拽的方式到一些去不了的地方。
2:可以然玩家拽一些东西过来来解谜。
3:可以攻击敌人。
但是事与愿违。我连最简单的传送都写不出来。
这是我现在写的代码。主要还是想实现位移。
/*:
* @plugindesc This plugin will apply the functions of whip.
*
* @author Guanfang Dong
*
* @param Attack distance
* @desc It will determine the maximum distance that emermy will be attacked.
* @default 5
* @param Teleport Start AnimationId
* @text Teleport Start AnimationId
* @desc Teleport Start AnimationId
* @type animation
* @default 117
*
* @param Teleport End AnimationId
* @text Teleport End AnimationId
* @desc Teleport End AnimationId
* @type animation
* @default 120
*/
(function(){
var params = PluginManager.parameters("Whip");
var startAnimId = Number(params["Teleport Start AnimationId"]) || 117;
var endAnimId = Number(params["Teleport End AnimationId"]) || 120;
var distance = Number(params["Attack distance"]);
var _Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
Game_Interpreter.prototype.pluginCommand = function (command, args) {
_Game_Interpreter_pluginCommand.call(this, command, args);
switch (command) {
case "registerTeleportPlace":
var mapid = Number(args[0]);
var player_x = Number($gamePlayer.x);
var player_y = Number($gamePlayer.y);
$gameMap.mndRegisterTeleportPlace(mapid, player_x+distance, player_y);
break;
default:
break;
}
}
Scene_ItemBase.prototype.onTeleport = function (){
if (Input.isPressed("b")){
var mapid = Number(args[0]);
var player_x = Number($gamePlayer.x);
var player_y = Number($gamePlayer.y);
$gamePlayer.reserveTransfer(mapid, player_x+distance, player_y, 0, 0);
}
};
})();
想问一下这样的思路是否正确,或者各位大佬有什么思路可以告知小弟一下么?
谢谢各位!!
2018年01月25日 02点01分 1
1