查看: 4056|回复: 2

[有事请教] 关于Kaus Ultimate Overlay图层插件的求教!

[复制链接]
梦石
0
星屑
8201
在线时间
1331 小时
注册时间
2006-7-18
回帖
460
发表于 2018-8-8 15:14:29 | 显示全部楼层 |阅读模式

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

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

×
在别的帖子里找到的,新开一个空白工程测试时,安装插件,什么都没动没设置,打开游戏直接出现错误: 错误.jpg
要怎么整啊!难道是MV 1.5版本不能用?

代码如下
  1. //=============================================================================
  2. // Kaus Ultimate Overlay
  3. // Kaus_Ultimate_Overlay.js
  4. // Version: 1.07
  5. // Date Created: October 31, 2015
  6. // Scripted By: Kaus
  7. //=============================================================================

  8. var Imported = Imported || {};
  9. Imported.Kaus_Ultimate_Overlay = 1.07;

  10. //=============================================================================
  11. /*:
  12. * @plugindesc v1.07 Adds Overlay Images on the Map. (Ground,Parallax,Shadow,Light,Fog)
  13. * @author Kaus
  14. *
  15. * @param -F I L E  N A M E S-
  16. * @default
  17. * @param Organized Folders
  18. * @desc Use different folders for each layers instead of using default folder 'parallaxes'
  19. * Default: false
  20. * @default false
  21. * @param Parallax Filename
  22. * @desc filename used for displaying Parallax Images  
  23. * Default: par
  24. * @default par
  25. * @param Ground Filename
  26. * @desc filename used for displaying Ground Images
  27. * Default: ground
  28. * @default ground
  29. * @param Light Filename
  30. * @desc filename used for displaying Light Images
  31. * Default: light
  32. * @default light
  33. * @param Shadow Filename
  34. * @desc filename used for displaying Shadow Images
  35. * Default: shadow
  36. * @default shadow
  37. * @param -S E T T I N G S-
  38. * @default
  39. * @param Light Opacity
  40. * @desc Opacity that Light Images use.  
  41. * Default:185
  42. * @default 185
  43. * @param Quick Start
  44. * @desc Starts the game with the switches on automatically to avoid fade in transition.
  45. * Default:true
  46. * @default true
  47. * @param Bind Pictures
  48. * @desc NOTE: Kaus_Ultimate_Overlay should be placed BELOW Galenmereth's Bind Pictures in order to work.
  49. * Default:false
  50. * @default false
  51. * @param Terrax Lighting
  52. * @desc NOTE: Kaus_Ultimate_Overlay should be placed BELOW Terrax Lighting in order to work.
  53. * Default:false
  54. * @default false
  55. * @param -S W I T C H E S-
  56. * @default
  57. * @param Fog Switch ID
  58. * @desc Overlay Switch ID used for displaying Fog
  59. * Default:1
  60. * @default 1
  61. * @param Light Switch ID
  62. * @desc Overlay Switch ID used for displaying Light
  63. * Default:2
  64. * @default 2
  65. * @param Parallax Switch ID
  66. * @desc Overlay Switch ID used for displaying Parallax
  67. * Default:3
  68. * @default 3
  69. * @param Shadow Switch ID
  70. * @desc Overlay Switch ID used for displaying Shadow
  71. * Default:4
  72. * @default 4
  73. *
  74. *@help
  75. * ============================================================================
  76. * Introduction
  77. * ============================================================================
  78. *
  79. * This plugin lets you add overlay images on your map.
  80. * You have a choice of 5 different layers on the map to put your custom images
  81. *
  82. * ============================================================================
  83. * Filename and Use Instructions
  84. * ============================================================================
  85. * By Default:
  86. * All images must be saved in img/Parallaxes Folder.
  87. * ground,par,shadow and light overlays must be named designated to their mapID
  88. * For example: display a parallax map and light in MapID:002
  89. * Name your files par2 and light 2 and save it in img/Parallaxes Folder
  90. *
  91. * If Parameter Option: Organized Folders is set to true
  92. * Create the ff. new folders:
  93. * (img/overlays/grounds)
  94. * (img/overlays/pars)
  95. * (img/overlays/shadows)
  96. * (img/overlays/lights)
  97. * (img/overlays/fog)
  98. * And all the overlay images you will use should be inside those folders
  99. * specific to their layer type.
  100. *
  101. * ============================================================================
  102. * Notetags Instructions
  103. * ============================================================================
  104. * Note: Input your notetags inside the map properties. The following notetags
  105. *       is case sensitive and space sensitive.
  106. *
  107. *  <all>               display all 3 overlays (ground,par,light)
  108. *  <ground>            display ground layer.
  109. *  <par>               display parallax layer.
  110. *  <light>             display light layer.
  111. *  <shadow>            display shadow layer.
  112. *  <fogName:filename>  display the chosen fog.
  113. *  <fogBlend:number>   (OPTIONAL) changes the blend type of fog 0:NORMAL 1:ADD
  114. *  <fogDuration:number>(OPTIONAL) makes a transition depending on value = frames.before completing opacity.
  115. *  <xMove:number>      (OPTIONAL) moves the fog left or right (+ moves right, - moves left)
  116. *  <yMove:number>      (OPTIONAL) moves the fog up or down (+ moves down, - moves up)
  117. *
  118. *
  119. * LAYERS:
  120. * Light Layer    is the highest layer and used for creating Light Effects such as Sunlight Rays, or Street Lights, etc.
  121. * Fog Layer      is used for creating a Fog Effect in much that is moving automatically by settings. Used for Mists Clouds etc.
  122. * Shadow Layer   is used for creating shadow effects.
  123. * Parallax Layer is used for adding an image in the map that will be OVER the character.
  124. * Ground Layer   like Parallax Layer it is used for creating custom images but UNDER your characters.
  125. *
  126. *
  127. *
  128. * ============================================================================
  129. * Plugin Command Instructions
  130. * ============================================================================
  131. * To change the layer in current map use this Plugin Command;
  132. * Call Plugin Command thru event then type the following Arguments:
  133. *
  134. * Overlay layertype filename
  135. *      for example: Overlay light light2-1
  136. *
  137. * Layer Types:
  138. * ground = for ground layer
  139. * par = for parallax layer
  140. * shadow = for shadow layer
  141. * light = for light layer
  142. * fog = for fog layer
  143. *
  144. * Calling a new fog has its own arguments: (blendmode and duration is optional and doesnt need to have a value)
  145. *
  146. * Arguments:  Overlay fog filename opacity xMove yMove blendmode duration
  147. * Examples:
  148. *             Overlay fog mist2 155 1 -0.5   //Displays 'mist2' fog in 155 Opacity that moves position x to 1 and y to -0.5 every frame.
  149. *             Overlay fog shade 130 0 0 1 60 //Displays 'shade' fog in 130 Opacity, additive blend, doesnt move, fades in w/in 60 frames.
  150. *
  151. * 1.07 New Feature: Fog Fade Out
  152. * Function:  Fades out the current fog displayed over the duration.
  153. * Arguments: Overlay fadeout duration
  154. * Examples:  Overlay fadeout 120       //Fades out the current fog over 120 frames.
  155. *
  156. * NOTE: -Changing Layer Images DOESN'T REQUIRE notetags in the map to display BUT REQUIRES switches.
  157. *       -DO NOT USE Overlay fadeout if you have map notetags exist in a map as it will not work and map notetags will persist
  158. *        to display its function. USE fog switches to turn off the display of the fog completely.
  159. */

  160. (function() {

  161. function boolFunc(str) {
  162.     return Function("return " + str + " === true")();
  163.   }

  164. var parameters = PluginManager.parameters('Kaus_Ultimate_Overlay');
  165. var parallax_FN = String(parameters['Parallax Filename']);
  166. var ground_FN = String(parameters['Ground Filename']);
  167. var light_FN = String(parameters['Light Filename']);
  168. var shadow_FN = String(parameters['Shadow Filename']);
  169. var light_OP = Number(parameters['Light Opacity']);
  170. var fogSwitch = Number(parameters['Fog Switch ID']);
  171. var lightSwitch = Number(parameters['Light Switch ID']);
  172. var parSwitch = Number(parameters['Parallax Switch ID']);
  173. var shadowSwitch = Number(parameters['Shadow Switch ID']);
  174. var startSwitch = boolFunc(parameters['Quick Start']);
  175. var useBindPictures = boolFunc(parameters['Bind Pictures']);
  176. var useTerrax = boolFunc(parameters['Terrax Lighting'])
  177. var useFolder = boolFunc(parameters['Organized Folders'])

  178. var overlayType = "";
  179. var overlayName = "";
  180. var overlayOpacity = 0;
  181. var overlayxMove = 0;
  182. var overlayyMove = 0;
  183. var overlayDuration;
  184. var overlayBlend = 0;
  185. var overlayFadeOut = false;
  186. var fogFadeOut;

  187. Spriteset_Map.prototype.createLowerLayer = function() {
  188.     Spriteset_Base.prototype.createLowerLayer.call(this);
  189.     overlayType = "";
  190.     overlayName = "";
  191.     overlayOpacity = 0;
  192.     overlayxMove = 0;
  193.     overlayyMove = 0;
  194.     overlayBlend = 0;
  195.     overlayFadeOut = false;
  196.     overlayDuration;
  197.     fogFadeOut;
  198.     map = $dataMap;
  199.     if(startSwitch==true){
  200.         $gameSwitches.setValue(parSwitch,true);
  201.         $gameSwitches.setValue(lightSwitch,true);
  202.         $gameSwitches.setValue(fogSwitch,true);
  203.         $gameSwitches.setValue(shadowSwitch,true);
  204.     }
  205.     if(useBindPictures==true) this.createPicturesLayer('bottom', this._baseSprite);
  206.     this.createParallax();
  207.     if(useBindPictures==true) this.createPicturesLayer('below_tilemap', this._baseSprite);
  208.     this.createTilemap();
  209.     this.createGroundMap();
  210.     if(useBindPictures==true) this.createPicturesLayer('below_characters', this._tilemap);
  211.     this.createCharacters();
  212.     if(useBindPictures==true) this.createPicturesLayer('above_characters', this);
  213.     this.createParMap();
  214.     this.createShadowMap();
  215.     this.createFogMap();
  216.     this.createLightMap();
  217.     this.createShadow();
  218.     if(useBindPictures==true) this.createPicturesLayer('below_weather', this._tilemap, 8);
  219.     this.createWeather();
  220.     if(useBindPictures==true) this.createPicturesLayer('top', this);
  221.     if(useTerrax==true) this.createLightmask();   
  222.     this.createDestination();
  223. };


  224. Spriteset_Map.prototype.update = function() {
  225.     Spriteset_Base.prototype.update.call(this);
  226.     this.updateTileset();
  227.     this.updateGroundMap();
  228.     this.updateParallax();
  229.     this.updateParMap();
  230.     this.updateShadowMap();
  231.     this.updateFogMap();
  232.     this.updateLightMap();
  233.     this.updateTilemap();
  234.     this.updateShadow();
  235.     this.updateWeather();
  236.     if(useBindPictures==true) this.updatePictures();
  237. };        
  238. //==================== G R O U N D  M A P ======================   
  239. Spriteset_Map.prototype.createGroundMap = function() {
  240.     this._groundMap = new TilingSprite();
  241.     if(map.meta.ground || map.meta.all){
  242.         if(useFolder) this._groundMap.bitmap = ImageManager.loadBitmap('img/overlays/grounds/',ground_FN+$gameMap.mapId());
  243.         else this._groundMap.bitmap = ImageManager.loadParallax(ground_FN+$gameMap.mapId());
  244.     };
  245.     this._groundMap.move(0, 0, Graphics.width, Graphics.height);
  246.     this._groundMap.z = 1;
  247.     this._tilemap.addChild(this._groundMap);
  248.     };

  249. Spriteset_Map.prototype.updateGroundMap = function() {
  250.         this._groundMap.origin.x =  $gameMap.displayX() * $gameMap.tileWidth();
  251.         this._groundMap.origin.y =  $gameMap.displayY() * $gameMap.tileHeight();
  252.         //Plugin Command Update
  253.        if(overlayType=="ground"){
  254.            if(useFolder) this._groundMap.bitmap = ImageManager.loadBitmap('img/overlays/grounds/',overlayName);
  255.            else this._groundMap.bitmap = ImageManager.loadParallax(overlayName);
  256.        }
  257.     };


  258. //======================= P A R  M A P =========================   
  259. Spriteset_Map.prototype.createParMap = function() {
  260.     this._parMap = new TilingSprite();
  261.     if(map.meta.par || map.meta.all){
  262.         if(useFolder) this._parMap.bitmap = ImageManager.loadBitmap('img/overlays/pars/',parallax_FN+$gameMap.mapId());
  263.         else this._parMap.bitmap = ImageManager.loadParallax(parallax_FN+$gameMap.mapId());
  264.     };
  265.     this._parMap.move(0, 0, Graphics.width, Graphics.height);
  266.     this._parMap.z = 20
  267.     this._tilemap.addChild(this._parMap);
  268.     if($gameSwitches.value(parSwitch)== true)
  269.       this._parMap.opacity = 255;
  270.      else
  271.       this._parMap.opacity = 0;
  272. };

  273. Spriteset_Map.prototype.updateParMap = function() {
  274.         this._parMap.origin.x =  $gameMap.displayX() * $gameMap.tileWidth();
  275.         this._parMap.origin.y =  $gameMap.displayY() * $gameMap.tileHeight();
  276.        //Switch Checking
  277.        if($gameSwitches.value(parSwitch)== true){
  278.         if(this._parMap.opacity < 255) this._parMap.opacity += 10; }
  279.      else
  280.         if(this._parMap.opacity!=0) this._parMap.opacity -= 10;

  281.     //Plugin Command Update
  282.      if(overlayType=="par"){
  283.         if(useFolder) this._parMap.bitmap = ImageManager.loadBitmap('img/overlays/pars/',overlayName);
  284.         else this._parMap.bitmap = ImageManager.loadParallax(overlayName);
  285.     };
  286. };


  287. //======================= S H A D O W  M A P =========================   
  288. Spriteset_Map.prototype.createShadowMap = function() {
  289.     this._shadowMap = new TilingSprite();
  290.      if(map.meta.shadow || map.meta.all){
  291.          if(useFolder) this._shadowMap.bitmap = ImageManager.loadBitmap('img/overlays/shadows/',shadow_FN+$gameMap.mapId());
  292.          else this._shadowMap.bitmap = ImageManager.loadParallax(shadow_FN+$gameMap.mapId());
  293.      }
  294.     this._shadowMap.move(0, 0, Graphics.width, Graphics.height);
  295.     this._shadowMap.z = 21
  296.     this._tilemap.addChild(this._shadowMap);
  297.     if($gameSwitches.value(shadowSwitch)== true)
  298.       this._shadowMap.opacity = 255;
  299.      else
  300.       this._shadowMap.opacity = 0;
  301. };

  302. Spriteset_Map.prototype.updateShadowMap = function() {
  303.         this._shadowMap.origin.x =  $gameMap.displayX() * $gameMap.tileWidth();
  304.         this._shadowMap.origin.y =  $gameMap.displayY() * $gameMap.tileHeight();
  305.        //Switch Checking
  306.        if($gameSwitches.value(shadowSwitch)== true){
  307.         if(this._shadowMap.opacity < 255) this._shadowMap.opacity += 10; }
  308.      else
  309.         if(this._shadowMap.opacity!=0) this._shadowMap.opacity -= 10;

  310.     //Plugin Command Update
  311.      if(overlayType=="shadow"){
  312.         if(useFolder) this._shadowMap.bitmap = ImageManager.loadBitmap('img/overlays/shadows/',overlayName);
  313.          else this._shadowMap.bitmap = ImageManager.loadParallax(overlayName);
  314.      };
  315. };

  316. //===================== L I G H T  M A P =======================
  317. Spriteset_Map.prototype.createLightMap = function() {
  318.     map = $dataMap;
  319.     this._lightMap = new TilingSprite();
  320.      if(map.meta.light || map.meta.all){
  321.         if(useFolder) this._lightMap.bitmap = ImageManager.loadBitmap('img/overlays/lights/',light_FN+$gameMap.mapId());
  322.          else this._lightMap.bitmap = ImageManager.loadParallax(light_FN+$gameMap.mapId());
  323.      };
  324.     this._lightMap.move(0, 0, Graphics.width, Graphics.height);
  325.     this._lightMap.blendMode = 1;
  326.     this._lightMap.z = 23;
  327.     this._tilemap.addChild(this._lightMap);
  328.     if($gameSwitches.value(lightSwitch)== true)
  329.       this._lightMap.opacity = light_OP;
  330.      else
  331.       this._lightMap.opacity = 0;
  332. };

  333. Spriteset_Map.prototype.updateLightMap = function() {
  334.         this._lightMap.origin.x =  $gameMap.displayX() * $gameMap.tileWidth();
  335.         this._lightMap.origin.y =  $gameMap.displayY() * $gameMap.tileHeight();
  336.         //Switch Checking
  337.        if($gameSwitches.value(lightSwitch)== true){
  338.         if(this._lightMap.opacity < light_OP) this._lightMap.opacity += 1; }
  339.      else
  340.         if(this._lightMap.opacity!=0) this._lightMap.opacity -= 1;

  341.     //Plugin Command Update
  342.      if(overlayType=="light"){
  343.         if(useFolder) this._lightMap.bitmap = ImageManager.loadBitmap('img/overlays/lights/',overlayName);
  344.          else this._lightMap.bitmap = ImageManager.loadParallax(overlayName);
  345.          };
  346. };


  347. //======================= F O G  M A P ==========================
  348. Spriteset_Map.prototype.createFogMap = function() {
  349.     map = $dataMap;
  350.     this._fogMap = new TilingSprite();
  351.     if(map.meta.fogName){
  352.         if(useFolder) this._fogMap.bitmap = ImageManager.loadBitmap('img/overlays/fogs/',map.meta.fogName);
  353.         else this._fogMap.bitmap = ImageManager.loadParallax(map.meta.fogName);
  354.     };
  355.     this._fogMap.move(0, 0, Graphics.width, Graphics.height);
  356.     this._fogMap.blendMode = Number(map.meta.fogBlend) || 0;
  357.     this._fogMap.opacity = 0;
  358.     this._fogMap.origin.x =  $gameMap.displayX() * $gameMap.tileWidth();
  359.     this._fogMap.origin.y =  $gameMap.displayY() * $gameMap.tileHeight();
  360.     this._fogMap.z = 22;
  361.     newX = 0;
  362.     newY = 0;
  363.     this._tilemap.addChild(this._fogMap);
  364. };

  365. Spriteset_Map.prototype.updateFogMap = function() {
  366.         map = $dataMap;
  367.         if(overlayBlend!=0) this._fogMap.blendMode = 1;
  368.         if(overlayxMove!=0){ newX += Number(overlayxMove); }
  369.          else newX += Number(map.meta.xMove) || 0;
  370.         if(overlayyMove!=0){ newY += Number(overlayyMove); }
  371.          else newY += Number(map.meta.yMove) || 0;
  372.         if(newX!=0) this._fogMap.origin.x =  ($gameMap.displayX() * $gameMap.tileWidth()) - newX;
  373.          else this._fogMap.origin.x =  ($gameMap.displayX() * $gameMap.tileWidth());
  374.         if(newY!=0) this._fogMap.origin.y =  ($gameMap.displayY() * $gameMap.tileHeight()) - newY;
  375.          else this._fogMap.origin.y =  ($gameMap.displayY() * $gameMap.tileHeight());
  376.     //Switch Checking
  377.      if($gameSwitches.value(fogSwitch)== true){
  378.          if(overlayOpacity!=0){ //if plugin call opacity exist
  379.           defOpacity = Number(overlayOpacity); }
  380.           else{ //if not
  381.            defOpacity = Number(map.meta.fogOpacity); }
  382.          if(overlayDuration){ //if plugin call duration exist
  383.              fogDuration = overlayDuration; }
  384.           else{ //if not
  385.               fogDuration = Number(map.meta.fogDuration) || 1 ;  }
  386.          fogTransition = defOpacity / fogDuration;
  387.      }
  388.     else if(this._fogMap.opacity!=0) this._fogMap.opacity -= 10;
  389.     // Transition Effect
  390.     if(overlayFadeOut){ // Fade Out
  391.                fogTransition = defOpacity / fogFadeOut;
  392.                if(this._fogMap.opacity!=0) this._fogMap.opacity -= fogTransition;
  393.                else if(this._fogMap.opacity==0){ //reset variables if opacity is 0
  394.                    overlayFadeOut = false;
  395.                    overlayOpacity = 0;
  396.                }
  397.          }
  398.     else if(this._fogMap.opacity < defOpacity){ //Fade In
  399.              this._fogMap.opacity += fogTransition;
  400.          }
  401.     //Plugin Command Update
  402.      if(overlayType=="fog"){
  403.         if(useFolder) this._fogMap.bitmap = ImageManager.loadBitmap('img/overlays/fogs/',overlayName);
  404.          else this._fogMap.bitmap = ImageManager.loadParallax(overlayName);
  405.      };
  406. };

  407. //====================P L U G I N   C O M M A N D==================
  408.     var _GameInterpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
  409.     Game_Interpreter.prototype.pluginCommand = function (command, args) {
  410.           _GameInterpreter_pluginCommand.call(this, command, args);
  411.           if (command == "Overlay") {
  412.             if (args[0] == "fog") { //Fog Call
  413.                     if (args[1]) { //filename
  414.                       if (args[2]){ //opacity
  415.               if (args[3]){ //xMove
  416.                 if (args[4]){ //yMove
  417.                     overlayType = args[0];
  418.                     overlayName = args[1];
  419.                     overlayOpacity = args[2];
  420.                     overlayxMove = args[3];
  421.                     overlayyMove = args[4];
  422.                     if (args[5]) overlayBlend = args[5]; //fogBlend
  423.                     if (args[6]) overlayDuration = args[6]; //fogDuration
  424.               }
  425.             }
  426.           }
  427.                     }
  428.             } else if(args[0] == "fadeout" ){ //fog fadeout
  429.           if (args[1]){
  430.               overlayFadeOut = true;
  431.               fogFadeOut = args[1]; //fadeout duration
  432.           }
  433.       }
  434.         else if(args[0]){ //layer type
  435.           if (args[1]) { //filename
  436.                 overlayType = args[0];
  437.                 overlayName = args[1];
  438.           }
  439.       }
  440.           }//Command Overlay End
  441.   };

  442. })();
复制代码

老黄鸡

梦石
4
星屑
46133
在线时间
7978 小时
注册时间
2009-7-6
回帖
13342

MZ评测员RM创作大赛01组委会开拓者贵宾

发表于 2018-8-8 20:01:41 | 显示全部楼层
出错的时候按F8,把里面console标签(没动过的话默认是这个表情)的内容截下来,光截画面看不出什么东西的。
这个插件写的很怪,他这个defOpacity难不成是window.defOpacity
RGDirect - DirectX驱动的RGSS,点我了解.
(排满,暂停)RM全系列成套系统定制请联系QQ1213237796
不接受对其他插件维护的委托
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部