| 赞 | 0 |
| VIP | |
| 好人卡 | |
| 积分 | 6 |
| 经验 | |
| 最后登录 | 2026-9-25 |
| 在线时间 | 99 小时 |
- 梦石
- 0
- 星屑
- 594
- 在线时间
- 99 小时
- 注册时间
- 2020-5-7
- 回帖
- 8
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有账号?注册会员
×
本帖最后由 水果布丁 于 2020-8-19 10:29 编辑
rt,terraxlighting插件和dlc里的foreground插件不能同时使用,否则会报未定义bitmap
请问如何解决?
terrax和fore的脚本如下
- //=============================================================================
- // Terrax Plugins - Quasi ABS support for Terrax Lighting system
- // TerraxLighting.js
- // Version: 1.2
- //=============================================================================
- //
- //=============================================================================
- /*:
- * @plugindesc v1.2 Support for linking QuasiABS with TerraxLightingSystem
- * @author Terrax
- *
- * @help
- * The following definitions can be added to the QuasiABS settings in the database - skill-settings
- *
- * tx_missle: 25, #FF0000
- * Will give the missle a small (radius 25) red (color #FF0000) lightsource
- *
- * tx_onhit: 30, #FFAA00, 10, FADEOUT, 5
- * Will give a small yellow lightflash whenever the missle impacts on a wall or flies out of view, it will fadeout on the last 5 frames
- *
- * tx_onhitNPC: 100, #FFAA00, 15
- * Will give a large yellow lightflash when the missle impacts with an NPC character.
- *
- *
- * Example :
- *
- * <absSettings>
- * collider: circle, 13, 13
- * cooldown: 45
- * through: 3
- * tx_missle: 25, #FF0000
- * tx_onhit: 30, #FFAA00, 10, FADEOUT, 5
- * tx_onhitNPC: 100, #FFAA00, 15
- * </absSettings>
- *
- *
- * To make a state give light (for burning for example) you can define the radius and color in the note-tag of the state
- * with the following definition.
- * Database -> States -> Notetag -> <TX>TX:50,#FFAA00;</TX>
- * for a light effect with radius 50 and color #FFAA00.
- *
- * Released under the MIT license,
- * if used for commercial projects feel free to make a donation or
- * better yet, give me a free version of what you have created.
- * e-mail : fox(AT)caiw.nl / terraxz2 on steam.
- *
- * Thanks to everyone in the rpgmakerweb community for idea's, support and interest.
- */
- //=============================================================================
- // ps.. if my code looks funky, i'm an old guy..
- // object orientated programming bugs the hell out of me.
- var Imported = Imported || {};
- Imported.TerraxLightingQuasiABS = true;
- (function() {
- // OVERWRITTEN FROM QUASI ABS TO ADD LIGHTSOURCES TO MISSLES AND END ANIMATIONS
- // Skill_Sequencer
- Skill_Sequencer.prototype.update = function() {
- if (this._skill.break) {
- var i = this._character._skillLocked.indexOf(this._skill);
- if (i >= 0) {
- this._character._skillLocked.splice(i, 1);
- }
- this._character._casting = false;
- QuasiABS.Manager.removePicture(this._skill.picture);
- QuasiABS.Manager.removePicture(this._skill.trail);
- QuasiABS.Manager.removePicture(this._skill.pictureCollider);
- i = this._character._activeSkills.indexOf(this._skill);
- this._character._activeSkills.splice(i, 1);
- return;
- }
- if (this._skill.moving) {
- // ADDED
- Terrax_ABS_skill_x.push(this._skill.collider.center.x);
- Terrax_ABS_skill_y.push(this._skill.collider.center.y);
- Terrax_ABS_skill.push(this._skill.settings.tx_missle);
- this.updateSkillPosition();
- }
- if (this._waitCount > 0) {
- this._waitCount--;
- return;
- }
- if (this._waitForUserMove || this._waitForUserJump || this._waitForPose) {
- if (!this._character.isMoving()) this._waitForUserMove = false;
- if (!this._character.isJumping()) this._waitForUserJump = false;
- if (!this._character._posePlaying) this._waitForPose = false;
- }
- if (this._waitForMove || this._waitForUserMove ||
- this._waitForUserJump || this._waitForPose) {
- return;
- }
- var sequence = this._skill.sequence.shift();
- if (sequence) {
- var action = sequence.split(' ');
- // TX ADDED Trigger
- if (action[0].toLowerCase() == "trigger") {
- Terrax_ABS_blast_x.push(this._skill.collider.center.x);
- Terrax_ABS_blast_y.push(this._skill.collider.center.y);
- Terrax_ABS_blast.push(this._skill.settings.tx_blast);
- Terrax_ABS_blast_duration.push(-1);
- Terrax_ABS_blast_fade.push(-1);
- Terrax_ABS_blast_grow.push(-1);
- Terrax_ABS_blast_mapid.push($gameMap.mapId());
- }
- this.startAction(action);
- }
- if (this._skill.sequence.length === 0) {
- if (!this._skill.moving) {
- var i = this._character._activeSkills.indexOf(this._skill);
- QuasiABS.Manager.removePicture(this._skill.picture);
- QuasiABS.Manager.removePicture(this._skill.trail);
- QuasiABS.Manager.removePicture(this._skill.pictureCollider);
- this._character._activeSkills.splice(i, 1);
- // TX ADDED On hit
- //Graphics.Debug2('coors xy',this._skill.collider.center.x+'-'+this._skill.collider.center.y+' '+this._skill.settings.tx_onhit);
- Terrax_ABS_blast_x.push(this._skill.collider.center.x-$gameMap.tileWidth()/2);
- Terrax_ABS_blast_y.push(this._skill.collider.center.y-$gameMap.tileHeight()/2);
- Terrax_ABS_blast.push(this._skill.settings.tx_onhit);
- Terrax_ABS_blast_duration.push(-1);
- Terrax_ABS_blast_fade.push(-1);
- Terrax_ABS_blast_grow.push(-1);
- Terrax_ABS_blast_mapid.push($gameMap.mapId());
- }
- }
- };
- Skill_Sequencer.prototype.updateState = function() {
- }
- Graphics.Debug2 = function(name, message) {
- if (this._errorPrinter) {
- this._errorPrinter.innerHTML = this._makeErrorHtml(name, message);
- }
- };
- QuasiABS.Manager.startAction = function(self, targets, item) {
- if (!item.animationTarget || targets.length === 0) {
- this.startAnimation(item.data.animationId, item.collider.center.x, item.collider.center.y);
- }
- for (var i = 0; i < targets.length; i++) {
- if (item.animationTarget === 1) {
- var x = targets[i].cx();
- var y = targets[i].cy();
- this.startAnimation(item.data.animationId, x, y);
- }
- var action = new Game_Action(self.battler(), true);
- action.setSkill(item.data.id);
- var tx_x = targets[i].cx()-$gameMap.tileWidth()/2;
- var tx_y = targets[i].cy()-$gameMap.tileHeight()/2;
- var tx_set = item.settings.tx_state;
- action.absApply(targets[i].battler());
- // TX ADDED OnHitNPC
- Terrax_ABS_blast_x.push(targets[i].cx()-$gameMap.tileWidth()/2);
- Terrax_ABS_blast_y.push(targets[i].cy()-$gameMap.tileHeight()/2);
- Terrax_ABS_blast.push(item.settings.tx_onhitNPC);
- Terrax_ABS_blast_duration.push(-1);
- Terrax_ABS_blast_fade.push(-1);
- Terrax_ABS_blast_grow.push(-1);
- Terrax_ABS_blast_mapid.push($gameMap.mapId());
- var id = self === $gamePlayer ? 0 : self.eventId();
- targets[i].addAgro(id, item.data);
- }
- };
- Game_CharacterBase.prototype.updateABS = function() {
- if (this.battler()) {
- if (this.battler().hp <= 0) return this.onDeath();
- this.updateSkills();
- this.battler().updateABS(this._realX,this._realY);
- }
- };
- Game_Battler.prototype.updateABS = function(x,y) {
- for (var i = 0; i < this.states().length; i++) {
- this.updateStateSteps(this.states()[i],x,y);
- }
- //this.showAddedStates(); //Currently does nothing, so no need to run it
- //this.showRemovedStates(); //Currently does nothing, so no need to run it
- };
- Game_Battler.prototype.updateStateSteps = function(state,x,y) {
- if (!state.removeByWalking) return;
- if (this._stateSteps[state.id] >= 0) {
- if (this._stateSteps[state.id] % this.stepsForTurn() === 0) {
- this.onTurnEnd();
- this.result().damageIcon = $dataStates[state.id].iconIndex;
- this.startDamagePopup();
- if (this._stateSteps[state.id] === 0) this.removeState(state.id);
- }
- this._stateSteps[state.id]--;
- // ADDED
- var statenote = $dataStates[state.id].note;
- if (statenote) {
- var searchnote = statenote.indexOf("TX:");
- if (searchnote >= 0) {
- var closetag = statenote.indexOf(";",searchnote);
- var txdata = statenote.substring(searchnote+3, closetag);
- //Graphics.Debug2('state',$dataStates[state.id].note+ " "+txdata);
- var tw = $gameMap.tileWidth();
- var ty = $gameMap.tileHeight();
- var x1 = (x * tw) + (tw/2);
- var y1 = (y * ty) + (ty/2);
- Terrax_ABS_skill_x.push(x1);
- Terrax_ABS_skill_y.push(y1);
- Terrax_ABS_skill.push(txdata);
- }
- }
- }
- };
- })();
-
-
复制代码- //=============================================================================
- // Foreground.js (Ver1.0.1)
- //=============================================================================
- // [History]
- // 2015.Nov. 7 1.0.0 First Release
- // 2018.Sep.19 1.0.1 Fix bug when 'event command -> test' becomes error
- /*:
- * @plugindesc display foreground tiling sprite(Ver1.0.1)
- * @author Sasuke KANNAZUKI (thanks to Yoji Ojima)
- *
- * @noteParam fgName
- * @noteRequire 1
- * @noteDir img/parallaxes/
- * @noteType file
- * @noteData maps
- *
- * @help This plugin does not provide plugin commands.
- *
- * 'foreground' is like a parallax that displays over the map.
- * put bitmap file at img/parallaxes.
- *
- * Map Note:
- * write down following 5 settings at map's note.
- * <fgName:name> name is the string, file name of tiling sprite.
- * if the name starts '!', it is regarded as "foreground zero".
- * the filename is searched from img/parallaxes.
- * <fgLoopX:number> number is the flag of loop x. 0:no 1:yes
- * if this is not written on the note, it'll be 0(=no).
- * <fgLoopY:number> number is the flag of loop y. 0:no 1:yes
- * if this is not written on the note, it'll be 0(=no).
- * <fgSx:number> number is x scroll speed.
- * when it doesn't loop x, this is ignored.
- * if this is not written on the note, it'll be 0.
- * <fgSy:number> number is y scroll speed.
- * when it doesn't loop y, this is ignored.
- * if this is not written on the note, it'll be 0.
- *
- * Ex.
- * <fgName:sample1><fgLoopX:1><fgLoopY:1>
- *
- * <fgName:!sample1>
- *
- * [License]
- * this plugin is released under MIT license.
- * http://opensource.org/licenses/mit-license.php
- */
- /*:ja
- * @plugindesc マップに合わせてスクロールする近景の設定(Ver1.0.1)
- * @author 神無月サスケ (thanks to Yoji Ojima)
- *
- * @noteParam fgName
- * @noteRequire 1
- * @noteDir img/parallaxes/
- * @noteType file
- * @noteData maps
- *
- * @help このプラグインにプラグインコマンドはありません。
- * 近景(foreground)は、マップの上に表示される遠景のようなものです。
- * 使用する画像ファイルは、img/parallaxes に置いてください。
- *
- * マップのメモ:
- * 以下の5項目を書いてください(設定項目は、遠景と似ています)。
- * <fgName:ファイル名> 前景として使うファイル名です(拡張子なし)
- * 名前が '!'で始まる場合、遠景同様視差ゼロとなります。
- * ファイルは img/parallaxes に置いてください
- * <fgLoopX:数字> X座標にループするかどうか (0:no 1:yes)。
- * 省略時は0(=no)になります。
- * <fgLoopY:number> Y座標にループするかどうか (0:no 1:yes)。
- * 省略時は0(=no)になります。
- * <fgSx:数字> X座標のスクロール速度です
- * X座標にループしない場合は無視されます。
- * 省略時は0になります。
- * <fgSy:数字> Y座標のスクロール速度です
- * Y座標にループしない場合は無視されます。
- * 省略時は0になります。
- *
- * 例:
- * <fgName:sample1><fgLoopX:1><fgLoopY:1>
- * sample1.png が前景になり、斜め上にループします。
- *
- * <fgName:!sample1>
- * 視差ゼロで!sample1.png が表示されます。
- *
- * ■ライセンス表記
- * このプラグインは MIT ライセンスで配布されます。
- * ご自由にお使いください。
- * http://opensource.org/licenses/mit-license.php
- */
- (function() {
- //
- // check zero foreground or not.
- //
- ImageManager.isZeroForeground = function(filename) {
- return filename.charAt(0) === '!';
- };
- //
- // map initialization
- //
- var _Game_Map_initialize = Game_Map.prototype.initialize;
- Game_Map.prototype.initialize = function() {
- _Game_Map_initialize.call(this);
- this.initForeground();
- };
- Game_Map.prototype.initForeground = function(){
- this._foregroundDefined = true;
- this._foregroundName = '';
- this._foregroundZero = false;
- this._foregroundLoopX = false;
- this._foregroundLoopY = false;
- this._foregroundSx = 0;
- this._foregroundSy = 0;
- this._foregroundX = 0;
- this._foregroundY = 0;
- };
- //
- // if foreground is undefined, initialize it.
- //
- Game_Map.prototype.guardForeground = function(){
- if(!this._foregroundDefined){
- this.initForeground();
- }
- };
- //
- // an accessor
- //
- Game_Map.prototype.foregroundName = function() {
- this.guardForeground();
- return this._foregroundName;
- };
- //
- // set foreground by reading map's note.
- //
- var _Game_Map_setup = Game_Map.prototype.setup;
- Game_Map.prototype.setup = function(mapId) {
- _Game_Map_setup.call(this, mapId);
- this.setupForeground();
- };
- Game_Map.prototype.setupForeground = function() {
- if ($dataMap.meta) {
- this._foregroundName = $dataMap.meta.fgName || '';
- this._foregroundZero = ImageManager.isZeroForeground(
- this._foregroundName);
- this._foregroundLoopX = !!$dataMap.meta.fgLoopX;
- this._foregroundLoopY = !!$dataMap.meta.fgLoopY;
- this._foregroundSx = Number($dataMap.meta.fgSx) || 0;
- this._foregroundSy = Number($dataMap.meta.fgSy) || 0;
- }
- this._foregroundX = 0;
- this._foregroundY = 0;
- };
- //
- // to display foreground
- //
- var _Game_Map_setDisplayPos = Game_Map.prototype.setDisplayPos;
- Game_Map.prototype.setDisplayPos = function(x, y) {
- _Game_Map_setDisplayPos.call(this, x, y);
- this.guardForeground();
- if (this.isLoopHorizontal()) {
- this._foregroundX = x;
- } else {
- this._foregroundX = this._displayX;
- }
- if (this.isLoopVertical()) {
- this._foregroundY = y;
- } else {
- this._foregroundY = this._displayY;
- }
- };
- Game_Map.prototype.foregroundOx = function() {
- this.guardForeground();
- if (this._foregroundZero) {
- return this._foregroundX * this.tileWidth();
- } else if (this._foregroundLoopX) {
- return this._foregroundX * this.tileWidth() / 2;
- } else {
- return 0;
- }
- };
- Game_Map.prototype.foregroundOy = function() {
- this.guardForeground();
- if (this._foregroundZero) {
- return this._foregroundY * this.tileHeight();
- } else if (this._foregroundLoopY) {
- return this._foregroundY * this.tileHeight() / 2;
- } else {
- return 0;
- }
- };
- //
- // to scroll foreground
- //
- var _Game_Map_scrollDown = Game_Map.prototype.scrollDown;
- Game_Map.prototype.scrollDown = function(distance) {
- var lastY = this._displayY;
- _Game_Map_scrollDown.call(this, distance);
- this.guardForeground();
- if (this.isLoopVertical()) {
- if (this._foregroundLoopY) {
- this._foregroundY += distance;
- }
- } else if (this.height() >= this.screenTileY()) {
- var displayY = Math.min(lastY + distance,
- this.height() - this.screenTileY());
- this._foregroundY += displayY - lastY;
- }
- };
- var _Game_Map_scrollLeft = Game_Map.prototype.scrollLeft;
- Game_Map.prototype.scrollLeft = function(distance) {
- var lastX = this._displayX;
- _Game_Map_scrollLeft.call(this, distance);
- this.guardForeground();
- if (this.isLoopHorizontal()) {
- if (this._foregroundLoopX) {
- this._foregroundX -= distance;
- }
- } else if (this.width() >= this.screenTileX()) {
- var displayX = Math.max(lastX - distance, 0);
- this._foregroundX += displayX - lastX;
- }
- };
- var _Game_Map_scrollRight = Game_Map.prototype.scrollRight;
- Game_Map.prototype.scrollRight = function(distance) {
- var lastX = this._displayX;
- _Game_Map_scrollRight.call(this, distance);
- this.guardForeground();
- if (this.isLoopHorizontal()) {
- if (this._foregroundLoopX) {
- this._foregroundX += distance;
- }
- } else if (this.width() >= this.screenTileX()) {
- var displayX = Math.min(lastX + distance,
- this.width() - this.screenTileX());
- this._foregroundX += displayX - lastX;
- }
- };
- var _Game_Map_scrollUp = Game_Map.prototype.scrollUp;
- Game_Map.prototype.scrollUp = function(distance) {
- var lastY = this._displayY;
- _Game_Map_scrollUp.call(this, distance);
- this.guardForeground();
- if (this.isLoopVertical()) {
- if (this._foregroundLoopY) {
- this._foregroundY -= distance;
- }
- } else if (this.height() >= this.screenTileY()) {
- var displayY = Math.max(lastY - distance, 0);
- this._foregroundY += displayY - lastY;
- }
- };
- //
- // update foreground
- //
- var _Game_Map_update = Game_Map.prototype.update;
- Game_Map.prototype.update = function(sceneActive) {
- _Game_Map_update.call(this, sceneActive);
- this.updateForeground();
- };
- Game_Map.prototype.updateForeground = function() {
- this.guardForeground();
- if (this._foregroundLoopX) {
- this._foregroundX += this._foregroundSx / this.tileWidth() / 2;
- }
- if (this._foregroundLoopY) {
- this._foregroundY += this._foregroundSy / this.tileHeight() / 2;
- }
- };
- //
- // sprites
- //
- var _Spriteset_Map_createLowerLayer =
- Spriteset_Map.prototype.createLowerLayer;
- Spriteset_Map.prototype.createLowerLayer = function() {
- _Spriteset_Map_createLowerLayer.call(this);
- this.createForeground();
- };
- var _Spriteset_Map_update = Spriteset_Map.prototype.update;
- Spriteset_Map.prototype.update = function() {
- _Spriteset_Map_update.call(this);
- this.updateForeground();
- };
- Spriteset_Map.prototype.createForeground = function() {
- this._foreground = new TilingSprite();
- this._foreground.move(0, 0, Graphics.width, Graphics.height);
- // in order to display under the weather sprites:
- this._baseSprite.removeChild(this._weather);
- this._baseSprite.addChild(this._foreground);
- this._baseSprite.addChild(this._weather);
- };
- Spriteset_Map.prototype.updateForeground = function() {
- if (this._foregroundName !== $gameMap.foregroundName()) {
- this._foregroundName = $gameMap.foregroundName();
- this._foreground.bitmap = ImageManager.loadParallax(this._foregroundName);
- }
- if (this._foreground.bitmap) {
- this._foreground.origin.x = $gameMap.foregroundOx();
- this._foreground.origin.y = $gameMap.foregroundOy();
- }
- };
- })();
复制代码 |
|