Help - Search - Members - Calendar
Full Version: AutoLight Reborn
RPG RPG Revolution Forums > Scripting > Script Tutorials > RGSS2
Pages: 1, 2, 3
SojaBird
AutoLight Reborn

Version v4.1
Author SojaBird
Release Date
v2.0 > 19-05-08
v3.0 > 21-05-08
v3.1 > 22-05-08
v3.2 > 22-05-08
v3.5 > 11-06-08
v3.7 > 07-08-08
v4.0 Reborn > 18-07-'09
v4.1 Reborn > 30-08-'09


Introduction
Draw lights, shadows, spots and eventlights when using this script!
It'll add more atmosphere to your maps and events.


Features
v1.0 (pre-release)
  • Draw lightmaps and track them by the movement of the player.
v2.0
  • Draw shadowmaps and track them by movement of the player.
v3.0
  • Use light/shadow- or spotmode with personal customization.
v3.1
  • Flicker the spot and improved tracking of the spot (offset bug fixed).
v3.2
  • Smooth and totaly working spotmode.
v3.5
  • Exclude sertain maps that don't need AutoLight-effects;
  • A buch of call-script explanations;
  • Some extra customization options.
v3.7
  • Cleaner code
  • Pictures shall only be drawn if there is a file avalible.
v4.0 Reborn
  • Reborn version!! Build again from scratch;
  • Better handeling of values;
  • EventLight to show lights on events;
  • More awsome features from the old version!!
v4.1 Reborn
  • Zoom function for eventlights added.


To come features
On request.


Script
Click to view attachment


Compatibility
VX only.
All methodes are aliased so perfect compatibility!


Screenshot
Without AutoLight


With AutoLight



DEMO


Video Tutorial on how to use and make lights, shadows and spots for AutoLight!



Installation
Put the script above main.
Change the values to your own wish.
Make pictures of your maps that needs AutoLight's light- and/or shadowmaps.
Make a spot picture or get it from the demo.
Make eventlights or get one from the demo.
Credit me pls.


FAQ
Q: How can I create light- and/or shadowmaps easily?
A:
To create your maps, snap your map (Use Alt+PrintScreen) and put it into Photoshop. Next thing is to resize the picture. Cut off all the unnesasery items from the picture (Use only the WHOLE MAP (inc. the black area)) by drawing a square around the view. Cut the selected area out and create a new composition with the size corrosponding with your map (width=32*X_tiles, height=32*Y_tiles). Paste the cut-out map in this new composition. Now it's up to you where you want your light/shadow. Create the light and/or shadow with the use of the selecting tools. When you're done selecting rightclick in one of the selected area's and choose NewLayer (or feather first). Then rightclick and fill White (also the shadowmaps). Go to save-as and select in the tab fileformat PNG. Set the correct name (Your in the script choosen name+mapID, EG Light1 for map 1) and click save. Go to the script and make sure you have UseLight and/or UseShadow = true so that when you get in to the game a picture is able to be shown when the by you choosen switch is on.



Terms and Conditions
Credit me with site, and the script is free for use in NONCOMERCIAL projects.
If anyone want some changes, please pm me or post it here, I'll track the topic.
woratana
Screenshot looks nice. smile.gif

Btw, you may want to provide demo, so people will know how to make the light/shadow image.
SojaBird
Mmm allright this stinks hard...I did make a video-tut but I accedently overwrite the videofile o_O'' Just my luck...

Should a normal demo be allright? Like ingame?
What do you ppl want? Know how to make maps (video) or how to use the script?

Pls comment...
woratana
Normal demo will be fine to me. smile.gif
SojaBird
Allright! laugh.gif
Let's do that then shall I.
I'll update when it's done.
Ilikepie123
QUOTE (pim321 @ May 20 2008, 04:56 AM) *
Allright! laugh.gif
Let's do that then shall I.
I'll update when it's done.

Sweet! This looks like a great script. A VERY great script. Im going to wait for the demo so I dont give your topic noobosis (A.K.A. When someone asks how to do something involving a script at least twice x])
SojaBird
Well I'll post the demo tonight, my time (+1 hour time that is)...Though I'm not that good at demo's (hehe check my other scripts and you'll only find one realy crappy one), but I'll try.

