RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
(Request) On/Off Lighting

0 Members and 1 Guest are viewing this topic.

**
Rep:
Level 82
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!  ;)

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.

**
Rep:
Level 82
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.

**
Rep:
Level 82
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?

********
Resource Artist
Rep:
Level 94
\\\\\
Project of the Month winner for June 2009
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.

 ;)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...

********
Resource Artist
Rep:
Level 94
\\\\\
Project of the Month winner for June 2009
Yeah, that should work too :P

**
Rep:
Level 82
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...

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.