Flashlight Item

Status
Not open for further replies.

Pauzh_

Silent Hill Fan
Veteran
Joined
Apr 27, 2018
Messages
48
Reaction score
0
First Language
English
Primarily Uses
RMMV
I'm using the Terrax Lighting plugin and wanted to make it so the player only has a light around them if they acquire the
flashlight item. I'd like to make it so its toggled by using the flashlight from the inventory if possible but if not thats fine.
 

sapphireLight

Dragon Rider
Veteran
Joined
Oct 7, 2017
Messages
31
Reaction score
92
First Language
English
Primarily Uses
RMMV
Hello,
This is how I would set up a flashlight using Terrax Lighting that can be used from the menu.

Make a flashlight item that runs a common event to control the light toggle.
Flashlight1.jpg

Make a common event to control the flashlight
Flashlight2.jpg

The first Conditional Branch toggles a switch. The second turns the light on and off depending on if the Flashlight switch is active.

Give the player the flashlight item, and they can now use it to illuminate their way!
Flashlight4.jpg

Flashlight3.jpg

NOTE: I used Tint set #333333 plugin command at the start of the map to give the room a little ambient light.

I hope this helps! If you want to let the player toggle the light via a key press instead of having to go through the menu, I can explain that, too.
 

Pauzh_

Silent Hill Fan
Veteran
Joined
Apr 27, 2018
Messages
48
Reaction score
0
First Language
English
Primarily Uses
RMMV
Hello,
This is how I would set up a flashlight using Terrax Lighting that can be used from the menu.

Make a flashlight item that runs a common event to control the light toggle.
View attachment 95371

Make a common event to control the flashlight
View attachment 95372

The first Conditional Branch toggles a switch. The second turns the light on and off depending on if the Flashlight switch is active.

Give the player the flashlight item, and they can now use it to illuminate their way!
View attachment 95373

View attachment 95375

NOTE: I used Tint set #333333 plugin command at the start of the map to give the room a little ambient light.

I hope this helps! If you want to let the player toggle the light via a key press instead of having to go through the menu, I can explain that, too.
Thank you so much, I really appreciate your help! I'm not going to be making a hotkey but thanks for your help : )
 

sapphireLight

Dragon Rider
Veteran
Joined
Oct 7, 2017
Messages
31
Reaction score
92
First Language
English
Primarily Uses
RMMV
You're welcome! Good luck with your project! :kaojoy:
 

Pauzh_

Silent Hill Fan
Veteran
Joined
Apr 27, 2018
Messages
48
Reaction score
0
First Language
English
Primarily Uses
RMMV
You're welcome! Good luck with your project! :kaojoy:
I'm planning on this passion project being a big success. Not sure if it will actually happen but if you want credit for your contribution then i'm more then happy to put your name in the credits in game and a .txt
 

Pauzh_

Silent Hill Fan
Veteran
Joined
Apr 27, 2018
Messages
48
Reaction score
0
First Language
English
Primarily Uses
RMMV
Joined
Dec 27, 2018
Messages
4
Reaction score
0
First Language
English
Primarily Uses
RMMV
Hello,
This is how I would set up a flashlight using Terrax Lighting that can be used from the menu.

Make a flashlight item that runs a common event to control the light toggle.
View attachment 95371

Make a common event to control the flashlight
View attachment 95372

The first Conditional Branch toggles a switch. The second turns the light on and off depending on if the Flashlight switch is active.

Give the player the flashlight item, and they can now use it to illuminate their way!
View attachment 95373

View attachment 95375

NOTE: I used Tint set #333333 plugin command at the start of the map to give the room a little ambient light.

I hope this helps! If you want to let the player toggle the light via a key press instead of having to go through the menu, I can explain that, too.
So, this was extremely useful, thank you very much! I just got started with RPGM MV and this saved my life. Though, I would like to know how to toggle the light by pressing a key :3
 

sapphireLight

Dragon Rider
Veteran
Joined
Oct 7, 2017
Messages
31
Reaction score
92
First Language
English
Primarily Uses
RMMV
Hi, I'm glad it helped! Here's how I make it work with a key press.

On the maps that you want to be able to use a flashlight, create an event with a Parallel trigger.

FlashlightEvent.png

Check the Item condition on the left to only run this event when the party has the flashlight item in the inventory.

In the contents of the event, make a conditional branch that uses the Script option. For this example, I'm using the Page Up key to toggle the light, so in the script box I put the code

Input.isTriggered("pageup")

(You can change pageup to a different key if you want)

Then have the conditional branch call the Use Flashlight common event from the above post. And with that you should have a working flashlight toggle. :)
 
Joined
Dec 27, 2018
Messages
4
Reaction score
0
First Language
English
Primarily Uses
RMMV
Hi, I'm glad it helped! Here's how I make it work with a key press.

On the maps that you want to be able to use a flashlight, create an event with a Parallel trigger.

View attachment 105605

Check the Item condition on the left to only run this event when the party has the flashlight item in the inventory.

In the contents of the event, make a conditional branch that uses the Script option. For this example, I'm using the Page Up key to toggle the light, so in the script box I put the code

Input.isTriggered("pageup")

(You can change pageup to a different key if you want)

Then have the conditional branch call the Use Flashlight common event from the above post. And with that you should have a working flashlight toggle. :)
Thank you for your quick reply! I tried doing that, unfortunately it doesn't work...
 

sapphireLight

Dragon Rider
Veteran
Joined
Oct 7, 2017
Messages
31
Reaction score
92
First Language
English
Primarily Uses
RMMV
Hmm, I'm not sure why it didn't work. Here's another way that doesn't need the parallel event.

You will need to add 2 plugins from http://yanfly.moe to your project for this method.

YEP_CoreEngine
YEP_ButtonCommonEvents

In the plugin manager for the Button Common Events, set whichever key you want to be the flashlight toggle to the common event "Use Flashlight"

And adjust that common event with a conditional to make sure the player actually has the flashlight item.

Flashlight2.png

I hope this works out for you.
 
Joined
Dec 27, 2018
Messages
4
Reaction score
0
First Language
English
Primarily Uses
RMMV
Well, insomnia is keeping me awake tonight so I might as well just try that, thank you again :D
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
@djooks I have deleted your post. Please do not spam threads with off-topic on-liners.
 
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,868
Messages
1,017,066
Members
137,576
Latest member
SadaSoda
Top