查看: 4925|回复: 1

[已经解决] 请问MV有随机生成人物的插件吗?

[复制链接]
梦石
0
星屑
723
在线时间
530 小时
注册时间
2010-6-9
回帖
668
发表于 2016-3-10 23:44:03 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有账号?注册会员

×
请问MV有随机生成人物的插件吗?希望能自己取名,并兼容YEP的大部分插件,谢谢各位。
因为在数据库中人物定好了第一个工作量巨大,第二个少了随机性,再次感谢。
梦石
0
星屑
22879
在线时间
8598 小时
注册时间
2011-12-31
回帖
3270
发表于 2016-3-10 23:57:44 | 显示全部楼层
SAN_ActorGenerator
  1. //=============================================================================
  2. // SAN_ActorGenerator.js
  3. //=============================================================================
  4. // Copyright (c) 2015 Sanshiro
  5. // Released under the MIT license
  6. // [url]http://opensource.org/licenses/mit-license.php[/url]
  7. //=============================================================================

  8. /*:
  9. * @plugindesc SAN_ActorGenerator ver1.00
  10. * Generate actor by script command.
  11. * @author Sanshiro [url]https://twitter.com/rev2nym[/url]
  12. *
  13. * @help
  14. * This plugin generate actor that specified actor ID by script command.
  15. * To use each script command (function), show ActorGenerator class comment.
  16. * To use other that isn't implemented on this plugin, please make up
  17. * with event commands.
  18. *
  19. * There is no plugin parameters, no plugin commands.
  20. *
  21. * It's possible to commercial use, distribute, and modify under the MIT license.
  22. * But, don't eliminate and don't alter a comment of the beginning.
  23. * If it's good, please indicate an author name on credit.
  24. *
  25. * Author doesn't shoulder any responsibility in all kind of damage by using this.
  26. * And please don't expect support. X(
  27. */

  28. /*:ja
  29. * @plugindesc アクター生成 ver1.00
  30. * スクリプトコマンドによりアクターを生成します。
  31. * @author サンシロ [url]https://twitter.com/rev2nym[/url]
  32. * @version 1.00 2015/12/27 公開
  33. *
  34. * @help
  35. * スクリプトコマンドにより指定したアクターIDのアクターを生成します。
  36. * 各スクリプトコマンド(関数)はActorGeneratorクラスのコメントを参照してください。
  37. * このプラグインに実装されていない機能はイベントコマンドで補ってください。
  38. *
  39. * プラグインパラメータ、プラグインコマンドはありません。
  40. *
  41. * MITライセンスのもと、商用利用、改変、再配布が可能です。
  42. * ただし冒頭のコメントは削除や改変をしないでください。
  43. * よかったらクレジットに作者名を記載してください。
  44. *
  45. * これを利用したことによるいかなる損害にも作者は責任を負いません。
  46. * サポートは期待しないでください><。
  47. */

  48. var Imported = Imported || {};
  49. Imported.SAN_ActorGenerator = true;

  50. var Sanshiro = Sanshiro || {};
  51. Sanshiro.ActorGenerator = Sanshiro.ActorGenerator || {};

  52. //-----------------------------------------------------------------------------
  53. // ActorGenerator
  54. //
  55. // アクター生成クラス

  56. function ActorGenerator() {}

  57. ActorGenerator._actorIdLastGenerated = undefined;

  58. // Generate actor
  59. // アクター生成
  60. // baseActorId: Base actor's ID
  61. //              生成のベースになるアクターのアクターID
  62. // newActorId:  Generated actor's ID (can omission)
  63. //              生成されたアクターのアクターID(省略可)
  64. ActorGenerator.generateActor = function(baseActorId, newActorId) {
  65.         if(newActorId === undefined) {
  66.                 for (newActorId = $dataActors.length; !!$gameActors.data()[newActorId]; newActorId++);
  67.         }
  68.         if (!$gameActors.data()[newActorId]) {
  69.                 $gameActors.data()[newActorId] = new Game_Actor(baseActorId);
  70.                 $gameActors.data()[newActorId].setActorId(newActorId);
  71.                 this._actorIdLastGenerated = newActorId;
  72.         } else {
  73.                 this._actorIdLastGenerated = undefined;
  74.         }
  75. };

  76. // Last generated actor's ID
  77. // 最後に生成されたアクターのアクターID
  78. ActorGenerator.actorIdLastGenerated = function() {
  79.         return this._actorIdLastGenerated;
  80. };

  81. // Actor ID by party index
  82. // パーティ順番によるアクターIDの取得
  83. ActorGenerator.actorIdByPartyIndex = function(index) {
  84.         return $gameParty.allMembers()[index].actorId();
  85. };

  86. // Add actor to party
  87. // アクターのパーティ加入
  88. ActorGenerator.changePartyMemberAdd = function(actorId) {
  89.         $gameParty.addActor(actorId);
  90. };

  91. // Remove actor to party
  92. // アクターのパーティ除外
  93. ActorGenerator.changePartyMemberRemove = function(actorId) {
  94.         $gameParty.removeActor(actorId);
  95. };

  96. // Change actor's equipment
  97. // アクターの装備変更
  98. ActorGenerator.changeEquipment = function(actorId, etypeId, itemId) {
  99.         $gameActors[actorId].changeEquipById(etypeId, itemId);
  100. };

  101. // Change actor's name
  102. // アクターの名前変更
  103. ActorGenerator.changeName = function(actorId, name) {
  104.         $gameActors[actorId].setName(name);
  105. };

  106. // Change actor's class
  107. // アクターの職業変更
  108. ActorGenerator.changeClass = function(actorId, classId, keepExp) {
  109.         $gameActors[actorId].changeClass(classId, keepExp);
  110. };

  111. // Change actor's nickname
  112. // アクターのニックネーム変更
  113. ActorGenerator.changeNickname = function(actorId, nickname) {
  114.         $gameActors[actorId].setNickname(nickname);
  115. };

  116. // Change actor's profile
  117. // アクターのプロフィール変更
  118. ActorGenerator.changeProfile = function(actorId, profile) {
  119.         $gameActors[actorId].setProfile(profile);
  120. };

  121. // Change actor's face image
  122. // アクターの顔画像変更
  123. ActorGenerator.changeFaceImage = function(actorId, faceName, faceIndex) {
  124.         $gameActors[actorId].setFaceImage(faceName, faceIndex);
  125. };

  126. // Change actor's walking character image
  127. // アクターの歩行キャラ画像変更
  128. ActorGenerator.changeCharacterImage = function(actorId, characterName, characterIndex) {
  129.         $gameActors[actorId].setCharacterImage(characterName, characterIndex);
  130. };

  131. // Change actor's battler image
  132. // アクターの戦闘キャラ画像変更
  133. ActorGenerator.changeBattlerImage = function(actorId, battlerName) {
  134.         $gameActors[actorId].setBattlerImage(battlerName);
  135. };

  136. //-----------------------------------------------------------------------------
  137. // Game_Actors
  138. //
  139. // アクターズクラス

  140. // アクターズクラスのアクター(エイリアス元でアクターオブジェクト生成)
  141. Sanshiro.ActorGenerator.Game_Actors_actor = Game_Actors.prototype.actor;
  142. Game_Actors.prototype.actor = function(actorId) {
  143.         if (!!this._data[actorId]){
  144.                 return this._data[actorId];
  145.         }
  146.         return Sanshiro.ActorGenerator.Game_Actors_actor.call(this, actorId);
  147. };

  148. // アクターズクラスのアクターのリスト
  149. Game_Actors.prototype.data = function() {
  150.         return this._data;
  151. };

  152. //-----------------------------------------------------------------------------
  153. // Game_Actor
  154. //
  155. // アクタークラス

  156. // アクタークラスの初期化
  157. Sanshiro.ActorGenerator.Game_Actor_initialize = Game_Actor.prototype.initialize;
  158. Game_Actor.prototype.initialize = function(actorId) {
  159.     this._dataActorId = actorId;
  160.         Sanshiro.ActorGenerator.Game_Actor_initialize.call(this, actorId);
  161. };

  162. // アクタークラスのデータベースのデータ
  163. Game_Actor.prototype.actor = function() {
  164.     return $dataActors[this._dataActorId];
  165. };

  166. // アクタークラスのアクターIDの設定
  167. Game_Actor.prototype.setActorId = function(actorId) {
  168.         this._actorId = actorId;
  169. };
复制代码

点评

ActorGenerator.changeName请问这个函数怎么用(117行) ?我怎么填都报错can not read property "setname"of underfind  发表于 2016-3-11 08:55
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部