Terrax Lighting system

● ARCHIVED · READ-ONLY
Started by Terrax 1467 posts Page 23 of 74 View original ↗
  1. Todeswalzer said:
    Is anyone else having a problem with this and variables? I noticed today that for some odd reason, when i have this plugin turned on, not even any commands from the plugin, just turned ON in the plugin manager, it seems to increment Random Variables... mostly Variable number 30, i start a new game and Variable 30 is at 2, then i move to another room and Variable 30 is values 38... variable 30 isn't even assigned to anything in my game yet... i turned all of my plugins off one by one, and only by turning this one off did the problem stop, am I the only person to have this issue?

    Is it doing it to any other variables, or  only to variable 30? Sometimes plugins store values to variables (A couple of plugins I was using on VX Ace did, anyway. A particular plugin used 30 and 31 to store the X and Y dimensions for a particular message box, for example). 
  2. It did alter another one but i can't remember which one it was now and not with the same frequency as it did with 30.
  3. OK so small issue: Having anything written in the Note box for a map besides DayNight prevents the DayNight cycle from occurring on that map, even if DayNight is still in the box. This is a bit problematic and could do with being fixed, but I can replicate the other functions of the Note box in other ways, so it's not desperate. 


    I checked over the plugin file, and I'm pretty sure it's something to do with "if (command === daynight')". Does anyone know how to change it to checking for containing 'daynight' instead of being exactly 'daynight'?
  4. Uh... pretty sure that the lighting isn't supposed to do what it's doing on the right side of those screenshots. All I did was adjust my resolution slightly...

    Screenshot 2016-02-16 00.23.46.png

    Screenshot 2016-02-19 18.49.22.png
  5. Little Adventurer said:
    Uh... pretty sure that the lighting isn't supposed to do what it's doing on the right side of those screenshots. All I did was adjust my resolution slightly...


    View attachment 32015


    View attachment 32016





    I think this probably has something to do with the settings in Terrax's plugin. You can set the X and Y dimensions of the screen, which default to slightly higher than the size of the default game window, likely to compensate for this. 


    Capture.PNG
  6. *facepalms* Oh. I thought the plugin was updated or something.
  7. raitoningu said:
    OK so small issue: Having anything written in the Note box for a map besides DayNight prevents the DayNight cycle from occurring on that map, even if DayNight is still in the box. This is a bit problematic and could do with being fixed, but I can replicate the other functions of the Note box in other ways, so it's not desperate. 


    I checked over the plugin file, and I'm pretty sure it's something to do with "if (command === daynight')". Does anyone know how to change it to checking for containing 'daynight' instead of being exactly 'daynight'?



    In this instance, you'd use some sort of "contains" command, like so:


    https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/String/includes
  8. Amazing plugin!
  9. New version (1.2.7) now available


    http://mvplugins.com/plugin/Terrax/Terrax%20Lighting%20System


    Bug fix : Mapnotes are now searched for 'daynight', so it works with other notes.

    EternalShadow said:
    OK so small issue: Having anything written in the Note box for a map besides DayNight prevents the DayNight cycle from occurring on that map, even if DayNight is still in the box.

    Fixed this update. 

    Skurge said:
    Is there a method I can use to have vehicles use the light sources much like the car events I spoke of earlier? And if possible have the lights only activated when the vehicle is entered?

    I included a small boat in the demo with an example script, maybe this will help you on your way.
  10. Works wonderful except for a slight problem, when entering the vehicle the flash light apears for the person in the direction he'd be facing, rather than the ship incorporating the light after entry, so if i enter the boat ( car in my case ) the car lights come from the person in the direction he enters rather than the car would be.
  11. Skurge said:
    Works wonderful except for a slight problem, when entering the vehicle the flash light apears for the person in the direction he'd be facing, rather than the ship incorporating the light after entry, so if i enter the boat ( car in my case ) the car lights come from the person in the direction he enters rather than the car would be.

    You can solve this by adding a 'Set movement Route' to the script at the 3rd line


    If : Ship is driven


      If : Self Switch A is OFF


            Set Movement Route : Player (Wait)


                                           : Turn Down        -> Set this in the direction your vehicle is pointing


            Plugin Command : flashlight on


            Plugin Command : light radius 10


       end


    etc.
  12. Terrax said:
    goldenhades said:
    Hi Terrax


             Do you think its possible to use your tint set in battle as well. Because right now we got ooo super darky dungeon who awesome. There is two slime lets fight guys!   What those slime are made . its so bright !!!


    i have currently try calling the plugin command in battle but to no avail.



    I will look into it, won't promise anything because the battle system is new territory.



    What about this implementation?

    Spoiler
        //OVERWRITE
        Game_Player.prototype.executeEncounter = function() {
            if (!$gameMap.isEventRunning() && this._encounterCount <= 0) {
                this.makeEncounterCount();
                var troopId = this.makeEncounterTroopId();
                if ($dataTroops[troopId]) {
                    
                //NEW
                boolean = false;
                for (var i = 0; i < $dataMap.events.length; i++) {
                    if ($dataMap.events) {
                        var note = $dataMap.events.note
                        var note_args = note.split(" ");
                        var note_command = note_args.shift().toLowerCase();            
                        if (note_command == "light" || note_command == "fire" || note_command == "daynight" || note_command == "flashlight" ) {            
                            boolean = true;        
                            break;
                        }
                    }
                }
                if ($dataMap.note.toLowerCase() == 'daynight') { //NEW
                    $gameTemp._Tint = $gameVariables.valueDayNightColor()[$gameVariables.valueDayNightSave()];
                } else if (boolean) {
                    $gameTemp._Tint = $gameVariables.valueTintValueSave();
                } else {
                    $gameTemp._Tint = '#FFFFFF';
                }
                //NEW
                    
                    BattleManager.setup(troopId, true, false);
                    BattleManager.onEncounter();
                    return true;
                } else {
                    return false;
                }
            } else {
                return false;
            }
        };
        
        //OVERWRITE
        Game_Interpreter.prototype.command301 = function() {
            if (!$gameParty.inBattle()) {
                var troopId;
                if (this._params[0] === 0) {
                    troopId = this._params[1];
                } else if (this._params[0] === 1) {
                    troopId = $gameVariables.value(this._params[1]);
                } else {
                    troopId = $gamePlayer.makeEncounterTroopId();
                }
                if ($dataTroops[troopId]) {
                    
                    //NEW
                    boolean = false;
                    for (var i = 0; i < $dataMap.events.length; i++) {
                        if ($dataMap.events) {
                            var note = $dataMap.events.note
                            var note_args = note.split(" ");
                            var note_command = note_args.shift().toLowerCase();            
                            if (note_command == "light" || note_command == "fire" || note_command == "daynight" || note_command == "flashlight" ) {            
                                boolean = true;        
                                break;
                            }
                        }
                    }
                    if ($dataMap.note.toLowerCase() == 'daynight') { //NEW
                        console.log($gameVariables.valueDayNightColor());
                        console.log($gameVariables.valueDayNightSave());
                        $gameTemp._Tint = $gameVariables.valueDayNightColor()[$gameVariables.valueDayNightSave()];
                    } else if (boolean) {
                        $gameTemp._Tint = $gameVariables.valueTintValueSave();
                    } else {
                        $gameTemp._Tint = '#FFFFFF';
                    }
                    //NEW
                    
                    BattleManager.setup(troopId, this._params[2], this._params[3]);
                    BattleManager.setEventCallback(function(n) {
                        this._branch[this._indent] = n;
                    }.bind(this));
                    $gamePlayer.makeEncounterCount();
                    SceneManager.push(Scene_Battle);
                }
            }
            return true;
        };
        
        Spriteset_Battle.prototype.createBattleLightmask = function() {
            this._lightmask = new BattleLightmask();
            this.addChild(this._lightmask);
        };
        
        
        Spriteset_Battle.prototype.createLowerLayer = function() {
            Spriteset_Base.prototype.createLowerLayer.call(this);
            this.createBackground();
            this.createBattleField();
            this.createBattleback();
            this.createEnemies();
            this.createActors();
            this.createBattleLightmask();
        }
        
        function BattleLightmask() {
            this.initialize.apply(this, arguments);
        }
        
        BattleLightmask.prototype = Object.create(PIXI.DisplayObjectContainer.prototype);
        BattleLightmask.prototype.constructor = BattleLightmask;
        
        BattleLightmask.prototype.initialize = function() {
            PIXI.DisplayObjectContainer.call(this);
            this._width = Graphics.width;
            this._height = Graphics.height;
            this._sprites = [];
            this._createBitmap();
            
            //Initialize the bitmap
            this._addSprite(0,0,this._maskBitmap);
            if ($gameTemp._Tint === '#000000' || $gameTemp._Tint === '#111111' || $gameTemp._Tint === '#222222'){
                $gameTemp._Tint = '#333333' //The player have to see something
            }
            this._maskBitmap.FillRect(0,0,maxX,maxY,$gameTemp._Tint);
        };
        
        BattleLightmask.prototype._createBitmap = function() {
            this._maskBitmap = new Bitmap(maxX,maxY);
            var canvas = this._maskBitmap.canvas;
        };
        
        BattleLightmask.prototype.update = function() {
                  //do nothing
        };
        
        //@method _createBitmaps
        
        /**
         * @method _addSprite
         * @private
         */
        BattleLightmask.prototype._addSprite = function(x1,y1,selectedbitmap) {
            
            var sprite = new Sprite(this.viewport);
            sprite.bitmap = selectedbitmap;
            sprite.opacity = 255;
            sprite.blendMode = 2;
            sprite.x = x1;
             sprite.y = y1;
            this._sprites.push(sprite);
            this.addChild(sprite);
            sprite.rotation = 0;
            sprite.ax = 0
            sprite.ay = 0
             sprite.opacity = 255;
        };
        
        /**
         * @method _removeSprite
         * @private
         */
        BattleLightmask.prototype._removeSprite = function() {
            this.removeChild(this._sprites.pop());
        };

     


    It doesn't allow to use the tint system as well (may be a good extension for later, for now I prefer the classic Tint Screen command), but it creates a special lightmask for battle who have the same color as the previous color of the map.

    Spoiler
    Sans%20titre_zps9mlkmgqd.png



     
  13. Alexandre said:
    What about this implementation?


     

    I like what you have done, but the amount of system-scripts your script overwrites scares me. Overwriting such a large amount of scripts often leads to serious compatibility problems with other plugins.
  14. Terrax said:
    I like what you have done, but the amount of system-scripts your script overwrites scares me. Overwriting such a large amount of scripts often leads to serious compatibility problems with other plugins.



    The guy who invented aliasing was not an imbecile.

    Spoiler
        var TerraxLighting_Addon_BattleManager_setup = BattleManager.setup;
        BattleManager.setup = function(troopId, canEscape, canLose) {


            boolean = false;
            for (var i = 0; i < $dataMap.events.length; i++) {
                if ($dataMap.events) {
                    var note = $dataMap.events.note
                    var note_args = note.split(" ");
                    var note_command = note_args.shift().toLowerCase();            
                    if (note_command == "light" || note_command == "fire" || note_command == "daynight" || note_command == "flashlight" ) {            
                        boolean = true;        
                        break;
                    }
                }
            }
            if ($dataMap.note.toLowerCase() == 'daynight') {
                console.log($gameVariables.valueDayNightColor());
                console.log($gameVariables.valueDayNightSave());
                $gameTemp._Tint = $gameVariables.valueDayNightColor()[$gameVariables.valueDayNightSave()];
            } else if (boolean) {
                $gameTemp._Tint = $gameVariables.valueTintValueSave();
            } else {
                $gameTemp._Tint = '#FFFFFF';
            }


            TerraxLighting_Addon_BattleManager_setup.call(this,troopId, canEscape, canLose);
        }
        
        Spriteset_Battle.prototype.createBattleLightmask = function() {
            this._lightmask = new BattleLightmask();
            this.addChild(this._lightmask);
        };
        
        var TerraxLighting_Addon_Spriteset_Base_createLowerLayer = Spriteset_Battle.prototype.createLowerLayer;
        Spriteset_Battle.prototype.createLowerLayer = function() {
            TerraxLighting_Addon_Spriteset_Base_createLowerLayer.call(this);
            this.createBattleLightmask();
        }
        
        function BattleLightmask() {
            this.initialize.apply(this, arguments);
        }
        
        BattleLightmask.prototype = Object.create(PIXI.DisplayObjectContainer.prototype);
        BattleLightmask.prototype.constructor = BattleLightmask;
        
        BattleLightmask.prototype.initialize = function() {
            PIXI.DisplayObjectContainer.call(this);
            this._width = Graphics.width;
            this._height = Graphics.height;
            this._sprites = [];
            this._createBitmap();
            
            //Initialize the bitmap
            this._addSprite(0,0,this._maskBitmap);
            if ($gameTemp._Tint === '#000000' || $gameTemp._Tint === '#111111' || $gameTemp._Tint === '#222222'){
                $gameTemp._Tint = '#333333' //The player have to see something
            }
            this._maskBitmap.FillRect(0,0,maxX,maxY,$gameTemp._Tint);
        };
        
        BattleLightmask.prototype._createBitmap = function() {
            this._maskBitmap = new Bitmap(maxX,maxY);
            var canvas = this._maskBitmap.canvas;
        };
        
        BattleLightmask.prototype.update = function() {
                  //do nothing
        };
        
        //@method _createBitmaps
        
        /**
         * @method _addSprite
         * @private
         */
        BattleLightmask.prototype._addSprite = function(x1,y1,selectedbitmap) {
            
            var sprite = new Sprite(this.viewport);
            sprite.bitmap = selectedbitmap;
            sprite.opacity = 255;
            sprite.blendMode = 2;
            sprite.x = x1;
             sprite.y = y1;
            this._sprites.push(sprite);
            this.addChild(sprite);
            sprite.rotation = 0;
            sprite.ax = 0
            sprite.ay = 0
             sprite.opacity = 255;
        };
        
        /**
         * @method _removeSprite
         * @private
         */
        BattleLightmask.prototype._removeSprite = function() {
            this.removeChild(this._sprites.pop());
        };

     
  15. Hello Terrax, very thx for this plugin!


    I dont know what im wrong, the game just show me this message when i try to turn On the flashlight :


    "Cannot read property 'meta' of undfined"


    I've only create a commont event with plugin command "Flashlight 8 12 #888888 "


    then add the effect of common event to an object, when i use it the game crash with the error
  16. @terrax , Hey excellent script, just what my game needed. I put it together with mogs standard time system and evented a much better tinting system using this, however I have ran into a little problem and I am unsure if it is just me. First, I have two common events pulled by a parallel (one that directly sets the tint when a player enters an exterior map, and one that fades gradually when the player is on the map depending on the hour). When a player moves indoors it's supposed to run a similar event (turning on a switch to register for the parallel when they go back outside) that holds the tint depending on a variable I have set up. I also have the player radius set to 0. 

    I am not sure if this next part was intended or not, but the tinting only works on maps where I have registered a light source (it doesn't matter whether it is turned on or not), any map without a light source ignores all tinting options. If this was intentional is there a work around that doesn't involve me sneaking in a non-active lightsource in every map.
  17. Omegadragon8 said:
    @terrax , Hey excellent script, just what my game needed. I put it together with mogs standard time system and evented a much better tinting system using this, however I have ran into a little problem and I am unsure if it is just me. First, I have two common events pulled by a parallel (one that directly sets the tint when a player enters an exterior map, and one that fades gradually when the player is on the map depending on the hour). When a player moves indoors it's supposed to run a similar event (turning on a switch to register for the parallel when they go back outside) that holds the tint depending on a variable I have set up. I also have the player radius set to 0. 

    I am not sure if this next part was intended or not, but the tinting only works on maps where I have registered a light source (it doesn't matter whether it is turned on or not), any map without a light source ignores all tinting options. If this was intentional is there a work around that doesn't involve me sneaking in a non-active lightsource in every map.



    One lightsource in each map is required. You can use a lightsource with radius 1 and color '000000' if you do not want a lightsource to show.

    white90 said:
    Hello Terrax, very thx for this plugin!


    I dont know what im wrong, the game just show me this message when i try to turn On the flashlight :


    "Cannot read property 'meta' of undfined"


    I've only create a commont event with plugin command "Flashlight 8 12 #888888 "


    then add the effect of common event to an object, when i use it the game crash with the error

    To activate the flashlight on the player use 'flashlight on'. You trying to use a note-tag call to switch on the player flashlight.
  18. Super upgraded version with no overwrite, no crash when battle-testing and support for tint screen during combat.

    Spoiler
        var TerraxLighting_Addon_BattleManager_setup = BattleManager.setup;
        BattleManager.setup = function(troopId, canEscape, canLose) {


            $gameTemp._Tint = '#FFFFFF';
            if ($dataMap) {
                boolean = false;
                for (var i = 0; i < $dataMap.events.length; i++) {
                    if ($dataMap.events) {
                        var note = $dataMap.events.note
                        var note_args = note.split(" ");
                        var note_command = note_args.shift().toLowerCase();            
                        if (note_command == "light" || note_command == "fire" || note_command == "daynight" || note_command == "flashlight" ) {            
                            boolean = true;        
                            break;
                        }
                    }
                }
                if ($dataMap.note.toLowerCase() == 'daynight') {
                    console.log($gameVariables.valueDayNightColor());
                    console.log($gameVariables.valueDayNightSave());
                    $gameTemp._Tint = $gameVariables.valueDayNightColor()[$gameVariables.valueDayNightSave()];
                } else if (boolean) {
                    $gameTemp._Tint = $gameVariables.valueTintValueSave();
                }
            }
            TerraxLighting_Addon_BattleManager_setup.call(this,troopId, canEscape, canLose);
        }
        
        Spriteset_Battle.prototype.createBattleLightmask = function() {
            this._lightmask = new BattleLightmask();
            this.addChild(this._lightmask);
        };
        
        var TerraxLighting_Addon_Spriteset_Base_createLowerLayer = Spriteset_Battle.prototype.createLowerLayer;
        Spriteset_Battle.prototype.createLowerLayer = function() {
            TerraxLighting_Addon_Spriteset_Base_createLowerLayer.call(this);
            this.createBattleLightmask();
        }
        
        function BattleLightmask() {
            this.initialize.apply(this, arguments);
        }
        
        BattleLightmask.prototype = Object.create(PIXI.DisplayObjectContainer.prototype);
        BattleLightmask.prototype.constructor = BattleLightmask;
        
        BattleLightmask.prototype.initialize = function() {
            PIXI.DisplayObjectContainer.call(this);
            this._width = Graphics.width;
            this._height = Graphics.height;
            this._sprites = [];
            this._createBitmap();
            
            //Initialize the bitmap
            this._addSprite(0,0,this._maskBitmap);
            var redhex = $gameTemp._Tint.substring(1,3);
            var greenhex = $gameTemp._Tint.substring(3,5);
            var bluehex = $gameTemp._Tint.substring(5);
            var red = parseInt(redhex, 16);
            var green = parseInt(greenhex, 16);
            var blue = parseInt(bluehex, 16);
            var color = red+green+blue;
            if (color<153 && red<51 && green<51 && blue<51){
                $gameTemp._Tint = '#333333' //The player have to see something
            }
            $gameTemp._BattleTint = $gameTemp._Tint;
            this._maskBitmap.FillRect(0,0,maxX,maxY,$gameTemp._Tint);
            $gameTemp._BattleTintSpeed = 0;
        };
        
        BattleLightmask.prototype._createBitmap = function() {
            this._maskBitmap = new Bitmap(maxX,maxY);
            var canvas = this._maskBitmap.canvas;
        };
        
        


        //Plugin commands:
        //TintBattle set #FF0000     -> Tint the battle screen to the color used as argument.


                                                        Automatically set too dark color to '#333333' otherwise the player wouldn't see anything.
        //TintBattle reset             -> Reset the battle screen to his original color.
        //TintBattle fade #FF0000 5 -> Fade the battle screen to the color used as first argument.
        //                               The second argument is speed of the fade (1 very fast, 20 more slow)
        //                               Still automatically set too dark color to '#333333' otherwise the player wouldn't see anything.
        
        var TerraxLighting_Addon_Game_Interpreter_pluginCommand = Game_Interpreter.prototype.pluginCommand;
        Game_Interpreter.prototype.pluginCommand = function(command, args) {
            TerraxLighting_Addon_Game_Interpreter_pluginCommand.call(this, command, args);
            if (command === 'tintbattle' && $gameParty.inBattle()) {
             
                if (args[0] === 'set') {
                    $gameTemp._BattleTint = args[1];        
                    var redhex = $gameTemp._BattleTint.substring(1,3);
                    var greenhex = $gameTemp._BattleTint.substring(3,5);
                    var bluehex = $gameTemp._BattleTint.substring(5);
                    var red = parseInt(redhex, 16);
                    var green = parseInt(greenhex, 16);
                    var blue = parseInt(bluehex, 16);
                    var color = red+green+blue;
                    if (color<153 && red<51 && green<51 && blue<51){
                        $gameTemp._BattleTint = '#333333' //The player have to see something
                    }
                    $gameTemp._BattleTintSpeed = 0;
                }  
                if (args[0] === 'reset') {
                    $gameTemp._BattleTint = $gameTemp._Tint;
                    $gameTemp._BattleTintSpeed = 0;
                }


                if (args[0] === 'fade') {
                    $gameTemp._BattleTintFade = $gameTemp._BattleTint;
                    $gameTemp._BattleTintTimer = 0;
                    $gameTemp._BattleTint = args[1];        
                    $gameTemp._BattleTintSpeed = args[2];
                    var redhex = $gameTemp._BattleTint.substring(1,3);
                    var greenhex = $gameTemp._BattleTint.substring(3,5);
                    var bluehex = $gameTemp._BattleTint.substring(5);
                    var red = parseInt(redhex, 16);
                    var green = parseInt(greenhex, 16);
                    var blue = parseInt(bluehex, 16);
                    var color = red+green+blue;
                    if (color<153 && red<51 && green<51 && blue<51){
                        $gameTemp._BattleTint = '#333333' //The player have to see something
                    }
                }    
            }
        }



        
        BattleLightmask.prototype.update = function() {    
                    var color1 = $gameTemp._BattleTint;    
                    if ($gameTemp._BattleTintSpeed > 0) {
                        
                        $gameTemp._BattleTintTimer += 1;
                                                    
                        var r = hexToRgb($gameTemp._BattleTintFade).r;
                        var g = hexToRgb($gameTemp._BattleTintFade).g;
                        var b = hexToRgb($gameTemp._BattleTintFade).b;
                                            
                        var r2 = hexToRgb($gameTemp._BattleTint).r;
                        var g2 = hexToRgb($gameTemp._BattleTint).g;
                        var b2 = hexToRgb($gameTemp._BattleTint).b;                        
                                            
                        var stepR = (r2-r)/(60*$gameTemp._BattleTintSpeed);
                        var stepG = (g2-g)/(60*$gameTemp._BattleTintSpeed);
                        var stepB = (b2-b)/(60*$gameTemp._BattleTintSpeed);
                                                                                                
                        var r3 = Math.floor(r + (stepR * $gameTemp._BattleTintTimer));
                        var g3 = Math.floor(g + (stepG * $gameTemp._BattleTintTimer));
                        var b3 = Math.floor(b + (stepB * $gameTemp._BattleTintTimer));
                        if (r3<0) { r3 = 0 }
                        if (g3<0) { g3 = 0 }
                        if (b3<0) { b3 = 0 }
                        if (r3>255) { r3 = 255 }
                        if (g3>255) { g3 = 255 }
                        if (b3>255) { b3 = 255 }                                
                        var reddone = false;
                        var greendone = false;
                        var bluedone = false;
                        if (stepR >=0 && r3>=r2) {
                            reddone = true;    
                        }
                        if (stepR <=0 && r3<=r2) {
                            reddone = true;    
                        }
                        if (stepG >=0 && g3>=g2) {
                            greendone = true;    
                        }
                        if (stepG <=0 && g3<=g2) {
                            greendone = true;    
                        }    
                        if (stepB >=0 && b3>=b2) {
                            bluedone = true;    
                        }
                        if (stepB <=0 && b3<=b2) {
                            bluedone = true;    
                        }                    
                        if (reddone == true && bluedone == true && greendone == true) {
                            $gameTemp._BattleTintFade = $gameTemp._BattleTint;
                            $gameTemp._BattleTintSpeed = 0;
                            $gameTemp._BattleTintTimer = 0;
                        }
                        color1 = "#" + ((1 << 24) + (r3 << 16) + (g3 << 8) + b3).toString(16).slice(1);
                        $gameTemp._BattleTintFade = color1;
                    }                                                            
                    this._maskBitmap.FillRect(0,0,maxX,maxY,color1);
        };
        
        //@method _createBitmaps
        
        /**
         * @method _addSprite
         * @private
         */
        BattleLightmask.prototype._addSprite = function(x1,y1,selectedbitmap) {
            
            var sprite = new Sprite(this.viewport);
            sprite.bitmap = selectedbitmap;
            sprite.opacity = 255;
            sprite.blendMode = 2;
            sprite.x = x1;
             sprite.y = y1;
            this._sprites.push(sprite);
            this.addChild(sprite);
            sprite.rotation = 0;
            sprite.ax = 0
            sprite.ay = 0
             sprite.opacity = 255;
        };
        
        /**
         * @method _removeSprite
         * @private
         */
        BattleLightmask.prototype._removeSprite = function() {
            this.removeChild(this._sprites.pop());
        };

     
  19. Hi Terrax


    First, thanks for your work with this plugin!


    I have a suggestion for a new version which would bring parallax mapping to a new level (for me at least): You already have the function to block certain regions from having light. I use parallax maps that aren't related to the usual grid and it looks quite uncool with the normal region block. So is there a possibility to have a light block option that is map based (like a layer that blocks the light out)? Or even better: Since I'm using Kaus Ultimate overlay for mapping, having an option that blocks out the light for certain layers only?
  20. Whenever I use this plugin and enter a map which is a 'parallax map' I get an error saying "Plugin: Xxxpicture below_characters is not a valid layer"


    If I enter a non-parallax map it works fine.