[XP] Flashlight System.

Started by Lukas, July 23, 2012, 12:00:46 am

Previous topic - Next topic

Lukas

July 23, 2012, 12:00:46 am Last Edit: July 23, 2012, 02:31:29 am by Blizzard
Flashlight System
Authors: Lukas
Version: 1.1
Type: Environment Add-on
Key Term: Environment Add-on



Introduction

:D


Features


  • Flashlight




Screenshots

Spoiler: ShowHide

Spoiler: ShowHide



Demo

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


Script

-


Instructions

Place above main.


Compatibility

RPG XP


Credits and Thanks


  • Lukas




Author's Notes

Enjoy  :w00t:
Spoiler: ShowHide

This image been put in a spoiler because it's 2 MB which is above the size of images allowed in a spoiler.
Thank you for your understanding.
~Blizz



~Sorry :)

ForeverZer0

Nice little script. :)

I think "Environment Addon" would be far more appropriate than "Environment System", though.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Lukas

Spoiler: ShowHide

This image been put in a spoiler because it's 2 MB which is above the size of images allowed in a spoiler.
Thank you for your understanding.
~Blizz



~Sorry :)

Memor-X

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

pickedlastjake

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:

Heretic86

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.
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)

G_G

That's not needed. The Z Values in the scripts just need to be changed.

Heretic86

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...
Current Scripts:
Heretic's Moving Platforms

Current Demos:
Collection of Art and 100% Compatible Scripts

(Script Demos are all still available in the Collection link above.  I lost some individual demos due to a server crash.)

KK20

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.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

ThallionDarkshine

December 08, 2012, 07:19:38 am #9 Last Edit: December 08, 2012, 07:21:36 am by ThallionDarkshine
@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.

pickedlastjake

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!)