设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 2632|回复: 2
打印 上一主题 下一主题

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

[复制链接]

Lv4.逐梦者

梦石
0
星屑
6380
在线时间
920 小时
注册时间
2006-7-18
帖子
505
跳转到指定楼层
1
发表于 2018-8-8 15:14:29 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

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

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

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

代码如下
JAVASCRIPT 代码复制
  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.  
  9. var Imported = Imported || {};
  10. Imported.Kaus_Ultimate_Overlay = 1.07;
  11.  
  12. //=============================================================================
  13. /*:
  14.  * @plugindesc v1.07 Adds Overlay Images on the Map. (Ground,Parallax,Shadow,Light,Fog)
  15.  * @author Kaus
  16.  *
  17.  * @param -F I L E  N A M E S-
  18.  * @default
  19.  * @param Organized Folders
  20.  * @desc Use different folders for each layers instead of using default folder 'parallaxes'
  21.  * Default: false
  22.  * @default false
  23.  * @param Parallax Filename
  24.  * @desc filename used for displaying Parallax Images  
  25.  * Default: par
  26.  * @default par
  27.  * @param Ground Filename
  28.  * @desc filename used for displaying Ground Images
  29.  * Default: ground
  30.  * @default ground
  31.  * @param Light Filename
  32.  * @desc filename used for displaying Light Images
  33.  * Default: light
  34.  * @default light
  35.  * @param Shadow Filename
  36.  * @desc filename used for displaying Shadow Images
  37.  * Default: shadow
  38.  * @default shadow
  39.  * @param -S E T T I N G S-
  40.  * @default
  41.  * @param Light Opacity
  42.  * @desc Opacity that Light Images use.  
  43.  * Default:185
  44.  * @default 185
  45.  * @param Quick Start
  46.  * @desc Starts the game with the switches on automatically to avoid fade in transition.
  47.  * Default:true
  48.  * @default true
  49.  * @param Bind Pictures
  50.  * @desc NOTE: Kaus_Ultimate_Overlay should be placed BELOW Galenmereth's Bind Pictures in order to work.
  51.  * Default:false
  52.  * @default false
  53.  * @param Terrax Lighting
  54.  * @desc NOTE: Kaus_Ultimate_Overlay should be placed BELOW Terrax Lighting in order to work.
  55.  * Default:false
  56.  * @default false
  57.  * @param -S W I T C H E S-
  58.  * @default
  59.  * @param Fog Switch ID
  60.  * @desc Overlay Switch ID used for displaying Fog
  61.  * Default:1
  62.  * @default 1
  63.  * @param Light Switch ID
  64.  * @desc Overlay Switch ID used for displaying Light
  65.  * Default:2
  66.  * @default 2
  67.  * @param Parallax Switch ID
  68.  * @desc Overlay Switch ID used for displaying Parallax
  69.  * Default:3
  70.  * @default 3
  71.  * @param Shadow Switch ID
  72.  * @desc Overlay Switch ID used for displaying Shadow
  73.  * Default:4
  74.  * @default 4
  75.  *
  76.  *@help
  77.  * ============================================================================
  78.  * Introduction
  79.  * ============================================================================
  80.  *
  81.  * This plugin lets you add overlay images on your map.
  82.  * You have a choice of 5 different layers on the map to put your custom images
  83.  *
  84.  * ============================================================================
  85.  * Filename and Use Instructions
  86.  * ============================================================================
  87.  * By Default:
  88.  * All images must be saved in img/Parallaxes Folder.
  89.  * ground,par,shadow and light overlays must be named designated to their mapID
  90.  * For example: display a parallax map and light in MapID:002
  91.  * Name your files par2 and light 2 and save it in img/Parallaxes Folder
  92.  *
  93.  * If Parameter Option: Organized Folders is set to true
  94.  * Create the ff. new folders:
  95.  * (img/overlays/grounds)
  96.  * (img/overlays/pars)
  97.  * (img/overlays/shadows)
  98.  * (img/overlays/lights)
  99.  * (img/overlays/fog)
  100.  * And all the overlay images you will use should be inside those folders
  101.  * specific to their layer type.
  102.  *
  103.  * ============================================================================
  104.  * Notetags Instructions
  105.  * ============================================================================
  106.  * Note: Input your notetags inside the map properties. The following notetags
  107.  *       is case sensitive and space sensitive.
  108.  *
  109.  *  <all>               display all 3 overlays (ground,par,light)
  110.  *  <ground>            display ground layer.
  111.  *  <par>               display parallax layer.
  112.  *  <light>             display light layer.
  113.  *  <shadow>            display shadow layer.
  114.  *  <fogName:filename>  display the chosen fog.
  115.  *  <fogBlend:number>   (OPTIONAL) changes the blend type of fog 0:NORMAL 1:ADD
  116.  *  <fogDuration:number>(OPTIONAL) makes a transition depending on value = frames.before completing opacity.
  117.  *  <xMove:number>      (OPTIONAL) moves the fog left or right (+ moves right, - moves left)
  118.  *  <yMove:number>      (OPTIONAL) moves the fog up or down (+ moves down, - moves up)
  119.  *
  120.  *
  121.  * LAYERS:
  122.  * Light Layer    is the highest layer and used for creating Light Effects such as Sunlight Rays, or Street Lights, etc.
  123.  * Fog Layer      is used for creating a Fog Effect in much that is moving automatically by settings. Used for Mists Clouds etc.
  124.  * Shadow Layer   is used for creating shadow effects.
  125.  * Parallax Layer is used for adding an image in the map that will be OVER the character.
  126.  * Ground Layer   like Parallax Layer it is used for creating custom images but UNDER your characters.
  127.  *
  128.  *
  129.  *
  130.  * ============================================================================
  131.  * Plugin Command Instructions
  132.  * ============================================================================
  133.  * To change the layer in current map use this Plugin Command;
  134.  * Call Plugin Command thru event then type the following Arguments:
  135.  *
  136.  * Overlay layertype filename
  137.  *      for example: Overlay light light2-1
  138.  *
  139.  * Layer Types:
  140.  * ground = for ground layer
  141.  * par = for parallax layer
  142.  * shadow = for shadow layer
  143.  * light = for light layer
  144.  * fog = for fog layer
  145.  *
  146.  * Calling a new fog has its own arguments: (blendmode and duration is optional and doesnt need to have a value)
  147.  *
  148.  * Arguments:  Overlay fog filename opacity xMove yMove blendmode duration
  149.  * Examples:
  150.  *             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.
  151.  *             Overlay fog shade 130 0 0 1 60 //Displays 'shade' fog in 130 Opacity, additive blend, doesnt move, fades in w/in 60 frames.
  152.  *
  153.  * 1.07 New Feature: Fog Fade Out
  154.  * Function:  Fades out the current fog displayed over the duration.
  155.  * Arguments: Overlay fadeout duration
  156.  * Examples:  Overlay fadeout 120       //Fades out the current fog over 120 frames.
  157.  *
  158.  * NOTE: -Changing Layer Images DOESN'T REQUIRE notetags in the map to display BUT REQUIRES switches.
  159.  *       -DO NOT USE Overlay fadeout if you have map notetags exist in a map as it will not work and map notetags will persist
  160.  *        to display its function. USE fog switches to turn off the display of the fog completely.
  161.  */
  162.  
  163. (function() {
  164.  
  165. function boolFunc(str) {
  166.     return Function("return " + str + " === true")();
  167.   }
  168.  
  169. var parameters = PluginManager.parameters('Kaus_Ultimate_Overlay');
  170. var parallax_FN = String(parameters['Parallax Filename']);
  171. var ground_FN = String(parameters['Ground Filename']);
  172. var light_FN = String(parameters['Light Filename']);
  173. var shadow_FN = String(parameters['Shadow Filename']);
  174. var light_OP = Number(parameters['Light Opacity']);
  175. var fogSwitch = Number(parameters['Fog Switch ID']);
  176. var lightSwitch = Number(parameters['Light Switch ID']);
  177. var parSwitch = Number(parameters['Parallax Switch ID']);
  178. var shadowSwitch = Number(parameters['Shadow Switch ID']);
  179. var startSwitch = boolFunc(parameters['Quick Start']);
  180. var useBindPictures = boolFunc(parameters['Bind Pictures']);
  181. var useTerrax = boolFunc(parameters['Terrax Lighting'])
  182. var useFolder = boolFunc(parameters['Organized Folders'])
  183.  
  184. var overlayType = "";
  185. var overlayName = "";
  186. var overlayOpacity = 0;
  187. var overlayxMove = 0;
  188. var overlayyMove = 0;
  189. var overlayDuration;
  190. var overlayBlend = 0;
  191. var overlayFadeOut = false;
  192. var fogFadeOut;
  193.  
  194. Spriteset_Map.prototype.createLowerLayer = function() {
  195.     Spriteset_Base.prototype.createLowerLayer.call(this);
  196.     overlayType = "";
  197.     overlayName = "";
  198.     overlayOpacity = 0;
  199.     overlayxMove = 0;
  200.     overlayyMove = 0;
  201.     overlayBlend = 0;
  202.     overlayFadeOut = false;
  203.     overlayDuration;
  204.     fogFadeOut;
  205.     map = $dataMap;
  206.     if(startSwitch==true){
  207.         $gameSwitches.setValue(parSwitch,true);
  208.         $gameSwitches.setValue(lightSwitch,true);
  209.         $gameSwitches.setValue(fogSwitch,true);
  210.         $gameSwitches.setValue(shadowSwitch,true);
  211.     }
  212.     if(useBindPictures==true) this.createPicturesLayer('bottom', this._baseSprite);
  213.     this.createParallax();
  214.     if(useBindPictures==true) this.createPicturesLayer('below_tilemap', this._baseSprite);
  215.     this.createTilemap();
  216.     this.createGroundMap();
  217.     if(useBindPictures==true) this.createPicturesLayer('below_characters', this._tilemap);
  218.     this.createCharacters();
  219.     if(useBindPictures==true) this.createPicturesLayer('above_characters', this);
  220.     this.createParMap();
  221.     this.createShadowMap();
  222.     this.createFogMap();
  223.     this.createLightMap();
  224.     this.createShadow();
  225.     if(useBindPictures==true) this.createPicturesLayer('below_weather', this._tilemap, 8);
  226.     this.createWeather();
  227.     if(useBindPictures==true) this.createPicturesLayer('top', this);
  228.     if(useTerrax==true) this.createLightmask();   
  229.     this.createDestination();
  230. };
  231.  
  232.  
  233. Spriteset_Map.prototype.update = function() {
  234.     Spriteset_Base.prototype.update.call(this);
  235.     this.updateTileset();
  236.     this.updateGroundMap();
  237.     this.updateParallax();
  238.     this.updateParMap();
  239.     this.updateShadowMap();
  240.     this.updateFogMap();
  241.     this.updateLightMap();
  242.     this.updateTilemap();
  243.     this.updateShadow();
  244.     this.updateWeather();
  245.     if(useBindPictures==true) this.updatePictures();
  246. };        
  247. //==================== G R O U N D  M A P ======================   
  248. Spriteset_Map.prototype.createGroundMap = function() {
  249.     this._groundMap = new TilingSprite();
  250.     if(map.meta.ground || map.meta.all){
  251.         if(useFolder) this._groundMap.bitmap = ImageManager.loadBitmap('img/overlays/grounds/',ground_FN+$gameMap.mapId());
  252.         else this._groundMap.bitmap = ImageManager.loadParallax(ground_FN+$gameMap.mapId());
  253.     };
  254.     this._groundMap.move(0, 0, Graphics.width, Graphics.height);
  255.     this._groundMap.z = 1;
  256.     this._tilemap.addChild(this._groundMap);
  257.     };
  258.  
  259. Spriteset_Map.prototype.updateGroundMap = function() {
  260.         this._groundMap.origin.x =  $gameMap.displayX() * $gameMap.tileWidth();
  261.         this._groundMap.origin.y =  $gameMap.displayY() * $gameMap.tileHeight();
  262.         //Plugin Command Update
  263.        if(overlayType=="ground"){
  264.            if(useFolder) this._groundMap.bitmap = ImageManager.loadBitmap('img/overlays/grounds/',overlayName);
  265.            else this._groundMap.bitmap = ImageManager.loadParallax(overlayName);
  266.        }
  267.     };
  268.  
  269.  
  270. //======================= P A R  M A P =========================   
  271. Spriteset_Map.prototype.createParMap = function() {
  272.     this._parMap = new TilingSprite();
  273.     if(map.meta.par || map.meta.all){
  274.         if(useFolder) this._parMap.bitmap = ImageManager.loadBitmap('img/overlays/pars/',parallax_FN+$gameMap.mapId());
  275.         else this._parMap.bitmap = ImageManager.loadParallax(parallax_FN+$gameMap.mapId());
  276.     };
  277.     this._parMap.move(0, 0, Graphics.width, Graphics.height);
  278.     this._parMap.z = 20
  279.     this._tilemap.addChild(this._parMap);
  280.     if($gameSwitches.value(parSwitch)== true)
  281.       this._parMap.opacity = 255;
  282.      else
  283.       this._parMap.opacity = 0;
  284. };
  285.  
  286. Spriteset_Map.prototype.updateParMap = function() {
  287.         this._parMap.origin.x =  $gameMap.displayX() * $gameMap.tileWidth();
  288.         this._parMap.origin.y =  $gameMap.displayY() * $gameMap.tileHeight();
  289.        //Switch Checking
  290.        if($gameSwitches.value(parSwitch)== true){
  291.         if(this._parMap.opacity < 255) this._parMap.opacity += 10; }
  292.      else
  293.         if(this._parMap.opacity!=0) this._parMap.opacity -= 10;
  294.  
  295.     //Plugin Command Update
  296.      if(overlayType=="par"){
  297.         if(useFolder) this._parMap.bitmap = ImageManager.loadBitmap('img/overlays/pars/',overlayName);
  298.         else this._parMap.bitmap = ImageManager.loadParallax(overlayName);
  299.     };
  300. };
  301.  
  302.  
  303. //======================= S H A D O W  M A P =========================   
  304. Spriteset_Map.prototype.createShadowMap = function() {
  305.     this._shadowMap = new TilingSprite();
  306.      if(map.meta.shadow || map.meta.all){
  307.          if(useFolder) this._shadowMap.bitmap = ImageManager.loadBitmap('img/overlays/shadows/',shadow_FN+$gameMap.mapId());
  308.          else this._shadowMap.bitmap = ImageManager.loadParallax(shadow_FN+$gameMap.mapId());
  309.      }
  310.     this._shadowMap.move(0, 0, Graphics.width, Graphics.height);
  311.     this._shadowMap.z = 21
  312.     this._tilemap.addChild(this._shadowMap);
  313.     if($gameSwitches.value(shadowSwitch)== true)
  314.       this._shadowMap.opacity = 255;
  315.      else
  316.       this._shadowMap.opacity = 0;
  317. };
  318.  
  319. Spriteset_Map.prototype.updateShadowMap = function() {
  320.         this._shadowMap.origin.x =  $gameMap.displayX() * $gameMap.tileWidth();
  321.         this._shadowMap.origin.y =  $gameMap.displayY() * $gameMap.tileHeight();
  322.        //Switch Checking
  323.        if($gameSwitches.value(shadowSwitch)== true){
  324.         if(this._shadowMap.opacity < 255) this._shadowMap.opacity += 10; }
  325.      else
  326.         if(this._shadowMap.opacity!=0) this._shadowMap.opacity -= 10;
  327.  
  328.     //Plugin Command Update
  329.      if(overlayType=="shadow"){
  330.         if(useFolder) this._shadowMap.bitmap = ImageManager.loadBitmap('img/overlays/shadows/',overlayName);
  331.          else this._shadowMap.bitmap = ImageManager.loadParallax(overlayName);
  332.      };
  333. };
  334.  
  335. //===================== L I G H T  M A P =======================
  336. Spriteset_Map.prototype.createLightMap = function() {
  337.     map = $dataMap;
  338.     this._lightMap = new TilingSprite();
  339.      if(map.meta.light || map.meta.all){
  340.         if(useFolder) this._lightMap.bitmap = ImageManager.loadBitmap('img/overlays/lights/',light_FN+$gameMap.mapId());
  341.          else this._lightMap.bitmap = ImageManager.loadParallax(light_FN+$gameMap.mapId());
  342.      };
  343.     this._lightMap.move(0, 0, Graphics.width, Graphics.height);
  344.     this._lightMap.blendMode = 1;
  345.     this._lightMap.z = 23;
  346.     this._tilemap.addChild(this._lightMap);
  347.     if($gameSwitches.value(lightSwitch)== true)
  348.       this._lightMap.opacity = light_OP;
  349.      else
  350.       this._lightMap.opacity = 0;
  351. };
  352.  
  353. Spriteset_Map.prototype.updateLightMap = function() {
  354.         this._lightMap.origin.x =  $gameMap.displayX() * $gameMap.tileWidth();
  355.         this._lightMap.origin.y =  $gameMap.displayY() * $gameMap.tileHeight();
  356.         //Switch Checking
  357.        if($gameSwitches.value(lightSwitch)== true){
  358.         if(this._lightMap.opacity < light_OP) this._lightMap.opacity += 1; }
  359.      else
  360.         if(this._lightMap.opacity!=0) this._lightMap.opacity -= 1;
  361.  
  362.     //Plugin Command Update
  363.      if(overlayType=="light"){
  364.         if(useFolder) this._lightMap.bitmap = ImageManager.loadBitmap('img/overlays/lights/',overlayName);
  365.          else this._lightMap.bitmap = ImageManager.loadParallax(overlayName);
  366.          };
  367. };
  368.  
  369.  
  370. //======================= F O G  M A P ==========================
  371. Spriteset_Map.prototype.createFogMap = function() {
  372.     map = $dataMap;
  373.     this._fogMap = new TilingSprite();
  374.     if(map.meta.fogName){
  375.         if(useFolder) this._fogMap.bitmap = ImageManager.loadBitmap('img/overlays/fogs/',map.meta.fogName);
  376.         else this._fogMap.bitmap = ImageManager.loadParallax(map.meta.fogName);
  377.     };
  378.     this._fogMap.move(0, 0, Graphics.width, Graphics.height);
  379.     this._fogMap.blendMode = Number(map.meta.fogBlend) || 0;
  380.     this._fogMap.opacity = 0;
  381.     this._fogMap.origin.x =  $gameMap.displayX() * $gameMap.tileWidth();
  382.     this._fogMap.origin.y =  $gameMap.displayY() * $gameMap.tileHeight();
  383.     this._fogMap.z = 22;
  384.     newX = 0;
  385.     newY = 0;
  386.     this._tilemap.addChild(this._fogMap);
  387. };
  388.  
  389. Spriteset_Map.prototype.updateFogMap = function() {
  390.         map = $dataMap;
  391.         if(overlayBlend!=0) this._fogMap.blendMode = 1;
  392.         if(overlayxMove!=0){ newX += Number(overlayxMove); }
  393.          else newX += Number(map.meta.xMove) || 0;
  394.         if(overlayyMove!=0){ newY += Number(overlayyMove); }
  395.          else newY += Number(map.meta.yMove) || 0;
  396.         if(newX!=0) this._fogMap.origin.x =  ($gameMap.displayX() * $gameMap.tileWidth()) - newX;
  397.          else this._fogMap.origin.x =  ($gameMap.displayX() * $gameMap.tileWidth());
  398.         if(newY!=0) this._fogMap.origin.y =  ($gameMap.displayY() * $gameMap.tileHeight()) - newY;
  399.          else this._fogMap.origin.y =  ($gameMap.displayY() * $gameMap.tileHeight());
  400.     //Switch Checking
  401.      if($gameSwitches.value(fogSwitch)== true){
  402.          if(overlayOpacity!=0){ //if plugin call opacity exist
  403.           defOpacity = Number(overlayOpacity); }
  404.           else{ //if not
  405.            defOpacity = Number(map.meta.fogOpacity); }
  406.          if(overlayDuration){ //if plugin call duration exist
  407.              fogDuration = overlayDuration; }
  408.           else{ //if not
  409.               fogDuration = Number(map.meta.fogDuration) || 1 ;  }
  410.          fogTransition = defOpacity / fogDuration;
  411.      }
  412.     else if(this._fogMap.opacity!=0) this._fogMap.opacity -= 10;
  413.     // Transition Effect
  414.     if(overlayFadeOut){ // Fade Out
  415.                fogTransition = defOpacity / fogFadeOut;
  416.                if(this._fogMap.opacity!=0) this._fogMap.opacity -= fogTransition;
  417.                else if(this._fogMap.opacity==0){ //reset variables if opacity is 0
  418.                    overlayFadeOut = false;
  419.                    overlayOpacity = 0;
  420.                }
  421.          }
  422.     else if(this._fogMap.opacity < defOpacity){ //Fade In
  423.              this._fogMap.opacity += fogTransition;
  424.          }
  425.     //Plugin Command Update
  426.      if(overlayType=="fog"){
  427.         if(useFolder) this._fogMap.bitmap = ImageManager.loadBitmap('img/overlays/fogs/',overlayName);
  428.          else this._fogMap.bitmap = ImageManager.loadParallax(overlayName);
  429.      };
  430. };
  431.  
  432. //====================P L U G I N   C O M M A N D==================
  433.     var _GameInterpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
  434.     Game_Interpreter.prototype.pluginCommand = function (command, args) {
  435.           _GameInterpreter_pluginCommand.call(this, command, args);
  436.           if (command == "Overlay") {
  437.             if (args[0] == "fog") { //Fog Call
  438.                     if (args[1]) { //filename
  439.                       if (args[2]){ //opacity
  440.               if (args[3]){ //xMove
  441.                 if (args[4]){ //yMove
  442.                     overlayType = args[0];
  443.                     overlayName = args[1];
  444.                     overlayOpacity = args[2];
  445.                     overlayxMove = args[3];
  446.                     overlayyMove = args[4];
  447.                     if (args[5]) overlayBlend = args[5]; //fogBlend
  448.                     if (args[6]) overlayDuration = args[6]; //fogDuration
  449.               }
  450.             }
  451.           }
  452.                     }
  453.             } else if(args[0] == "fadeout" ){ //fog fadeout
  454.           if (args[1]){
  455.               overlayFadeOut = true;
  456.               fogFadeOut = args[1]; //fadeout duration
  457.           }
  458.       }
  459.         else if(args[0]){ //layer type
  460.           if (args[1]) { //filename
  461.                 overlayType = args[0];
  462.                 overlayName = args[1];
  463.           }
  464.       }
  465.           }//Command Overlay End
  466.   };
  467.  
  468. })();

Lv5.捕梦者 (管理员)

老黄鸡

梦石
0
星屑
39674
在线时间
7485 小时
注册时间
2009-7-6
帖子
13483

开拓者贵宾

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

使用道具 举报

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

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-4-28 07:12

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表