Jump to content
New account registrations are disabed. This website is now an archive. Read more here.
  • 0
Sign in to follow this  
CrimsonInferno

Light Tutorial [XP]

Question

Hello RMXPU! I have request, which I hope isn't too big of a request. m003.gif

 

To answer the (obligated lol) question of "google"; yes, I have run thousands of Google searches before I even thought about thinking about thinking to make a request thread for a tutorial. :lol:

 

I have found many tutorials on creating the actually lights, I have found the light script here and the like. The script is is good, but it doesn't allow a great deal of costumes (at least, reading the threads and script, I don't see how it does), so I would like to be able to create lights on my maps -- example sunshine, window light, fire light, crystal light etc etc -- but I can't figure it out. I always have two major problems:

 

1. (Biggest problem) Finding out the size of my maps so I can effectively make the correct image overlay (for example, one of my maps is 25x25 in editor).

 

2. Getting the image of the lights to stop following the player around T.T

 

I want to be able to do something like this:

 

mEkN6.png

 

 

If anyone could help me out, that would be really great. :D

Share this post


Link to post
Share on other sites

20 answers to this question

Recommended Posts

  • 0

Well maybe I can help a little bit:

 

1. To get the map's size in pixels, each tile is 32x32 px so it would be (width * 32) by (length * 32) in the case of 25x25 (tiles), 25 * 32 = 800. Therefore the overlay would need to be 800x800 px

 

2. Are you setting the lights as a overlay? that should work without it "moving" (or following the player like you said, as long as it is the exact size of the map anyways) although I have never tried it myself....

 

hope this helps :) if not I will look into it a little more.

Share this post


Link to post
Share on other sites
  • 0

How do you figure out width/height? I tried using GIMP to set up a grid and counted the grid to match that in the game editor. Some of my maps are really big. :sweatdrop:

 

Overlay? I don't have an overlay option :unsure:

And finding the exact size is something I can't seem to do :(

Edited by CrimsonInferno

Share this post


Link to post
Share on other sites
  • 0

You find the width and height exactly how he said lol.

 

if you set your map to 30 x 35, then you simply do (30 * 32) and (35 * 32)

 

you simply use the numbers you set when making the map size =].

 

as for the picture, just show the picture using top left corner.

 

... i think im missing to make the picture stay and not move as the player move... because i made a light system myself a long time ago...

 

OH well, i used individual light pictures and had them set to be positioned at the x,y coordinates as the events that had the lights... so you can do that, or make smaller big light pictures to place over specific areas. (basically mixing both ideas).

Share this post


Link to post
Share on other sites
  • 0

Oh, for some reason I did not see that part. m003.gif. Well, I did try that (before I posted the thread) and was using GIMP. But once I imported the image, it reduced the size of the image. :sweatdrop:

 

I'll try with Photoshop... :D

Share this post


Link to post
Share on other sites
  • 0

Okay, now I know how get the right, proper size according to my map sizes. Thank you guys so much! :D

 

I tried the X & Y command, but I'm not sure if I'm doing it right. It keeps moving with the player. :unsure:

Share this post


Link to post
Share on other sites
  • 0

No problem! I think the issue with the pictures...is that there doesn't seem to be a way to fix it to a map location...I may be wrong (I haven't done much eventing in a long time..)

 

and sorry, by overlay I meant "fog", which is essentially an overlay, except it tiles it across the map (if you use a graphic image the same size as the map it will not create any tile effect)

 

try this command: (you can set the tilesets default fog, but this would be impractical as you would then need a tileset for EACH map...)

 

 

gallery_18872_188_60226.png

 

 

 

Sorry for the clutter, I tried to show the steps :P

 

Just change map settings, select fog

 

make sure zoom = 100% and SX = 0 and SY = 0, and select your overlay you made :D (all the other settings you can play with)

 

just put that in an autostart event that deletes itself, and that should do the trick!

 

 

 

NOTE: I am no longer sure if this is a resource request topic or game support topic any more :sweatdrop:

Share this post


Link to post
Share on other sites
  • 0

Firstly, thank you again :)

 

Hmm...if I make it a Fog, I won't be able to use other fogs on the map. Like the tree fogs in a forest. I was hoping to make it so I could have some tree fog and a picture of sunbeams to make forests and whatnot :)

 

Lastly, I guess its a support topic now? :P

Share this post


Link to post
Share on other sites
  • 0

Well, since I am better at scripting than eventing and what not (I used to be a lot better...when I was still using rpg maker 2000/3...):

#===============================================================================
# ** Spriteset_Map
#===============================================================================
class Spriteset_Map
 alias :new_light_map_init :initialize
 alias :new_light_map_disp :dispose
 alias :new_light_map_updt :update
 def initialize
   new_light_map_init
   @light_map = Plane.new(@viewport1)
   @light_map.z = 2000
 end
 def update
   if @light_map != nil
     @light_map.ox = $game_map.display_x / 4
     @light_map.oy = $game_map.display_y / 4
   end
   new_light_map_updt
 end
 def dispose
   @light_map.dispose
   new_light_map_disp
 end
 def create_light_map(filename, opacity)
   @light_map.opacity = opacity
   @light_map.bitmap = RPG::Cache.picture(filename)
 end
