查看: 2978|回复: 7

[已经解决] 求稍微修改1个脚本

[复制链接]
梦石
0
星屑
112
在线时间
72 小时
注册时间
2016-7-19
回帖
44
发表于 2016-8-12 20:39:12 | 显示全部楼层 |阅读模式

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

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

×
原插件地址:http://www.rpgmakermv.cn/page/orange-lighting.html

就是orange-lighting 系统
这个系统都很好 就是这里我需要一个功能
原插件中 只有事件灯光的开和关2个脚本指令
而我因为一些其他的原因需要 对玩家灯光事件的参数修改
我需要如下几个脚本指令
1.开关玩家灯光的指令 (2个插件指令) 比如 playerlighton()和playerlightoff
2.修改玩家灯光颜色的指令(通过参数修改) 比如 setplayerlightcolor(#FFFFFF)
2.修改玩家灯光范围(通过参数修改) 比如 setplayerlightRadius(X)

有哪位大神可以帮我改下
谢谢了~
附玩家灯光事件脚本
  1. /*=============================================================================
  2. * Orange Lighting - Player Light
  3. * By Hudell - [url]www.hudell.com[/url]
  4. * OrangeLightingPlayerLight.js
  5. * Version: 1.0.1
  6. * Free for commercial and non commercial use.
  7. *=============================================================================*/
  8. /*:
  9. * @plugindesc Player Lights <OrangeLightingPlayerLight>
  10. * @author Hudell
  11. *
  12. * @param playerRadius
  13. * @desc The size of the light globe around the player
  14. * @default 40
  15. *
  16. * @param playerColor
  17. * @desc The color of the light around the player
  18. * @default #FFFFFF
  19. *
  20. * @param playerFlicker
  21. * @desc Should the plugin flick the light around the player?
  22. * @default false
  23. *
  24. * @param flashlightSwitch
  25. * @desc When this switch is on, a flashlight will be added to the player.
  26. * @default 0
  27. *
  28. *
  29. * @help
  30. * ============================================================================
  31. * Hudell's Plugins
  32. * ============================================================================
  33. *
  34. * Check out my website:
  35. * [url]http://hudell.com[/url]
  36. *
  37. *=============================================================================*/
  38. if (!Hudell || !Hudell.OrangeLighting) {
  39.   throw new Error("Couldn't find Hudell's OrangeLighting plugin. Please add it before this add-on.");
  40. }

  41. (function(lightSystem) {
  42.   "use strict";

  43.   lightSystem.addOns.PlayerLight = {};

  44.   (function(playerLight){
  45.     var parameters = $plugins.filter(function(plugin) { return plugin.description.contains('<OrangeLightingPlayerLight>'); });
  46.     if (parameters.length === 0) {
  47.       throw new Error("Couldn't find Hudell's OrangeLightingPlayerLight parameters.");
  48.     }
  49.     playerLight.Parameters = parameters[0].parameters;
  50.     playerLight.Param = {};
  51.   
  52.     playerLight.Param.playerRadius = Number(playerLight.Parameters.playerRadius || 40);
  53.     playerLight.Param.playerColor = playerLight.Parameters.playerColor || '#FFFFFF';
  54.     playerLight.Param.playerFlicker = (playerLight.Parameters.playerFlicker || "false").toUpperCase() === "TRUE";
  55.     playerLight.Param.flashlightSwitch = Number(playerLight.Parameters.flashlightSwitch || 0);
  56.     playerLight.enabled = true;

  57.     playerLight.shouldShowFlashlight = function(){
  58.       return playerLight.Param.flashlightSwitch > 0 && $gameSwitches.value(playerLight.Param.flashlightSwitch);
  59.     };

  60.     playerLight.getPlayerPosition = function() {
  61.       return lightSystem.getCharacterPosition($gamePlayer);
  62.     };

  63.     //Refreshes the player's light
  64.     playerLight.refresh = function() {
  65.       if (!playerLight.enabled) return;

  66.       lightSystem._showingFlashlight = playerLight.shouldShowFlashlight();

  67.       var canvas = this._maskBitmap.canvas;
  68.       var ctx = canvas.getContext("2d");

  69.       ctx.globalCompositeOperation = 'lighter';

  70.       var positions = playerLight.getPlayerPosition();

  71.       if (playerLight.shouldShowFlashlight()) {
  72.         this._maskBitmap.makeFlashlightEffect(positions[0], positions[1], 0, playerLight.Param.playerRadius, playerLight.Param.playerColor, 'black', positions[2]);
  73.       } else {
  74.         if (playerLight.Param.playerRadius < 100) {
  75.           this._maskBitmap.radialgradientFillRect(positions[0], positions[1], 0, playerLight.Param.playerRadius, '#999999', 'black', playerLight.Param.playerFlicker);
  76.         } else {
  77.           this._maskBitmap.radialgradientFillRect(positions[0], positions[1], 20, playerLight.Param.playerRadius, playerLight.Param.playerColor, 'black', playerLight.Param.playerFlicker);
  78.         }
  79.       }

  80.       ctx.globalCompositeOperation = 'source-over';
  81.     };

  82.     playerLight.update = function(){
  83.       if (!playerLight.enabled) return;

  84.       if (playerLight.shouldShowFlashlight() !== lightSystem._showingFlashlight) {
  85.         lightSystem.dirty = true;
  86.       }

  87.       if (playerLight.Param.playerFlicker && !playerLight.shouldShowFlashlight()) {
  88.         lightSystem.dirty = true;
  89.       }
  90.     };

  91.     lightSystem.on('afterRefreshMask', playerLight.refresh);
  92.     lightSystem.on('updateMask', playerLight.update);


  93.     (function($) {
  94.       playerLight.Game_Player_prototype_update = $.update;
  95.       $.update = function(sceneActive) {
  96.         var oldD = this._direction;
  97.         var oldX = this._x;
  98.         var oldY = this._y;
  99.         playerLight.Game_Player_prototype_update.call(this, sceneActive);

  100.         if (this.isMoving() || oldD !== this._direction || oldX !== this._x || oldY !== this._y) {
  101.           lightSystem.dirty = true;
  102.         }
  103.       };
  104.           playerLight.Game_Player_prototype_setplayerRadius = $.setplayerRadius;
  105.           $.setplayerRadius = function() {
  106.                   this.playerLight.Param.playerRadius = 40;
  107.                   
  108.           };
  109.     })(Game_Player.prototype);  


  110.   })(lightSystem.addOns.PlayerLight);

  111. })(Hudell.OrangeLighting);

  112. Imported["OrangeLighting.PlayerLight"] = 1.0;
复制代码

点评

或用TerraxLighting  发表于 2016-8-12 21:29
去找最新版  发表于 2016-8-12 21:09
梦石
0
星屑
112
在线时间
72 小时
注册时间
2016-7-19
回帖
44
 楼主| 发表于 2016-8-12 21:42:09 | 显示全部楼层
terraxlighting 也没这个功能

点评

terraxlighting最新版是1.30/1,31,你用的最新的嗎?  发表于 2016-8-12 22:11
回复

使用道具 举报

梦石
0
星屑
22879
在线时间
8598 小时
注册时间
2011-12-31
回帖
3270
发表于 2016-8-12 22:15:22 | 显示全部楼层
terraxlighting1.3説明
* @help
* To activate the script in an area, do the following:
* 1. Put an event switch into the map.
* 2. In the 'Note' field (Next to the name) put the following text :
* Light 250 #FFFFFF
* - Light activates the script
* - 250 is the lightradius of the object
* - #FFFFFF is the lightcolor (white in this case)
* 3. You're done, its that simple.
*
* You can add two optional commands for brightness and direction
* Light 200 #FFFFFF B50 increases the brightness with 50%. Value between 0 and 99.
* Light 200 #FFFFFF D1 will give half a lightglobe for lightsources placed on walls.
* 1. For lights on north walls, light will face down.
* 2. For lights on east walls, light will face west.
* 3. For lights on south walls, light will face north.
* 4. For lights on west walls, light will face east.
*
* To alter the player radius in game use the following plugin command :
* Light radius 200 #FFFFFF  (to change the radius and the color)
* If you want to change the player radius slowly over time (like a dying torch)
* use the command 'Light radiusgrow 200 #FFFFFF'
* You can alter the brightness of the players lightsource by adding:
* 'Light radius 200 #FFFFFF B70' (Brightness values between 0 and 99, 0 is default)
*
* To turn on and off lightsources in the game, do the following:
* Give the lightsource the normal def :  Light 250 #FFFFFF and an extra number
* so it becomes 'Light 250 #FFFFFF 1'
* (If your using the optional brightness and direction place it after those (Light 250 #FFFFFF B50 D2 1)
* To turn on this light use plugin command : 'Light on 1'.
* The plugin command will also trigger SelfSwitch 'D' on the targeted light(s).
* To turn off the light use plugin command : 'Light off 1'.
* You can reset the switches each map with the option or manualy by
* the plugin command 'Light switch reset'
* You can also turn off lights with the kill-selfswitch defined in the parameters.
*
* Replacing the 'Light' keyworld with 'Fire' will give the lights a subtle flicker
* You can configure the fire effect with the plugin command 'SetFire 7 10'
* Where 7 is the radius change and 10 is the shift in color from red to yellow.
*
* To completly turn off the script use : 'Light deactivate'
* To turn it on again use the command: 'Light activate'
*
* To activate a day-night cycle on a map, put in a trigger with 'DayNight' in an event note
* or in the map note.
* Plugin command 'Daynight speed 10' changes the speed.
* Speed 10 means it takes 10 seconds to to pass one hour in game (probably to fast)
* Plugin command 'Daynight hour 16 30' sets the hour to 16:30 hours
* Each hour has its own color value.
* Plugin command 'Daynight color 0 #222222' changes 0:00 hours to color value '#222222'
* You can add time with the plugin command 'Daynight add 8 30' (this adds 8 hours and 30 minutes)
*
* If you want to use the time of day to trigger effects (like turning on lights when it gets dark)
* you can use the parameters 'Save DaynightHours','Save DaynightMinutes','Save DaynightSeconds'
* The default is 0, which means its off.
* If you set it to a value,5 for example, it will store the daynight value inside game variable 5.
* You can then use that variable to trigger lights.
* To help syncing/debugging the time system you can use scriptcommand 'daynight debug' to display the current time.
* If you want to go 'alien world' and stuff, you can change the number of hours in a day with
* script command 'daynight hoursinday 48' (for 48 hours in day, don't forget to fill in the hour values)
*
* As an alternative to the daynight cycle you can use the tint system. If you want to use another plugin for the
* day/night cycle, the tint option is probably best to use.
* The plugin command 'Tint set #333333' will make the room less dark.
* The plugin command 'Tint fade #777777 5' will fade the color from the current color to the new, the last
* number (5) is the speed of the fade, were 1 is a fast fade and 20 is a very slow one.
* If an area has a daynight cycle system, the tint system is disabled.
*
* To use a flashlight effect use 'Flashlight on 8 12 #FFFFFF 3' and 'Flashlight off'
* The arguments are optional (8=beamlength, 12=beamwidth, #FFFFFF=color, 3=beam density)
* Events can also use the flashlight effect. Use 'Flashlight 8 12 #888888 1 2' in the note-tag.
* where 8 is the length of the flashlights beam and 12 is the width of the beam. The last numbers are
* optional and can be used to turn the NPC's flashlight on or off and set the direction of the beam
* if the event is not moving (1=up, 2=right, 3=down, 4=left) the default is down.
*
* TileLight and RegionLight settings
* To create lightsources without using events you can use the following plugin command.
* TileLight 1 ON #FFFFFF 150  Will create a lightsource (color #FFFFFF radius 150) on all tiles with tile-tag 1.
* TileRegion 1 ON #FFFFFF 150 Will create a lightsource on all tiles with region-number 1.
* You can increase the brightness of a lightsource with the optional TileRegion 1 ON #FFFFFF 150 B50  (for 50% increased brightness)
* TileLight 1 OFF will turn off the lights on tile-tag 1 again
* TileRegion 1 OFF will turn off the lights on region-number 1 again  
* TileFire and RegionFire works the same as TileLight, but with fire effect.
* Make sure your map still has at least one event with lights in it, otherwise the script will not run.
*
* TileBlock and RegionBlock settings
* To block lights on certain tiles (roofs for instance) you can use the following plugin command.
* TileBlock 1 ON #000000  Will block light on tiles with tile-tag 1.
* RegionBlock 1 ON #000000 Will block lights on tiles with region-number 1.
* TileBlock 1 OFF and TileRegion 1 OFF turns off the blocking again.
* To darken but not completly block light use a slightly higher color setting (#333333) for instance.
* This function does not raytrace. If the players lightradius is bigger then the blocking tiles the
* light will show on the other side. For the best effect keep the lightradius a bit smaller then the block section.
* for advance users, if you want to block more or less of the tile you can do the following
* RegionBlock 1 ON #000000 shape xoffset yoffset width height
* RegionBlock 1 ON #000000 1 20 20 10 10   -> this will block a box starting at 20,20 with width and height 10,10
* RegionBlock 1 ON #000000 2 20 20 10 10   -> this will block a oval starting at 20,20 with xradius 10 and yradius 10
*

评分

参与人数 1梦石 +1 收起 理由
余烬之中 + 1 认可答案

查看全部评分

回复

使用道具 举报

梦石
0
星屑
112
在线时间
72 小时
注册时间
2016-7-19
回帖
44
 楼主| 发表于 2016-8-13 11:13:43 | 显示全部楼层
tseyik 发表于 2016-8-12 22:15
terraxlighting1.3説明
* @help
* To activate the script in an area, do the following:

非常感谢 确实是版本低的问题  只是我没有找到1.3以上的下载  
方便给个下载连接么

点评

http://mvplugins.com/  发表于 2016-8-13 12:31
回复

使用道具 举报

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

本版积分规则

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

在本版发帖返回顶部