Jump to content

Welcome, Guest. Please login to gain free access to all of our features.


       GDU GAMES SECTION

    The GDU games section is a system that allows you to create your own unique page(s) for your Games. With tons of customization options, the GDU Games section allows you to easily create game-specific content such as Screenshots, Downloads, Team Members, Credits, Character Profiles and more. Try it out right now by entering your Game's title below:

Go!
More Info
Latest News
Latest Collection
Quote (Add your Own!)
"Pick spot. Shut up. Wait."
Kimahri (Final Fantasy X)
Photo

Light Tutorial [XP]

- - - - -

  • Please log in to reply
20 replies to this topic

#1
CrimsonInferno

CrimsonInferno

    �. ∙ : ∙ . . ∙ : ∙ . �

  • Member
  • 2,192 posts
  • Prefered Engine: RPG Maker XP
  • Engine Level: Good
  • Class Title: Spriter
  • Project(s): Black Moon (Prophecy) [XP]
Hello RMXPU! I have request, which I hope isn't too big of a request. Posted Image

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:
Spoiler


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

#2
kellessdee

kellessdee

    mrrow ~!

  • Member
  • 960 posts
  • Prefered Engine: RPG Maker XP
  • Engine Level: N/A
  • Class Title: Programmer / Scripter
  • Project(s): I
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.
  • 1

"Some people never go crazy, What truly horrible lives they must live." -- Charles Bukowski
"Dude, your castle is too big. Are you compensating for something?" -- Bob423


#3
CrimsonInferno

CrimsonInferno

    �. ∙ : ∙ . . ∙ : ∙ . �

  • Member
  • 2,192 posts
  • Prefered Engine: RPG Maker XP
  • Engine Level: Good
  • Class Title: Spriter
  • Project(s): Black Moon (Prophecy) [XP]
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, 20 May 2011 - 03:20 AM.

  • 0

#4
zane203

zane203

    Extreme Member

  • Member
  • 276 posts
  • Prefered Engine: RPG Maker XP
  • Engine Level: Expert
  • Class Title: Eventer
  • Project(s): Kingdom of Souls: The Binding of Souls
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).
  • 1
Wii Code: 2273-1733-2939-1335
Posted Image

Zane Blalock's Blog! Zane's Dark Mind

Posted Image

Spoiler

#5
CrimsonInferno

CrimsonInferno

    �. ∙ : ∙ . . ∙ : ∙ . �

  • Member
  • 2,192 posts
  • Prefered Engine: RPG Maker XP
  • Engine Level: Good
  • Class Title: Spriter
  • Project(s): Black Moon (Prophecy) [XP]
Oh, for some reason I did not see that part. Posted Image. 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
  • 0

#6
CrimsonInferno

CrimsonInferno

    �. ∙ : ∙ . . ∙ : ∙ . �

  • Member
  • 2,192 posts
  • Prefered Engine: RPG Maker XP
  • Engine Level: Good
  • Class Title: Spriter
  • Project(s): Black Moon (Prophecy) [XP]
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:
  • 0

#7
kellessdee

kellessdee

    mrrow ~!

  • Member
  • 960 posts
  • Prefered Engine: RPG Maker XP
  • Engine Level: N/A
  • Class Title: Programmer / Scripter
  • Project(s): I
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...)
Spoiler


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:
  • 0

"Some people never go crazy, What truly horrible lives they must live." -- Charles Bukowski
"Dude, your castle is too big. Are you compensating for something?" -- Bob423


#8
CrimsonInferno

CrimsonInferno

    �. ∙ : ∙ . . ∙ : ∙ . �

  • Member
  • 2,192 posts
  • Prefered Engine: RPG Maker XP
  • Engine Level: Good
  • Class Title: Spriter
  • Project(s): Black Moon (Prophecy) [XP]
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
  • 0

#9
kellessdee

kellessdee

    mrrow ~!

  • Member
  • 960 posts
  • Prefered Engine: RPG Maker XP
  • Engine Level: N/A
  • Class Title: Programmer / Scripter
  • Project(s): I
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.
  • 0

"Some people never go crazy, What truly horrible lives they must live." -- Charles Bukowski
"Dude, your castle is too big. Are you compensating for something?" -- Bob423


#10
CrimsonInferno

CrimsonInferno

    �. ∙ : ∙ . . ∙ : ∙ . �

  • Member
  • 2,192 posts
  • Prefered Engine: RPG Maker XP
  • Engine Level: Good
  • Class Title: Spriter
  • Project(s): Black Moon (Prophecy) [XP]
*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:

Posted Image

Here is what my event looks like :sweatdrop:
Spoiler

  • 0