end
#===============================================================================
# ** Scene_Map
#===============================================================================
class Scene_Map
 def draw_light(filename, opacity=64)
   @spriteset.create_light_map(filename, opacity)
 end
end

 

then just create an event that calls a script and put in:

$scene.draw_light('filename', opacity)

 

the file name would be the name of the File in the pictures folder. Make sure it stays in the quotes.

Opacity, is of course the opacity of the lights...you do not HAVE to specify the opacity, if you just put

$scene.draw_light('filename')

the opacity will default to 64.

 

NOTE: you do NOT have to include the file extension in the filename. Just the name of the file is good.

 

Now you can have lights and fog :D

 

EDIT: Also, I will move this to game support since it's leaning that way more.

Share this post


Link to post
Share on other sites
  • 0

*Sorry this is late, my internet keeps dying on me :(*

 

Oh wow, thank you kellessdee! :33

 

I put it over main and made a event script command "$scene.draw_light('Light Render', 200)" but I received this error:

 

23k682.jpg

 

Here is what my event looks like :sweatdrop:

 

9v8742.jpg

 

Share this post


Link to post
Share on other sites
  • 0

XD That was my fault, I never actually tested it with a parallel process (only trigger, just to make sure it actually worked the way you wanted it)

 

BUT! It can be fixed. The issue is that When starting a new game RMXP calls parallel processes before even entering the map... So I have a little workaround for you:

 

first head over to the Scene_Title script, and find line 140:

$game_map.update

 

simply delete that line, we'll let the map load first. Well, actually if you want you can cut that line (we will need to move it to another place)

 

next head over to the Scene_Map script and find line 13:

@spriteset = Spriteset_Map.new

 

right underneath it, make a new line and paste (or just type it in if you want)

$game_map.update

 

And that will stop the error, and you shouldn't notice any difference (parallel process should pretty much be activated at the same point in time...at most maybe a frame or so later...if that even, and really it will only do that when going from the title to a map)

 

OH YEA it just occurred to me you should head over to Scene_Load script and find line 50:

$game_map.update

 

that will cause issues too. Just delete it; and everything should be fine.

 

Lemme know if you come across any other issues! (I may have missed something...I am tired, yet me and sleep just don't seem to get along)

 

EDIT: Do you plan on using an opacity of 200 for every light display? or were you just testing to see how it looked? Either way if you plan on using the same opacity for every light set, or plan on using a value other than 64 mainly, I can tell you how to change the default value that way you don't have to include the opacity EVERY time. just lemme know

Share this post


Link to post
Share on other sites
  • 0

eh, have you tried to anchor the "show picture" command using an event in the top left corner of the map, and having it base its x,y off the top corner of the event?

Share this post


Link to post
Share on other sites
  • 0

eh, have you tried to anchor the "show picture" command using an event in the top left corner of the map, and having it base its x,y off the top corner of the event?

 

Does that work??? I was wondering how to do that in RMXP, I am pretty sure RPG Maker 2003 had a check box for a static location on the map (if I remember correctly)

Share this post


Link to post
Share on other sites
  • 0

well like i said, in my old lights system, i used a show picture, that's coords were that of the event's x and y

 

so if you make an event at the top left of the event, and then show a picture where its based of its top left pixel, and is located on the event's x and y, then it should work. just theory of thought right now though lol.

Share this post


Link to post
Share on other sites
  • 0

That's definitely a great work around! I haven't really done much eventing in a LONG time, I think mostly in terms of scripts now (you can almost do everything you can do with scripts with events as well, I just find scripting more efficient and easier)

Share this post


Link to post
Share on other sites
  • 0

I agree x.x but i've yet get over my laziness to learn scripting xD

Share this post


Link to post
Share on other sites
  • 0

It works! Its so awesome! Ohmygoshitsperfect! Thank you so much, kellessdee! :33

Exactly lined up too! :D

 

Three more questions:

And this will work with any size of maps, right? :biggrin_002:

Also, is there a way to make a flickering effect? I was thinking erasing the event, past the script again, erase the event etc etc with different light pictures to create a flickering effect, but I'm not sure if the script allows it.

 

It seems you can only make one script call on one map, otherwise it gives you a Syntax error. :sweatdrop:

Edited by CrimsonInferno

Share this post


Link to post
Share on other sites
  • 0

1. Yes it will work with maps on any size.

2. Well I could fix it to either use "frames" or even so it's opacity is constantly increasing/decreasing to make a glow effect(sorta)

3. Did you want to be able to have multiple overlays or did you need this strictly for the overlay?

Share this post


Link to post
Share on other sites
  • 0

1.

Ah, okay! By the way, it makes lighting my maps extremely easy. So thank you again! :biggrin_002:

 

2.

That would be awesome. But only if you have the time and want to. m003.gif

 

3. Yes; I wanted to be able to have overlays on separate maps. If I put the script on my cave, for example, I can't use the script on a mountain map, for example, it seems. :sweatdrop:

Share this post


Link to post
Share on other sites
  • 0

Animation and opacity iteration would be really easy, it wouldn't take any length of time.

 

As for that issue that should not be happening. I must have made an error somewhere; I will look into this.

Share this post


Link to post
Share on other sites
  • 0

Oh thank you very much, kellessdee. Please take your time. I don't want to rush you... :(

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...