Terrax Lighting system

● ARCHIVED · READ-ONLY
Started by Terrax 1467 posts Page 20 of 74 View original ↗
  1. Skurge said:
    Would there be a way to activate/deactivate the event tag from a plugin command?

    'Flashlight 8 12 #888888 1 2'  in the note tag..


    Plugin command 'Light on 1'  turns the flashlight on


    Plugin command 'Light off 1' turns the flashlight off.

    Jaggerwock said:
    Thanks a lot for your plugin !
    But I got a problem and the 19pages searching didn't change it..
    How can you change the radius of the light on a moving event ?


    (sorry if the answer was already posted)

    There is currently no way to change the light radius of events (other then turn them off)

    firestalker said:
    Ok...  I have two things that I found wrong with this plugin.


    1. When you "deactivate" the plugin using a plugin call and then save the game, when you load that saved game the plugin is "activated" again.


    2. I would like to see the player 'halo' light disappear when the player is transparent.  It messes up the cutscenes if they player can find their invisible selves by the strange glow in the corner or center of the room.


    Other than that....  Great plugin, it works great.

    1. Yep, thats a bug, will be fixed.


    2. Use plugin command : 'Light radius 0 #000000' when you want the players 'halo' to disappear.
  2. Would it be possible to make light sources more pixilated instead of super-smooth? Kind of like how the torch in A Link to the Past looked?
     
  3. Terrax said:
    1. Yep, thats a bug, will be fixed.


    2. Use plugin command : 'Light radius 0 #000000' when you want the players 'halo' to disappear.

    Thanks...  That worked.


    But why does the tint grow darker as the event goes on?  I set the Tint to #080808 but as the event goes on the tint changes to #000000.  It's a bit annoying.
  4. firestalker said:
    But why does the tint grow darker as the event goes on?  I set the Tint to #080808 but as the event goes on the tint changes to #000000.  It's a bit annoying.



    This bug should have been fixed last update, check you have have the most recent update.
  5. There is currently no way to change the light radius of events (other then turn them off)

    Is it planned to add this in a future update ?
  6. Terrax said:
    This bug should have been fixed last update, check you have have the most recent update.

    I thought I did, but I'll check it out...  thanks
  7. Ahh I am having issues with the Kaus Overlay script and this one, as i turned it off and got it working, turned it on and it goosed it, might need a new overlay script! 


    Couple of Queries


    Day/Night Cycle Timer - does this once set replicate across all your maps, so if I had the event setting how long each hour is, and the colours for each hour on a parallel event in my starting map, it then will just continue on like this?  it continues on, was testing in map and realized this (what a muppet I am)


    With your self switch lights, in your event 011 on map005, it says if: self switch A is on (what switch is this referring too) as the light events it turns on and off have assigned self switch D? (copied and pasted the events from your map to mine and it works a treat but just wanted to understand why they are on switch D but it refers to switch A?


    EDITEDIT: Is there a way to increase the time by a flat amount, so if they went to an inn it would just add an additional 8 hours on?


    Cheers :)


    (Nice script btw makes the game feel much more full and  that the world is actually working rather than just eternal sunlight!
  8. My prior question on commercial usage was not answered, is commercial use allowed or discouraged?
  9. Diretooth said:
    My prior question on commercial usage was not answered, is commercial use allowed or discouraged?

    If you looked through the whole script you'd see


     * 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.


    :p
  10. Sense, I did not see it. Thanks.
  11. Hello. I searched the entire thread but couldn't find the answer to my problem.


    First of all, thanks to Terrax for creating what is definitely one of my favorite plugins. Second, I want to say that I am very happy with it and that it worked fine so far. In the game that I'm currently working on I have a torch item that performed fine when it was just a basic on/off. Then I wanted to make the torchlight appear and disappear gradually, and this seems to cause problems (sometimes).


    I used the command: Fire radiusgrow 200 #FFCC00 to activate the torch, and Fire radiusgrow 0 #FFCC00 to deactivate it. However, when the torch dies, just when the light is down to the last pixel but before it completely disappears the game breaks with the following message:


    IndexSizeError


    Failed to execute 'createRadialGradient' on 'CanvasRenderingContext2D': The rl provided is les than 0








    I worked around this by instead expanding the extinguish code like this. The idea was to let the light dim about halfway down and then cut it off completely.


    Fire radiusgrow 50 #FFCC00


    Wait: 240 frames


    Fire radius 0 #FFCC00


    This is where it got weird. What happened was that the game crashed with the same IndexSizeError message again, but this time as soon as I lit the torch in the first place! You can imagine my confusion. So I redid both events back to the basic Fire radius 200 #FFCC00 and Fire radius 0 #FFCC00. I tested and this worked fine. Then I changed it back to the growing radius as described above and tested again... And that worked too. I was starting to think that perhaps I'm imagining things or I don't know what, because I could no longer replicate the error - until I edited the chest event that gives you the torch in the first place. This put me back on the error, even though the change has absolutely nothing to do with the codes for creating/destroying light.


    Can you help me understand the error better? What is it attached to, exactly? It seems that every time I launch the test there is a chance that the error will happen either when lighting or extinguishing the torch (only when using radiusgrow though, while just radius never creates problems). I wish I could explain it better but I'm completely confused. This seems impossible to reliably replicate. It's acting unstable for some reason. Sometimes I get it to work, but then I change some detail like the value from 200 to 150 - and nothing else - run game again, crashes on lighting the torch.


    Help?


    EDIT: I finally settled for this variant of code (common event tied to the torch item):


    Plugin Command : Fire radiusgrow 50 #FFCC00


    Wait : 120 frames


    Plugin Command : Fire radius 150 #FFCC00


    Text : None, Dim, Bottom


             : You light the \c[14]Torch.


    The text doesn't even display, which I guess means the game breaks right before that line. If I delete the Wait and radiusgrow commands, leaving only the flat radius command, everything works fine and when it's time to extinguish the torch that code works perfectly even though it is literally the opposite process:


    Text : None, Dim, Bottom


             : Your torch slowly dies.


    Plugin Command : Fire radiusgrow 50 #FFCC00


    Wait : 120 frames


    Plugin Command : Fire radius 0 #FFCC00


    Is this random or what?
  12. New version (1.2.5) now available


    http://mvplugins.com...Lighting System


    Version 1.2.5


    Bugfix : Shrinking torches to 0 would cause an error.


    Bugfix : Script Activate/Deactivate status was not saved.


    Added : Plugin command : 'Daynight add 8 30' will add 8 hours and 30 minutes to the current time.

    Hello. I searched the entire thread but couldn't find the answer to my problem.


    Is this random or what?



    It was a bug. Thanks for the detailed explanation, made it easy to find and fix.

    BigToastie said:
    With your self switch lights, in your event 011 on map005, it says if: self switch A is on (what switch is this referring too) as the light events it turns on and off have assigned self switch D? (copied and pasted the events from your map to mine and it works a treat but just wanted to understand why they are on switch D but it refers to switch A?


    Is there a way to increase the time by a flat amount, so if they went to an inn it would just add an additional 8 hours on?

    In the event on map5, selfswitch A is used as a state switch, so the script remembers if the light is on or off.


    SwitchA = on-> the light is on, SwitchA = off -> the light is off. This is done to prevent the script calling a plugin command every cycle, now it only calls a plugin command when the light changes.


    I tried to explain how to add time with normal scripting, but i found it so annoying that i just coded a plugin command for it.


    Use plugin command 'Daynight add 8 30' to add 8 hours and 30 minutes to the current time.
  13. @Terrax - Sure enough, it works! *woof* (I mean of course it works :p)


    Thank you kindly for a swift and effective solution.
  14. Hi Terrax,
    So sad, but this plugin DONT compatible with  Bind Pictures To Map plugin. I tested this fact on a new project without any other plugins.


    Conditions:

    • If I put Light System above the Bind Pictures To Map in my plugins list, your plugin dont work - simply no visual changes.
    • If I put Light System below the Bind Pictures To Map in my plugins list, I see the error immediately after the start menu:


    error.PNG
  15. PTS said:
    Hi Terrax,
    So sad, but this plugin DONT compatible with  Bind Pictures To Map plugin. I tested this fact on a new project without any other plugins.


    Conditions:

    • If I put Light System above the Bind Pictures To Map in my plugins list, your plugin dont work - simply no visual changes.
    • If I put Light System below the Bind Pictures To Map in my plugins list, I see the error immediately after the start menu:



    This is a known issue, both plugins overwrite the same system core script.


    I did not find an easy way to resolve it in my plugin, but it can be resolved in the Bind pictures to map plugin,


    It can be solved by adding 3 lines to the TDDP plugin. You can ask the author to include them, or include them yourself.


    Edit the function that starts on line 100 of the script.

    Code:
        //=============================================================================
        // Spriteset_Map
        //============================================================================= 
        Spriteset_Map.prototype.createLowerLayer = function() {
            Spriteset_Base.prototype.createLowerLayer.call(this);
            this.createPicturesLayer('bottom', this._baseSprite);
            this.createParallax();
            this.createPicturesLayer('below_tilemap', this._baseSprite);
            this.createTilemap();
            this.createPicturesLayer('below_characters', this._tilemap);
            this.createCharacters();
            this.createPicturesLayer('above_characters', this._tilemap, 8);
            this.createShadow();
            this.createPicturesLayer('below_weather', this._tilemap, 8);
            if (Imported.TerraxLighting) {       // Add these 3 lines
             	this.createLightmask();      	 // And make sure TerraxLighting
         	}                                    // is above TDDP in the plugin-list.
        	this.createWeather();
            this.createPicturesLayer('top', this);
            this.createDestination();
        };
  16. Terrax said:
    ...
    if (Imported.TerraxLighting) { // Add these 3 lines
    this.createLightmask(); // And make sure TerraxLighting
    } // is above TDDP in the plugin-list.
    ...



    Thank you very much, your advice has helped me! It works now.
  17. Its me again. ))


    Forgive me for meticulousness, but I have another problem... with flashlights.
    Flashlight conditions is not executed: Instead of directional light, I get a sphere for fixed or moving events. Please, see attach.


    However, the conditions are well satisfied for the main character.


    What could be causing the problem?


    Untitled-1.png


    UPD: ))) I solved the problem...


    "Flashlight 8 12 #888888 1 2"  in the note tag..
    Plugin command 'Light on 1'  turns the flashlight on
    Plugin command 'Light off 1' turns the flashlight off.
  18. Hey Terrax, 


    I was just wondering if there's a way to disable the black layer mask altogether, but retain the lighting effects. I'm trying to use this in conjunction with another script that chnages the tint based on the time of day- and was curious if there was any compatibility there?


    Much thanks indeed, keep up the good work!
  19. KidCreator said:
    Hey Terrax, 


    I was just wondering if there's a way to disable the black layer mask altogether, but retain the lighting effects. I'm trying to use this in conjunction with another script that chnages the tint based on the time of day- and was curious if there was any compatibility there?


    Much thanks indeed, keep up the good work!



    If you use the daynight system ("DayNight" note tag for event), you need to open the TerraxLighting.js file with Notepad and to find a small piece of code:


    var daynightcolors = [ '#000000', '#000000', '#000000', '#000000',
    '#000000', '#000000', '#666666', '#AAAAAA',
    '#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF',
    '#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF',
    '#FFFFFF', '#FFFFFF', '#AAAAAA', '#666666',
    '#000000', '#000000', '#000000', '#000000' ];






    Each hex code format #000000 (black) - determines the color value for each night & evening hours of the day. The order value is indicated at midnight (at 00:00)


    Change the hex code for each hour that you need. exsample #FFFFFF (white) - for all hours and the tint will not be displayed.


    HEX Color Tool


    PS:


    Dear Terrax, if you're reading this, then perhaps you have the time and desire to add some important options and settings in the plugin. It would be very convenient. ;)
  20. PTS said:
    If you use the daynight system ("DayNight" note tag for event), you need to open the TerraxLighting.js file with Notepad and to find a small piece of code:



    var daynightcolors = [ '#000000', '#000000', '#000000', '#000000',
    '#000000', '#000000', '#666666', '#AAAAAA',
    '#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF',
    '#FFFFFF', '#FFFFFF', '#FFFFFF', '#FFFFFF',
    '#FFFFFF', '#FFFFFF', '#AAAAAA', '#666666',
    '#000000', '#000000', '#000000', '#000000' ];






    Each hex code format #000000 (black) - determines the color value for each night & evening hours of the day. The order value is indicated at midnight (at 00:00)


    Change the hex code for each hour that you need. exsample #FFFFFF (white) - for all hours and the tint will not be displayed.



    Thankyou my friend, you are a lifesaver <3