Chaos Project

RPG Maker => RPG Maker Scripts => RMXP Script Database => Topic started by: Lukas on July 23, 2012, 12:00:46 am

Title: [XP] Flashlight System.
Post by: Lukas on July 23, 2012, 12:00:46 am
Flashlight System
Authors: Lukas
Version: 1.1
Type: Environment Add-on
Key Term: Environment Add-on



Introduction

:D


Features




Screenshots

Spoiler: ShowHide
(http://dl.dropbox.com/u/71716232/flashlight.png)

Spoiler: ShowHide
(https://dl.dropbox.com/u/71706537/flashligth_out.png)



Demo

https://dl.dropbox.com/u/71706537/flashlight.exe


Script

-


Instructions

Place above main.


Compatibility

RPG XP


Credits and Thanks




Author's Notes

Enjoy  :w00t:
Title: Re: [XP] Flashlight System.
Post by: ForeverZer0 on July 23, 2012, 12:57:24 am
Nice little script. :)

I think "Environment Addon" would be far more appropriate than "Environment System", though.
Title: Re: [XP] Flashlight System.
Post by: Lukas on July 23, 2012, 02:28:29 am
sorry  :)
Title: Re: [XP] Flashlight System.
Post by: Memor-X on July 25, 2012, 07:08:45 pm
nice, was thinking about setting up some dungeons in Nexis Core where you needed light, this saves me time having to try and code it myself (which i really should be doing)

couple of questions which the answers you can put in the features part

1) how is the Flashlight Triggered, is it by pressing a Key or using an item or both

2) (which should really be 1 but i'm asking these in order of as the appear in my head) do you need an item in your inventory to use it, if not, here's a suggestion, an option that will allow you to choose if you have to have an item in the inventory (eg, a Flashlight Item) and another option to choose if you want to use another item as fuel (eg, a Battery Item)

3) can you have another event to hold a flashlight....like a street lamp or something, i can't remember the game (i think it was Alone in the Dark Inferno) but there was a part where you had a light source at either end of this room and and in certain parts of the room and in the darkness there was this path which you would fall to your death if you walked off it so you had to use a light source to guide you across to each light sorce
Title: Re: [XP] Flashlight System.
Post by: pickedlastjake on December 07, 2012, 03:23:14 pm
Bringing a dead forum post back to life, but I'm implementing the darkness script in this for my game, but having a timer is a big part of the game play. I'm trying to find a way that the darkness doesn't overlap everything on the screen, but I'm having trouble trying to come up with a way. (I'm fairly new to RGSS). Is there some way I can make it so this is more compatible with other picture based scripts?
Example:
(http://i.imgur.com/N4DAi.png)
Title: Re: [XP] Flashlight System.
Post by: Heretic86 on December 07, 2012, 07:59:48 pm
I suppose it is possible if there are two images using alpha channes, to have the values of each alpha channel be added.  Over my head tho.
Title: Re: [XP] Flashlight System.
Post by: G_G on December 07, 2012, 08:09:50 pm
That's not needed. The Z Values in the scripts just need to be changed.
Title: Re: [XP] Flashlight System.
Post by: Heretic86 on December 07, 2012, 10:11:40 pm
Hmm...

I missed something in that pic the first time.  It has the word "Time" in it, which looks like that is where his trouble is coming from, if I understood the post correctly.  I am guessing the word "Time" is being displayed from a Picture Event.  If that is the case, the Picture that displays the word "Time" has to have a higher number than the Picture that holds the Light and Shadow Effect.

---

I still think it might be interesting to see a "Blend" of shadows allowing for the illusion of Dynamic Light Sources.  Oh, and just to make sure those other pics dont run around with their own shadow, just need an alpha channel with no other data.  Could be an interesting script if anyone feels like taking a crack at it...
Title: Re: [XP] Flashlight System.
Post by: KK20 on December 08, 2012, 01:25:32 am
Line 41 under "Darkness System"
@darknes = Sprite.new; @darknes.ox, @darknes.oy, @darknes.z = 624, 624, 999

Change that 999 to a smaller value. Try 199 first and experiment from there.
Title: Re: [XP] Flashlight System.
Post by: ThallionDarkshine on December 08, 2012, 07:19:38 am
@KK20 - Actually, that probably wouldn't work. The lower tiles on the map with high priorities would overlap the darkness. I think the smallest you can make the z value is 641, accounting for tiles with a priority of 5 on the bottom of the map.

@pickedlastjake - What you actually have to do is find whatever script you're using for that hud on the bottom of your screen in the picture, go into that, and change the z of the hud. If you'll post that script, then I'll find the right line to change for you.

Edit: Nevermind. The tilemap is in it's own viewport so it doesn't matter.
Title: Re: [XP] Flashlight System.
Post by: pickedlastjake on December 12, 2012, 07:02:42 pm
Quote from: KK20 on December 08, 2012, 01:25:32 am
Line 41 under "Darkness System"
@darknes = Sprite.new; @darknes.ox, @darknes.oy, @darknes.z = 624, 624, 999

Change that 999 to a smaller value. Try 199 first and experiment from there.


Worked perfectly, thanks! (And now I know how to look for (X,Y,Z) variables in RGSS. So double thanks!)