Help - Search - Members - Calendar
Full Version: AutoLight Reborn
RPG RPG Revolution Forums > Scripting > Script Tutorials > RGSS2
Pages: 1, 2, 3
stripe103
Is there any change you can make this system for XP. IT IS REALLY GREAT!!!
SojaBird
Hey hey,

I haven't used rgss1 ever yet.
I might concider learning it to make scripts like this to rgss1, though I'm not sertain if I could/will.
So sorry to dissapoint you at this time but I'm afraid you should fine some other system or switch to rpg maker vx smile.gif


Greatzz and thanks,
SojaBird.
exiost
I added this on my script that use acidbird system too..
the result this :


can we merge two system script above (Acidbird+Autolight), so it will be perfectly dark?
stripe103
QUOTE (SojaBird @ Apr 18 2010, 03:04 PM) *
Hey hey,

I haven't used rgss1 ever yet.
I might concider learning it to make scripts like this to rgss1, though I'm not sertain if I could/will.
So sorry to dissapoint you at this time but I'm afraid you should fine some other system or switch to rpg maker vx smile.gif


Greatzz and thanks,
SojaBird.

You don't dissapoint me. I was just asking IF you could. If you don't know how to use RGSS1 then that's fine.
And also. I have both XP and VX but my current game is XP.
SojaBird
Hey hey,

@exiost
What's acidbird smile.gif I haven't heard of this before. What does it do?

@stripe103
Oke that's cool. Though if I want to get *back* to rgss1 scripting I'd try to do this first smile.gif


Greatzz,
SojaBird.
exiost
this is the acidbirg system :
http://www.rpgrevolution.com/forums/index....c=39939&hl=
SojaBird
Hey,

I have taken a look at the AcidBird script wich is pretty impresive.
I'm not sure in what way you want to merge this script with mine.
Tell me that and I can tell some more smile.gif


Greatzz,
SojaBird.
t5yvxc
Great script, I just have one question, is there anyway to edit the light system w/o photoshop? My computer doesnt have photoshop and im scared of using keygens so i dont want to use one. Photoshop cost $500+ and its out of my afford range, any alternative programs people would recommend. Thanks in advance
SojaBird
Hey t5yvwc,

Actualy any program will work, though I can recogment one wich supports alpha channels (so no Windows Paint).
I've heard a lot about a program called GIMP.
It seems to be free and good, though I'm not familiar with it.
You'll find it at www.gimp.org

Just use it and save your pic's as png (I'm sertain GIMP will support that format) and you're ready to go smile.gif


Enjoy,
SojaBird.
archeart
Hey nice going keep em coming :3
t5yvxc
Thanks, awesome script, I got the light to work, I just have one question, how do I correspond this script with Kylocks Time Script? Lits lets say when it is 10pm in the game the lights come on?
SojaBird
Hey hey,

So if I'm right you're getting a light to appear on a spot that you don't want right?
To make the script work properly, name the lights correctly with the corresponing map-id number.
You could follow the tutorial (wich I will be updating with a new version update of the script), if you're not sure if you're doing it properly.

Let me know if you have any other problems.


Greatzz,
SojaBird.

ps. I found some nasty things that realy need some improvements.
And I also came up with some other features, so keep a sharp eye.
(Features include some lame missing things as switching the whole script off, but also event placed lights, based on their position (so you could make a picture for a window-shine, and apply that to a event to position it correctly).)
t5yvxc
Thanks for the reply, I finally got everything to work perfectly, my last question is how would I correspond this script with the Kylock Time script. At night I want the street lights to come on, im having trouble figuring out how.
SojaBird
At the moment you should have to do it with a event on every map that checks a condition wether it's night or not.
If the condition is true, put the lights on, else turn them off.

Hope you'll find out.
I'm gonna find something out for you if you like.

You could by the way also use the EventLights and put some condition in there.
See if that works.


Greatzz,
SojaBird.
t5yvxc
thanks, do you have any ideas on how to light up large maps? I tried to merge pics together, but I cant seem to merge them confused.gif
SojaBird
Oke so yea...what you could do is take pictures from the map when they are scaled down.
Then in your Photo-creation program (such as PhotoShop/GIMP), you can scale it up again to the correct size.
You'll lose some details on this map, but's it will only act as helper when creating your lights and shadows, so you won't loose details in those.
If you need some more detail on parts of the map, cause you might want to create a more detailed light, then you can always take an other screenshot of that part and put it on top of your upscaled map.
You'll have to align it properly but you will get the effect you wanted.