#11
kellessdee

kellessdee

    mrrow ~!

  • Member
  • 960 posts
  • Prefered Engine: RPG Maker XP
  • Engine Level: N/A
  • Class Title: Programmer / Scripter
  • Project(s): I
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
  • 1

"Some people never go crazy, What truly horrible lives they must live." -- Charles Bukowski
"Dude, your castle is too big. Are you compensating for something?" -- Bob423


#12
zane203

zane203

    Extreme Member

  • Member
  • 276 posts
  • Prefered Engine: RPG Maker XP
  • Engine Level: Expert
  • Class Title: Eventer
  • Project(s): Kingdom of Souls: The Binding of Souls
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?
  • 0
Wii Code: 2273-1733-2939-1335
Posted Image

Zane Blalock's Blog! Zane's Dark Mind

Posted Image

Spoiler

#13
kellessdee

kellessdee

    mrrow ~!

  • Member
  • 960 posts
  • Prefered Engine: RPG Maker XP
  • Engine Level: N/A
  • Class Title: Programmer / Scripter
  • Project(s): I

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)
  • 0

"Some people never go crazy, What truly horrible lives they must live." -- Charles Bukowski
"Dude, your castle is too big. Are you compensating for something?" -- Bob423


#14
zane203

zane203

    Extreme Member

  • Member
  • 276 posts
  • Prefered Engine: RPG Maker XP
  • Engine Level: Expert
  • Class Title: Eventer
  • Project(s): Kingdom of Souls: The Binding of Souls
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.
  • 0
Wii Code: 2273-1733-2939-1335
Posted Image

Zane Blalock's Blog! Zane's Dark Mind

Posted Image

Spoiler

#15
kellessdee

kellessdee

    mrrow ~!

  • Member
  • 960 posts
  • Prefered Engine: RPG Maker XP
  • Engine Level: N/A
  • Class Title: Programmer / Scripter
  • Project(s): I
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)
  • 0

"Some people never go crazy, What truly horrible lives they must live." -- Charles Bukowski
"Dude, your castle is too big. Are you compensating for something?" -- Bob423


#16
zane203

zane203

    Extreme Member

  • Member
  • 276 posts
  • Prefered Engine: RPG Maker XP
  • Engine Level: Expert
  • Class Title: Eventer
  • Project(s): Kingdom of Souls: The Binding of Souls
I agree x.x but i've yet get over my laziness to learn scripting xD
  • 0
Wii Code: 2273-1733-2939-1335
Posted Image

Zane Blalock's Blog! Zane's Dark Mind

Posted Image

Spoiler

#17
CrimsonInferno

CrimsonInferno

    �. ∙ : ∙ . . ∙ : ∙ . �

  • Member
  • 2,192 posts
  • Prefered Engine: RPG Maker XP
  • Engine Level: Good
  • Class Title: Spriter
  • Project(s): Black Moon (Prophecy) [XP]
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, 21 May 2011 - 05:02 PM.

  • 0

#18
kellessdee

kellessdee

    mrrow ~!

  • Member
  • 960 posts
  • Prefered Engine: RPG Maker XP
  • Engine Level: N/A
  • Class Title: Programmer / Scripter
  • Project(s): I
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?
  • 0

"Some people never go crazy, What truly horrible lives they must live." -- Charles Bukowski
"Dude, your castle is too big. Are you compensating for something?" -- Bob423


#19
CrimsonInferno

CrimsonInferno

    �. ∙ : ∙ . . ∙ : ∙ . �

  • Member
  • 2,192 posts
  • Prefered Engine: RPG Maker XP
  • Engine Level: Good
  • Class Title: Spriter
  • Project(s): Black Moon (Prophecy) [XP]
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. Posted Image

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:
  • 0

#20
kellessdee

kellessdee

    mrrow ~!

  • Member
  • 960 posts
  • Prefered Engine: RPG Maker XP
  • Engine Level: N/A
  • Class Title: Programmer / Scripter
  • Project(s): I
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.
  • 0

"Some people never go crazy, What truly horrible lives they must live." -- Charles Bukowski
"Dude, your castle is too big. Are you compensating for something?" -- Bob423


#21
CrimsonInferno

CrimsonInferno

    �. ∙ : ∙ . . ∙ : ∙ . �

  • Member
  • 2,192 posts
  • Prefered Engine: RPG Maker XP
  • Engine Level: Good
  • Class Title: Spriter
  • Project(s): Black Moon (Prophecy) [XP]
Oh thank you very much, kellessdee. Please take your time. I don't want to rush you... :(
  • 0





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Stay in touch! We'll keep you updated on all the cool stuff happening at RMU and the world of game development