Terrax Lighting system

● ARCHIVED · READ-ONLY
Started by Terrax 1467 posts Page 12 of 74 View original ↗
  1. Fitcher said:
    ah right, i feel so stupid now hehe...

    but one thing im wondering will it be possible so when i time it will slowly change the color?

    I mean like if i set #ffffff as the collor for 12:00 and #111111 for 1:00.

    Then i change the time from 12:00 to 1:00 it would slowly change it from #ffffff to #111111 and not instantly.
    over how many minutes would it have to change ?  1 hour, 30 minutes?

    Maybe it would be easier to make a 2nd type of day/night system where you could set the time and color and the system would work towards that color. Ill do some testing to see what i can do.
  2. Terrax - it is Event Light note tag number mentioned as UNIQUE  global for game?

    I mean if i give event notetag :   Fire 120 #FFCC00 1 on MAP1

    And then call plugin command:  Light on 1

    Result is I have all Events with notetag  Fire (radius) (#color) 1 on EVERY MAPS  ON.  - I thought    plugin command:  Light on 1 will switch LIGHT exclusve for recent map, not for every map ingame. 

    It is bug or default behaviour?

    If it is behaviour I will simply rename my lights on every map to not share same number between maps, but if it is bug and will be corrected It will save me this work as I  have about 20 maps in my game atm :) .  And if it is behaviour, what is MAX number? Cos ATM I have about 200 lights with On/Of switch number  together.

    Thank you for your patience and your time. 

    //I am not native speaker, I hope its understable enough//
  3. Yeah well i dont realy know how to explain what i want, english is not my main language.

    But lets say i change time from 1:00 to 12:00 i would like it to look like how it is in this video.

    look at 2:40 when he uses a time warp spell.

    https://www.youtube.com/watch?v=3H9xbVk6LN4
  4. is it only for me, or when two light sources overlaps u can see darker border lines inside light reflections ?
  5. Kilitar said:
    Terrax - it is Event Light note tag number mentioned as UNIQUE  global for game?

    I mean if i give event notetag :   Fire 120 #FFCC00 1 on MAP1

    And then call plugin command:  Light on 1

    Result is I have all Events with notetag  Fire (radius) (#color) 1 on EVERY MAPS  ON.  - I thought    plugin command:  Light on 1 will switch LIGHT exclusve for recent map, not for every map ingame. 

    It is bug or default behaviour?

    If it is behaviour I will simply rename my lights on every map to not share same number between maps, but if it is bug and will be corrected It will save me this work as I  have about 20 maps in my game atm :) .  And if it is behaviour, what is MAX number? Cos ATM I have about 200 lights with On/Of switch number  together.

    Thank you for your patience and your time. 

    //I am not native speaker, I hope its understable enough//
    I can only switch on/off the lights on the map that is currently loaded, but once they are switched on they are saved in memory so that when you return to the map the lights are as you left them. The maximum amount of lights would be 4,294,967,295, but i doubt you will reach that ;)

    Fitcher said:
    Yeah well i dont realy know how to explain what i want, english is not my main language.

    But lets say i change time from 1:00 to 12:00 i would like it to look like how it is in this video.

    look at 2:40 when he uses a time warp spell.

    https://www.youtube.com/watch?v=3H9xbVk6LN4
    Next update there will be a new feature that can do all this.

    Kirika said:
    is it only for me, or when two light sources overlaps u can see darker border lines inside light reflections ?
    Its not just you, the filters used aren't perfect and some borders can show at some distances.
  6. Terrax said:
    Its not just you, the filters used aren't perfect and some borders can show at some distances.
    well.....

    i tinkered a little with you script and tried different ways to fix that - changing color from 'black' on 'transparent' in all radialgradientFillRect entries actually make some noticeable visual changes (like force me to increase radius on all my lights and made flickering less noticeable) but look like that fix border problem in my current project (need more tests with different colors to confirm that thought)
  7. "I can only switch on/off the lights on the map that is currently loaded, but once they are switched on they are saved in memory so that when you return to the map the lights are as you left them. The maximum amount of lights would be 4,294,967,295, but i doubt you will reach that  ;)"

    Terrax  -  well, it is not how it really works now :) . I have trouble to explain it with my english.. 

    MAP1  - Event33: Fire 120 #FFCC00 1

    MAP2  - Event62: Light 150 #FFFFFF 1

    MAP3  - Event11: Light 180 #CCCCFF 1

    I was on MAP1, and there I switched light ON by plugin command:  Light on 1 so Event33 on MAP1  lights ON

    I saved game.  Then I loaded it again next day and visit MAP2 and MAP3 (zones where I never been before)

    When I transit to MAP2 - Event62 on MAP2 was ON as well!

              I  transit to MAP3 - Event11 on MAP3 was ON also.  - because they are all ťagged "1" - and "1" is ON for MAP1.

    Maybe reason is, the "previous save" was made with older plugin version?  I will try do some tests on fresh test game and let you know. 
  8. Alright im glad to hear, then i will just have to wait.

    P.S

    I did some testing on the issue Kilitar got, and "Light on 1" does actually turn on all lights given the number 1 on other maps as well.

    I made 3 maps A, B and C.

    All 3 maps had light source with note tag "Fire 150 #FFCC00 1"

    I start on map A and i got a event on map A that does "Light on 1" when spoken too, it turns ON light on map A, B and C

    "Light off 1" does the same turning lights OFF on map A, B and C

    This was tested with the most recent version and a new game.

    I would say even if its not intended to be like this i kinda like this feature anyway so it would be nice if there is two commands.

    one to turn on/off the lights on current map with given number and one for turning on/off lights on all maps with the given number.
  9. Portkey89 said:
    Hi Terrax--

    Really excited to see the radiusgrow effect taking shape.  Thanks for the ultra-fast turnaround!  For whatever reason, I'm running into an issue where the shrinking radius is taking place at an almost imperceptible rate.  I'm currently trying to reduce from 2500 to 500.  Is there anyway to control how fast/slow it happens?  ie. How many frames it takes?  Not sure of the math currently used to determine its speed.

    Terrax said:
    I can make the radius grow effect relative to the amount it has to grow.. how much time (in seconds) did you

    have in mind for the growth/shrink to complete?
    Hi Terrax, I have to agree with Portkey89, after exploring the plugin a little I came here searching exactly how to do that.

    Anyways, there might be a more effective way to do it, but here's some minor changes I made to your script to make this work for me. It's not exact, but it seems to work alright for 60 seconds.

    Also i'm assuming that setting a switch to 0 has no effect.

    Spoiler
    //******************* Light radiusgrow 100 #FFFFFF ************************ if (args[0] == 'radiusgrow') { var evid = this._eventId; //Graphics.printError('test',evid); var newradius = Number(args[1]); if (newradius >= 0) { //player_radius = newradius; lightgrow_value = player_radius; lightgrow_target = newradius; if(args[4]) { if(player_radius > newradius) { //shrinking lightgrow_speed = (player_radius * 0.012) / Number(args[4]); } else { //growing lightgrow_speed = (newradius * 0.012) / Number(args[4]); } }else { lightgrow_speed = (Math.abs(newradius-player_radius))/500; } } if (args.length > 2) { playercolor = args[2]; var isValidPlayerColor = /(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(playercolor); if (!isValidPlayerColor) { playercolor = '#FFFFFF' } $gameVariables.setPlayerColor(playercolor); } }
    Code:
    			// ******** GROW OR SHRINK GLOBE *********						if (lightgrow_value < lightgrow_target) {							lightgrow_value = lightgrow_value + lightgrow_speed;				//console.log("(<)lightgrow_value = " + lightgrow_value);				if(lightgrow_value > lightgrow_target) {					//other wise it can keep fliping back and forth between > and <					lightgrow_value = lightgrow_target;				}				player_radius = Math.floor(lightgrow_value)				$gameVariables.setRadiusSave(player_radius);			}			if (lightgrow_value > lightgrow_target) {								lightgrow_value = lightgrow_value - lightgrow_speed;				//console.log("(>)lightgrow_value = " + lightgrow_value);				if(lightgrow_value < lightgrow_target) {					//other wise it can keep fliping back and forth between > and <					lightgrow_value = lightgrow_target;				}				player_radius = Math.floor(lightgrow_value)				$gameVariables.setRadiusSave(player_radius);			}
    edit: added spoiler tag to fold.
  10. Terrax, with all these updates and bug fixes I forgot to ask a few things. For the DayNight tag, wouldn't it be better if it was in the Map's Notes?

    If only to avoid littering the maps with events; especially in busy ones. You just add the tag in the map's notes and remove it if you don't want it on that map.

    For the daynight colors, I'm wondering if it's possible to load the colors from a text file and set them as the global parameter settings for easier editing and to avoid event copy-pasta if possible. (Ask me to elaborate a little more if you want to try this) You can keep the current method too so as to allow certain areas to deviate from the global settings.

    And did you attempt the terrain tag thingy? Or was it too complicated and diabolical to bother with?  :guffaw:    
  11. Terrax said:
    I looked though the code and realised the flashlight can already be turned on and off with the script, just add the triggernumber to the end of the tag.

    On the NPC walking around use tag 'Flashlight 10 14 #888888 1' 

    Then call Plugin command 'Light on 1' to turn his flashlight on (selfswitch D gets thrown on the NPC).
    Hmm, okay i got it to work but i do have a question. I put in 'Flashlight 8 12 #888888 1' into the note of the event and by default it makes the event flashlight turned off. then I used the plug in command "Light on 1" to turn it on and "Light off 1" to turn it off, and it worked. However for me the default (gameplay wise) is that the light should be on and only turns off when the player does certain things (knocks out guard from behind, defeats guard in combat, etc) . I can get around this by making a page that basically just turns the flashlight on before doing any other action but i'm not sure if that's the best way to handle this.  any ideas on how to handle this smoother?
  12. Yeah, flashlight on events seems a little buggy to me, they seem to be off until the event moves, meaning if you want a static flash light (like at a cave entrance) you have to move the event once, or use a switch?
  13. gattsbr said:
    Yeah, flashlight on events seems a little buggy to me, they seem to be off until the event moves, meaning if you want a static flash light (like at a cave entrance) you have to move the event once, or use a switch?
    nope, it's suppose to work that way. I asked about that earlier and they stated that it would only work on a moving event. this may change but as of now its working as intended. 
  14. I get an error of "Cannot read property 'addChild' of undifined". Not sure what is causing this...
  15. Terrax said:
    If you are using crosswalk to make the apk, I think the answer to your question is found i the crosswalk faq. https://crosswalk-project.org/documentation/about/faq.html.

    Canvas and WebGL support Why won't WebGL work in Crosswalk on my device?

    Chromium has a blacklist of GPUs which are know to cause stability and/or conformance problems when running WebGL. Chromium will disable WebGL if running on a device with one of the GPUs in this list.

    Crosswalk uses the same blacklist. Consequently, if Crosswalk is running on a device with a blacklisted GPU, WebGL is disabled by default.

    For more information about which GPUs are blacklisted and when, see the Khronos WebGL wiki.
    What I find interesting about this, is that this doesn't work when built for Android, but running the game from a server in chrome on the same device does (is also faster). Maybe someone can explain that? XD
  16. Leave for 2 days and this is what you get .. a mailbox full of replys, oh well.. i'm back!

    Fitcher said:
    Alright im glad to hear, then i will just have to wait.

    P.S

    I did some testing on the issue Kilitar got, and "Light on 1" does actually turn on all lights given the number 1 on other maps as well.

    This was tested with the most recent version and a new game.

    I would say even if its not intended to be like this i kinda like this feature anyway so it would be nice if there is two commands.

    one to turn on/off the lights on current map with given number and one for turning on/off lights on all maps with the given number.
    Yeh, i had it wrong the first time.. its working as intended though, throw a switch on and it will switchs the lights on every event with the 1 tag.

    gattsbr said:
    Hi Terrax, I have to agree with Portkey89, after exploring the plugin a little I came here searching exactly how to do that.

    Anyways, there might be a more effective way to do it, but here's some minor changes I made to your script to make this work for me. It's not exact, but it seems to work alright for 60 seconds.
    Always happy when someone helps out, ill include your changes next update.

    Vegnarus said:
    Terrax, with all these updates and bug fixes I forgot to ask a few things. For the DayNight tag, wouldn't it be better if it was in the Map's Notes?

    If only to avoid littering the maps with events; especially in busy ones. You just add the tag in the map's notes and remove it if you don't want it on that map.

    For the daynight colors, I'm wondering if it's possible to load the colors from a text file and set them as the global parameter settings for easier editing and to avoid event copy-pasta if possible. (Ask me to elaborate a little more if you want to try this) You can keep the current method too so as to allow certain areas to deviate from the global settings.

    And did you attempt the terrain tag thingy? Or was it too complicated and diabolical to bother with?  :guffaw:    
    Daynight tag in map's note.. sounds good, ill take a look

    Daynight colors in file.. sure but i don't have a clue how to load save from files, so help would be needed.

    Did take a look at terrain tags, but i couldn't figure out how each tile was encoded, if you have a page that explains it, please forward it.

    Dallas Robinson said:
    Hmm, okay i got it to work but i do have a question. I put in 'Flashlight 8 12 #888888 1' into the note of the event and by default it makes the event flashlight turned off. then I used the plug in command "Light on 1" to turn it on and "Light off 1" to turn it off, and it worked. However for me the default (gameplay wise) is that the light should be on and only turns off when the player does certain things (knocks out guard from behind, defeats guard in combat, etc) . I can get around this by making a page that basically just turns the flashlight on before doing any other action but i'm not sure if that's the best way to handle this.  any ideas on how to handle this smoother?
    Not realy, most games start with a nice animation to start up the story, i would throw it in there.
  17. Hi, i just LOVE this plugin, but i have one issue. When i try load saved game, it´s always tint red in maps where i use DayNight. No error just red tint

    Any idea what´s wrong?

    PS: Sorry for my english
  18. SenpaiCZ said:
    Hi, i just LOVE this plugin, but i have one issue. When i try load saved game, it´s always tint red in maps where i use DayNight. No error just red tint

    Any idea what´s wrong?

    PS: Sorry for my english
    You need two things to setup the system as of version 1.1.7. The event with the DayNight notetag and the plugin commands that set the colors for the hours of the day.

    You either have an event that sets a red tint light or you have the hour shade event which has a plugin command with a red tint in it.
  19. Vegnarus said:
    You need two things to setup the system as of version 1.1.7. The event with the DayNight notetag and the plugin commands that set the colors for the hours of the day.

    You either have an event that sets a red tint light or you have the hour shade event which has a plugin command with a red tint in it.
    Thanks : ) i will look a it :)
  20. I want to thank Terrax for a great plugin. Amasing work !

    I started to use this plugin in a dungeon of my game. I am currently using a  day/night system with different tint tones dependent on a variable in a paralell common event .

    I want the variable to set the tint not the clock because it gives me more control over the different events i use at certain variable numbers.

    Is it possible to use the day night tints/colors from this plugin instead of the in built tint screen in MV ?

    Can i by that also when it dark in my other village, city or forest  maps use tourch or flashlight items? 

    Sry my bad English.