Anyways, to realy reply on your question, why can't you merge them?
Just open up all the parts of the big map in your Photo-creation program and align them correctly smile.gif

Let me know if there's anything you'll need to know.


Greatzz,
SojaBird.

ps. This script will come next, after I've released the big update I'm working on for my Achievements script.
t5yvxc
Thanks, I got it to work on a big map, and the lights turn on at night.
You would happen to know how to auto update this part of Kylocks script? (sorry for so many questions)
CODE
# Computes current time and updates variables if used
  def update
    if !@kts_stop
      @total_seconds = (Graphics.frame_count * KTS::SPEED / 60) + @event_offset
      @seconds = (@total_seconds) % 60
      @minutes = (@total_seconds / 60) % 60
      @hours   = (@total_seconds / 3600) % 24
      @days    = (@total_seconds / 86400)
      update_tint
      update_switches
      if KTS::DATABASE_OUTPUT
        $game_variables[KTS::TIME]    = getTime
      end
    end
  end


it updates the game switches automatically, but it wont auto update your script to turn on the lights automatically, i have to go into the menu and then it updates.
How do I get it to auto update?
SojaBird
I think you've just put your hand on a painfull spot, it's something I need to update cause I didn't wrote the script correctly at that point.
I'll see if I can put out a quick and dirty fix-update before I'll get on with something else.

I'll post again if I've got the update ready.


# EDIT #
Oke so I had a look at your problem... Do you have the newest version of AutoLight running?
For the updating of the timescript I'll have to say sorry.
Firstly I don't know in what context this part sits, wich makes it hard to tell why things don't work.
I can also not tell you (jet) how to make my script auto-update when something changes in the timescript.
Let me exactly know what specificly changes to what and when, perhaps I can write you a little add-on for this.


Greatzz,
SojaBird.
SojaBird
@CroniX

Hey so you asked how to enable the spot in only 1 map.
The best way to do this by changing the lightmode or visibility of the spot with a call script event when you teleport to this specific map and back.
I know it's a bit inconvinient now but it's how it shall go for now untill I get a chance to update the script.
Hope it's gonna work for yiu.