Perhaps I do a video-tut on how to draw the lights in Photoshop as well (some time tongue.gif)
SojaBird
Allright update to v3.0 with demo included!!
woratana
Pretty nice smile.gif

You may want to teach how to make the light map picture too smile.gif
SojaBird
allright I'll make a vid on that wink.gif
Puppet Of Fate
This would be really good for a cave or something like that where you have to avoid holes in the floor.
SojaBird
yea well it's just awsome for everything smile.gif it's very diverse so ya can do all kind of things with it biggrin.gif
next version will be awsome as well where I'll ad more and more options avalible for all of u laugh.gif

thanks for comment, keep tracked of the topic if ya like the script since I'll do updating a lot on this since I realy like it myself tongue.gif
ERZENGEL
The screenshot looks very nice and the script is very useful for creating more beautiful maps without using many Parallel Process-Events which control the pics. Good work!
SojaBird
thanks...though I'm still improving it...almost have the video tut done...as well v3.1
though I'm still strugling with the tracking of the spot, it's just not right jet, it's offset for some reason
additional, it's also not realy smooth at all icon_teacher.gif
SojaBird
Oke update to v3.1

AND

A vid.tut. on how to make the pics. for AL
woratana
Nice video biggrin.gif

However, in update part for spot. I think using $game_player.real_x / screen_x will work smoother than x. smile.gif
SojaBird
a nice thanks m8, i didnt know that there was some thing as real.x laugh.gif

well thanks that will smooth it a lot smile.gif

though, what is the screen_x precies?



mmm actualy i cant get it working... grmf
SojaBird
Update to v3.2
Smooth spot now thanks to little advice from wora
SephithoR
Nice script , i will try it ! I hope i can make it looking so nice like you! smile.gif
SojaBird
sure u can, just run the tutorial if yár not sure if you do it right wink.gif
hope you enjoy smile.gif
SojaBird
UPDATE TO v3.5!!

Some realy cool new features:
- Exclude sertain maps that don't need AutoLight-effects.
- A buch of call-script explanations.
- Some extra customization options.
Lettuce
ohmy.gif! This is SOOO GOOD!

Thank you for such wonderful script laugh.gif
SojaBird
@Lettuce
Well here ya go.
Hope you like it as much as I do smile.gif.



If anyone have some suggestions for next version, just post it.
SojaBird
bump

I want to work on this again...though what should be added/improved?
SojaBird
Bump any one need some extra's?
Supergodjesus
I plan on using this. I was fiddling aroun with it and it was kind of a pain to implement, but eventually got it. I know next to nothing about scripting. However, I can tell you what -I- think would make it more user-friendly and easier to implement. What I found annoyingly frustrating was the fact that either you have to have a light and shadow map for every map, or define the map to exclude in the script itself. Normally not a problem, but when you have literally hundreds of maps, some needing the autolight and some not needing it, this became ultra annoying. Is there some way to make it so by default all maps are set to no autolight unless the light/shadow pictures exist? Or at least some way of getting rid of the constant crashes when a light/shadow map is not detected for a map that is not defined in the script to exclude?
SojaBird
yea cool
ill work that out as soon as i can smile.gif
davedani
How do I make a light/ Shadow map for big maps. I can't use Screen capture to capture the whole map unless I make the view smaller. Would that work ? I'm using a map that's 100 x 100 - 3200 x 3200 pixels.
SojaBird
well you could put pieces together in photoshop, if you know the size, though you can also use the autoscaling (or is that from an other script of mine) so you can just make for example just a simple 32*32 map and it will autoscale (if it's in this script, ells i'll put it in it)

so just do it in pieces and bring them togheter at the end
Loki333
This is a great script and the video tutorial helped me out tons. The script was plug and play and with the tutorial on making light and shadow maps I didn't have any problems implementing it into my game. You've definately added a special touch to my game biggrin.gif
brawler12
I can't use this script because it says I need Light1, but the demo didn't have it.
SojaBird
To make the script work, you'll have to make your own light- and/or shadowmaps (mode1&3) or spotmap (mode2&3).
If the script says you need Light1, you have to make a lightmap for map nr1.

The script isn't plug and play as most scripts are.
This script realy need some care, as well graphics that are made by you, for your own maps.

