扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 138|回复: 0

[转载发布] 关于Kaus Ultimate Overlay图层插件的求教!

[复制链接]
累计送礼:
0 个
累计收礼:
0 个
  • TA的每日心情
    开心
    2025-2-4 02:05
  • 签到天数: 110 天

    连续签到: 2 天

    [LV.6]常住居民II

    2327

    主题

    395

    回帖

    1万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    6
    卡币
    10475
    OK点
    16
    推广点
    0
    同能卷
    0
    积分
    13225

    灌水之王

    发表于 2024-2-25 08:15:20 | 显示全部楼层 |阅读模式
    在别的帖子里找到的,新开一个空白工程测试时,安装插件,什么都没动没设置,打开游戏直接出现错误:
    要怎么整啊!难道是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. 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. *                 display all 3 overlays (ground,par,light)
    108. *              display ground layer.
    109. *                 display parallax layer.
    110. *               display light layer.
    111. *              display shadow layer.
    112. *    display the chosen fog.
    113. *     (OPTIONAL) changes the blend type of fog 0:NORMAL 1:ADD
    114. *  (OPTIONAL) makes a transition depending on value = frames.before completing opacity.
    115. *        (OPTIONAL) moves the fog left or right (+ moves right, - moves left)
    116. *        (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.     returnFunction("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.         elsethis._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.            elsethis._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.         elsethis._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.         elsethis._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.          elsethis._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.          elsethis._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.          elsethis._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.          elsethis._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.         elsethis._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.          elsethis._fogMap.origin.x =  ($gameMap.displayX() * $gameMap.tileWidth());
    374.         if(newY!=0)this._fogMap.origin.y =  ($gameMap.displayY() * $gameMap.tileHeight()) - newY;
    375.          elsethis._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.     elseif(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.                elseif(this._fogMap.opacity==0){//reset variables if opacity is 0
    394.                    overlayFadeOut = false;
    395.                    overlayOpacity = 0;
    396.                }
    397.          }
    398.     elseif(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.          elsethis._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.             }elseif(args[0] == "fadeout"){//fog fadeout
    429.           if(args[1]){
    430.               overlayFadeOut = true;
    431.               fogFadeOut = args[1]; //fadeout duration
    432.           }
    433.       }
    434.         elseif(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. })();
    复制代码

                 本帖来自P1论坛作者雷影,因Project1站服务器在国外有时候访问缓慢不方便作者交流学习,经联系P1站长fux2同意署名转载一起分享游戏制作经验,共同为国内独立游戏作者共同创造良好交流环境,原文地址:https://rpg.blue/forum.php?mod=viewthread&tid=409658  若有侵权,发帖作者可联系底部站长QQ在线咨询功能删除,谢谢。

    本帖子中包含更多资源

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

    x
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2025-3-10 20:32 , Processed in 0.139288 second(s), 54 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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