Greatings from the nice place of Ireland (with i'net connection),
SojaBird.
CroniX
I'm afraid I don't know how to do that.. I'm a total noob when it comes to rpg maker and I've never done anything like this before.
It would be nice of you to explain it to me more detailed. I know how to teleport and switches and stuff, but was is a call script event? mellow.gif
Greetings
CroniX
SojaBird
Hey

Yea so a call script event is some action to do something with a script you're using.
Actualy it's pure coding.
So I'm not sure now how it goes with tge autolight cause I'm not fully functional at the moment on my iPod.
Though open the script and I'm sure there's some help in there.
I'm sertain that I've written special and easy to use call-script options in the script.
I thought it was something like
CODE
AL.mode = 1
but I'm not sure.
I should check the script when I'm back @ home again smile.gif


Greatzz,
SojaBird.
CroniX
I couldn't find any help but I tried to make an event and clicked on advanced>Script... and wrote "Al.mode = 1", but when I start the game and activate it I get an error called : NoMethodErroroccured while running script. Undefined method `Mode=' for AL:Module.
SojaBird
Hey,

Oke so open the script and go to the part where it says "call scripts".
There you find all the info you need.
Not sure but perhaps its
CODE
AL.mode(1)
Make sure you check the script though.


Greatzz,
SojaBird.
CroniX
Thank you. It works now ^^
I'm sorry I know nothing about scripting unsure.gif
Thanks again, great Script!
SojaBird
No proplem.
I'm here to help.
Enjoy!!

Greatzz,
SojaBird.
Legion Saga
It's not working when you encrypted a project the script cannot read the following graphics:

QUOTE
FileTest.exist?("Graphics/Pictures/#{file}#{format}")

I think its because there's no such thing as Graphics folder anymore and if the script checks if a light/shadow graphic for that map existed
it returns false...

what i want to know is how to make it so that they will check if the file exist inside the encrypted > Game.rgss2a

I found out that thats the bug preventing an encrypted project to check if file existed... so its returning false
ending up displaying nothing
SojaBird
Hey there,

Darn I hadn't tested that when I made the script...
It's a pretty nasty bug wich makes the script quite useless since you want to encrypt your game at some point obviously.
This encrypting though, is also a problem I have to solve for me.
Cause, you see, the encrypting is to protect the gamefiles so they can't be red anymore (not easily at least).
So I have to find a tiny hole in that encryption so I can see what files are in there.

I'll have a look at it rather soon, cause well... This should just be solved.
Thanks for letting me know smile.gif


Greatzz,
SojaBird.

ps. I'll post back here when I know anything more.
kreaven
I've been wondering, will you develop the already almighty script (besides the "bug" solution)? I don't know what others think, but for me another - independent - light mode would be of great help.
I'm using your script instead of Thomas Edison VX, 'cos it gives much better results - like no pixelation. Then again, with your script as it is, I can't assign independent light modes to street lamps (lit at night only) and indoor candles (lit round the clock). I know it's easy to get round this, but the actual situation in my little game is a bit more confusing, which makes it hard to explain. I just wanted to give you a basic insight into the problem.
SojaBird
Hey kreaven,

You actualy can set independant lights.
The newest version of the script also includes the lightmode EventLight wich makes it possible to set a infinite amount of light-sources by making them correctly with a event.
You could try the demo to see how they work smile.gif

I'm sure you'll figure it out biggrin.gif


Greatzz,
SojaBird.

ps. Let me know if you need anymore help, I'm glad to help.
kreaven
Yea, I know about that. I didn't make myself clear, sorry.

I don't like it when light gets through walls, so I just use the basic Light 'mode' for every light source, and adjust the light to fit the area/image. That way the area looks both beautiful and realistic. I don't have the slightest idea if it's possible to add another Light 'mode' or how difficult it'd be.

Thanks for a fast response. Seeing how long the script's been on already, I didn't expect the reply just the day after.
SojaBird
Hey kreaven,

Oke so what you're actualy saying is that you like to have the eventlight only show up, say at walls and not at the top of that.
I'm not sure if it's possible but I could see if I could add some kind of mask-layer for the eventlights so you can mask-off the part where you don't want that to be shown.
If I figure that out I'll be able to get a new mode out pretty quickly.
I might have a look "rather quick" since it's some new and interesting material to look into.


Greatzz,
SojaBird.
Braska
The masking part would likely need to be tied into the autotiles that are used for roof or ceilings. It would actually be pretty complicated, I think, to make that work right :S
kreaven
QUOTE (SojaBird @ Sep 16 2010, 01:32 AM) *
Hey kreaven,

Oke so what you're actualy saying is that you like to have the eventlight only show up, say at walls and not at the top of that.
I'm not sure if it's possible but I could see if I could add some kind of mask-layer for the eventlights so you can mask-off the part where you don't want that to be shown.
If I figure that out I'll be able to get a new mode out pretty quickly.
I might have a look "rather quick" since it's some new and interesting material to look into.


Greatzz,
SojaBird.


Thanks, that would be great as well. I think that what I'm in need of may be done a bit differently. Maybe I'm too demanding, but seeing how much the script can do as yet makes you think that it can go one step further. It already gives quite the possibilities to make realistic lighting. I'll post a screen, it'll ease the explaining.


As you see, that's the lighting I like (not complete yet). I have a candle in a different room that when lit triggers the Light mode on (through AL.light("visible", true)) and vice versa. Now, when the candle is put out, the lights in the screen's room (let's call it so) are put out as well, although they shouldn't. I found a way to get round it somehow, but it may get confusing in the future.

With EventLight I can't get same results, so I have to stick to Light at this stage. If there were two triggers, life would be easier. Of course the two Lights (two triggers = two Lights) can't be used together on one map, as far as I know, but why would I use them together? I can imagine how it would work, but I don't know how to put it into practice, so I turn to you.

Using my 'game' as an example, I blow out the candle in the first room (AL.light2("visible", false)). Then I get to the next room - a.k.a. screen's room - where the lights are still on (AL.light("visible", true); I didn't change this one to false). I hope you understand what I mean. Is it possible?

We could also apply a different approach - make the Light2 comment-dependent. When you put a comment like "cast.light(...)", the Light2 would appear. I'm not even an amateur when it comes to scripting, so I can only give some ideas.

________________________________________________________________________________

Another thing. As you see on the screen, there are no EventLights. When I put it into the right candelabra, it works wonders. When I put exactly same comment into the left candelabra, it doesn't work. I've been trying to figure it out. No success yet.

I hope I didn't make it worse with these explanations. They were to clear things up...
SojaBird
@Braska
Dealing with tile-ids and such is not something I am not experienced in, so I might figure that out.
Though I'm not realy sure if I'll be using that methode to obsure the parts that shouldn't be shown.
I'll have to come up with a better solution to fix this.

@kreaven
Oke so thanks for the explanation.
I'm not sure if I understand it quite good enough but I think I know what you meen.
It's more like you would want to use the EventLight kind of setup though then for the other mode right?
Like you have several parts of the light and shadow pictures for seperate parts of a map/candel.
I actualy did though about this in the past, but it got lost in the proces making the script and time passing by.
I'm realy gonna reconcider this and see if I could work it out for a new script or script-version with lighting.

'Bout the candle thing problem not working... that's odd.
I'll have to take a look in that as well.


And in the end it all comes back to the part where I have to say when I'm able to work on this and what not.
Well, that's the hard problem.
I've left scripting behind a bit for the last year cause of my other very demanding works and projects.
Though I'm sure I'll get back to this at some point.
Getting feedback only makes me want to come back more quicker so thanks for that.

Anyways, I hope you'll be able to hold it out for a bit longer smile.gif


Thanks and greatzz,
SojaBird.
kreaven
QUOTE (SojaBird @ Sep 18 2010, 12:43 PM) *
Oke so thanks for the explanation.
I'm not sure if I understand it quite good enough but I think I know what you meen.
It's more like you would want to use the EventLight kind of setup though then for the other mode right?
Like you have several parts of the light and shadow pictures for seperate parts of a map/candel.
I actualy did though about this in the past, but it got lost in the proces making the script and time passing by.
I'm realy gonna reconcider this and see if I could work it out for a new script or script-version with lighting.

'Bout the candle thing problem not working... that's odd.
I'll have to take a look in that as well.


Yea, I should've put it that way in the first place - EventLight mode's kind of setup, but in Light mode. I think that would solve the problem. And don't thank me for explaining. I should thank you for reading my way too long and complicated explanations, ha ha. laugh.gif

As for the candelabras, the odd thing is, there's no problem with a similar configuration on a different map (two torches there). I'll try fumbling with it a bit, maybe I'll come out with a solution. Maybe "extracting" the map from the game will help. I'll give you the results later.

Oh, and thanks for responding so fast and good will. Most people would lose patience already.

Edit
I now know what caused the problems with EventLight. I used custom images of higher resolution. When used these in events close to the upper edge of the map, EventLight simply refused to work. Is there a way to solve this? Zooming in a small image doesn't work, just like zooming out a big one. I'm almost 100% certain you did mention something about the edges somewhere...

By the way, solving this is not that important, I guess, as you can easily get round it. Oh, and no worries, I can wait. I'll just skip over to some other things. happy.gif
SojaBird
Aperently my online-free-file-server has been removed so the files went missing.
I've fixed the OP so the demo and screens are avalible again wink.gif

Enjoy!!


Greatzz,
SojaBird.
puddinman
This is just too great biggrin.gif But I had this problem when I was using it for my game.
I'm using Yanfly's Menu script(I just wanted to point it out for reference) and every time I'd press a button to go to the menu all of the light and shadow's disappear D: I really want this script for my game but I just can't find a way around it.

Here's a screenshot




Never mind what I just said, I just found a way to fix it tongue.gif Great Script and I'll be giving you credits on it.
Dogurasu
I love the look of this script, but I am trying to figure out how to get it to work so the player has a light on him - like he's carrying a torch or radiating light. I've looked over the demo, but there's nothing in it to show the player emitting light. Is there a way to do this with this script?
SojaBird
@Dogurasu
Hey,

You could try to use the spotlight mode.
It kind of gives the idea that the player is holding a lightsource.

If it doesn't work, you might want to try (and I don't know if this'll work) and let a npc stick to your character wich has been set up as EventLight.

Let me know if you figured it out wink.gif


Greatzz,
SojaBird.
ilmyna
Gonna make an Ace version of it~
thanx for the script! XD
wild_bill236
how do you make an event or item where when you enter a cave it's dark, if you have a torch it will light up around you and the rest of the cave will still be black?
Hilman Mochamad
Excuesme. Could you put your demo at another download site?
I can't download the demo since MegaUpload closed
wild_bill236
QUOTE (Hilman Mochamad @ Mar 15 2012, 08:25 PM) *
Excuesme. Could you put your demo at another download site?
I can't download the demo since MegaUpload closed



I hope they dont mind but i uploaded it to mediafire for you.

http://www.mediafire.com/?wakhhu6zr4lcx2w

let me know if you get it
Lord_Szekelys
Excelent script, thank you SojaBird. But I have a question, how I can call an event so that the light has less opacacity, I tiried with this but it not work:

AL.light("Light", 50, 1, true)


greetings!!
Lord_Szekelys
No help?? incredible...
SojaBird
@Lord_Szekelys

Hey hey,
I can understand what causes the confusion.
The instructions aren't totaly clear.

To change the opacity of the light dynamicly, you'll have to call the next call-script function:
CODE
AL.light("opacity", 50)


If you want to set the opacity to 50 by default, you can just change the script-parameters, which can be found at the customization block.
CODE
#--------------------------#
# Customization AutoLights #
#--------------------------#
(!!Remember: The range of the opacity is 0-255. 50% transparent corresponds to a opacity value of 128.)



I'll do a quick rundown on how to use and read the instructions for the call-scripts.

CODE
#------------------------------------------------------------------------------#
# Call Script                                                                  #
#------------------------------------------------------------------------------#
# - AL.mode(val)                 #                                             #
# - AL.light(parm, val)          # parm: name, opacity, blend, visible         #
# - AL.shadow(parm, val)         # parm: name, opacity, blend, visible         #
# - AL.spot(parm, val)           # parm: name, opacity, blend, visible         #
# - AL.flicker(parm, val)        # parm: opacity, width, height, x, y          #
#                                #                                             #
# - EL.bitmap(val, index = nil)  #                                             #
# - EL.color(val, index = nil)   #                                             #
# - EL.opacity(val, index = nil) #                                             #
# - EL.blend(val, index = nil)   #                                             #
# - EL.visible(val, index = nil) #                                             #
# - EL.zoom(val, index = nil)    #                                             #
#------------------------------------------------------------------------------#


The parts which start with AL are for changing values on the AutoLight.
The parts which start with EL are for changing values in EventLights (seperate or all).

To change the mode of the AutoLight, call the next function with a value, repesenting the new mode (availible modes can be found at the customization block)
CODE
AL.mode(val)


To change a parameter on the light settings, use the next function
CODE
AL.light(parm, val)

The parameter variable is one of the following: "name", "opac", "blend" or "visible".
The value will be the new value of the choosen parameter.
This explanation also accounts for:
CODE
AL.shadow(parm, val)

CODE
AL.spot(parm, val)


For the flicker settings, use:
CODE
AL.flicker(parm, val)

Useable parameters for this, is one of the following: "opacity", "width", "height", "x" or "y".


For event-lights, custom dedicated functions need to be called to change just one parameter.

CODE
EL.bitmap(val, index = nil)
EL.color(val, index = nil)
EL.opacity(val, index = nil)
EL.blend(val, index = nil)
EL.visible(val, index = nil)
EL.zoom(val, index = nil)


For each of the dedicated functions, the first value parameter will hold the new value of the changing parameter.
The second (optional) variable, can hold the index of the eventlight that needs to be changed.
When the second variable isn't set, it'll change the eventlight that is applied on the event from where the function is called*.

*Additional info: The call-script block is called from an event. If this event has an event-light applied to it, this event-light will be changed.




Hope this'll help you out smile.gif
Greatzz,
SojaBird.
Lord_Szekelys
Thank you so much, SojaBird.
I had not been here, because I thought nobody would answer me.
Your explanation was very clear and concise. Now I've started using again your great script.
Thank you very much again.
Gretings!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.