The RPG Maker Resource Kit

Other Game Creation => Program Troubleshooting => Topic started by: z3n17h on December 13, 2009, 08:49:00 AM

Title: (Request) On/Off Lighting
Post by: z3n17h on December 13, 2009, 08:49:00 AM
Hello RMRK Community!

Okay, so it's 3:40am I've been playing around with this for a couple of hours, and finally decided to ask someone for help...

I'm using the shadow script, and what I'm trying to do for the "lighting" is two things. When the player decides to turn the light/lamp/whatever "on" then the screen goes back to the normal colour tinting (it is by default slightly darker to indicate a dark room) AND (using the shadow script) a light source appears from where ever the lights are. I haven't had any luck, since in order to activate the shadow script, you have to have "s" in the comments of the event. If I put anything else in the event with it, the shadow doesn't want to work.

Hopefully I've explained that clear enough...  ???

Anyway, I'm very tired and going to bed now. Any help on this would be greatly appreciated. Thanks RMRK Community!  ;)
Title: Re: (Request) On/Off Lighting
Post by: valdred on December 13, 2009, 09:11:01 AM
do you want the shadow to be there when the lights are on?
then you should do the following:


1. make a switch and call it "light"

2. make an event which is the lamp somewhere and put whatever you want in there (but not the "s" comment)

3. now add to the lamp-event that whenever the lights are turned on, the switch "light" (that you made earlier) is on.
and when the lights are off, so is the switch.

4. finally, make a new event somewhere, and put a comment in it saying "s", put conditions to - SWITCH "light" is ON.

if you wanted it to be there all the time...
just make a new event somewhere in addition to the lamp and put the comment in it.
Title: Re: (Request) On/Off Lighting
Post by: z3n17h on December 13, 2009, 05:02:45 PM
Thank you for the reply valdred.

Yes, I only wanted the shadow there when the lights are on. But it's still not working. I think the problem is that the shadow script I'm using just won't work if I change anything in the event other than the COMMENT to "s"...

I actually did get this to work, just by putting the comment "s" event in the corner of the map until the light is switched "on", then setting the event location of comment "s" to where the light source is... but that's just a lot of wasted space on a map, to have extra room to put the shadow event (so that you can't see your shadow just by going to the edge of the map).

Any simpler way of doing this without wasting the space?

Thank you again, valdred.
Title: Re: (Request) On/Off Lighting
Post by: z3n17h on December 13, 2009, 05:43:10 PM
Okay, playing around with it further, your method DOES work valdred... though it will only work if you open the menu or shop screen, etc. after you've switched the light on.

SO, right now you switch the light on, still no shadow, but then go open and close the menu and magically a shadow appears.

Any thoughts on how to fix this?
Title: Re: (Request) On/Off Lighting
Post by: Grafikal on December 13, 2009, 06:48:09 PM
If I remember correctly, the Map hasn't refreshed. It refreshes every time you pull up a menu or new scene so if you're using a script or something you might have to make it refresh scene map when the switch is turned on.
Title: Re: (Request) On/Off Lighting
Post by: valdred on December 13, 2009, 07:04:44 PM
 ;)or to say it the easy way.

right bellow (not above) the SWITCH - "light" - on line, put a command with the following.

Script... (you can find it one the third page of the commands) then insert: $scene = Scene_Map.new
this will refresh the map...
Title: Re: (Request) On/Off Lighting
Post by: Grafikal on December 13, 2009, 07:38:14 PM
Yeah, that should work too :P
Title: Re: (Request) On/Off Lighting
Post by: z3n17h on December 13, 2009, 08:15:29 PM
Hmm...

Script 'Caterpillar' line 102: NoMethodError occurred.

undefined method 'setup_actor_character_sprites' for nil:NilClass


(Yes I'm using the caterpillar script)
I thought for sure that as going to work too...
Title: Re: (Request) On/Off Lighting
Post by: valdred on December 13, 2009, 08:33:37 PM
that's quite a different problem, the caterpilar script might not be compitable... send me the caterpilar script as a pm and i will see what i can do.