Take a look at the videotutorial on how to use the script, it'll help you fix the error and make the script work for you.
brawler12
I don't understand the tutorial because my CPU doesn't have any sound.
SojaBird
Mmmm in that case;

Make sure you have the script setup as you like it.
To make the light appear, there must be a picture of that light.
You can use photoshop or any other picture-editprogram make those (perhaps you'll see how I do it in the tutorial).

Hope this helps.
Good luck, keep me up with your progress.
SojaBird
Update to v3.7

- A more clean code.
- Only draw lights and/or shadows when there is a file avalible.
brawler12
I still can't do it because I don't have the right tools for my Photoshop... and I really want to use this script for my game...
SojaBird
Well...you don't realy need to use Photoshop, you can use all kinds of picture-programs.
It can even be done with paint (though it does look not as good as it could be done with other programs) but it's allways posible.

Wich tools are you missing in Photoshop then?
brawler12
The tool that you use to draw the lights
SojaBird
That's just a simple circular selectiontool.
It should be there as a standard somewhere...Beneath an other rectenqular selectiontool...?

Greatz
brawler12
I don't have that either... well I don't think I have that, but definitly not the circle one...
Neku
Hey, I just 'Tweaked' this alittle so that instead of using the Exclude Maps Feature you simply put a tag (such as "{L}" ) in the Name of the map that you want The autolight to work on..

Example: "House 1" Would NOT use Autolight but "House 1 {L}" Would...

Well i really just wanted to check if anyone is interested in this 'Tweak' (as I seem to be calling it) and also to make sure Its OK with PIM :\

<(:|x
~Vivi
SojaBird
can you post a picture of your photoshop interface?


and @vivi

well that's realy nice...though the script now has the function to only draw a lightmap if there is a picture for it
Neku
yeah, Sorry, I was just looking at the version I'm using and trying to make it fit better for me really...
SojaBird
yea thats ok smile.gif ... if you only use it for yar'self

but if ya want to show it to me, that's oke...i'll see if i include it smile.gif
Shadonn
It would be possible to make lights and shadows with gimp wouldn't it?
SojaBird
Ya, sure it can.

Though, one major problem of the script is that you need to input the file-format yourself...cause I can't fix that now.
Though ya, every program to make pictures is useable with AutoLight (yes, even paint).
With better programs though, you'll get better results (gradients are very usefull).


Greatzz, SojaBird.
Benjamin Ficus
it will take me some time to get into it... but since i only needed the spot feature, i used the demo script...
Thanks man!!!
SojaBird
Your welcome wink.gif
Let's hope it'll PimP your game up biggrin.gif


Greatzz,
SojaBird.
Tails41347
I think i can se someting wrong here... When you are use mode 3... then in a bigger map with light and shadows will follow you. huh.gif I have the light and shadow swithed with 1 and spot with 2. I did just started swith 1. But anyway so is it like the spot is on too, but it is off in the swith window. And in the bigger map with just spot on and light and shadow off... then is the spot gone. It's working better with just mode 1 and 2. Mode 1 will shadow and light show with swith 1. And mode 2 will the spot show with swith 2.

Light and Shadow's name is what it is with a map ID.
Spot is just named as Spot. (I did tested it with number but it did not work) And spot is 1088*832.

It's like mode 3 is someting wrong...
I hope you can fix it... cuz i want mode 3(Both) for my game.
I have a big mapp, and it is a city. There is i big map in a house and there will i have my spot. And the city is dark cuz it is night. thumbsup.gif


PS: My english sux, i know. yes.gif woot.gif
SojaBird
Hey Talis,

Actualy I haven't worked quite a while on AutoLight (wich is too bad), but now, since you're laying your finger on the weak spot, I've a reason to go back in it again smile.gif Thanks for that.

Mode 3 is actualy not realy the one I've did much reasearch on.
I think I'll be looking at the problems that occure to you today wink.gif
You see, AutoLight is like one of my favorite scripts, the one I adore the most of the ones I've made.
So it must be perfect!! biggrin.gif

To solve your problem for now, I though I had included a funcion to switch between the mode's (if I'm not mistaking).
So that you can use mode 2 when you want a spot (in the house of yours for example), and switch to mode 1 when you get on the streets again (if that's what you want).

Oke so that's all...Hope to see you back soon when the update wich some new features is released smile.gif


Greatzz,
SojaBird.
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.