Flashlight Item

● ARCHIVED · READ-ONLY
Started by Pauzh_ 12 posts View original ↗
  1. 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.
  2. Hello,
    This is how I would set up a flashlight using Terrax Lighting that can be used from the menu.

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

    STEP 2
    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.

    STEP 3
    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.
  3. sapphireLight said:
    Hello,
    This is how I would set up a flashlight using Terrax Lighting that can be used from the menu.

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

    STEP 2
    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.

    STEP 3
    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 : )
  4. You're welcome! Good luck with your project! :kaojoy:
  5. sapphireLight said:
    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
  6. sapphireLight said:
    You're welcome! Good luck with your project! :kaojoy:

    Is their a way to make it so when the flashlight is off, that random encounters occur less?
  7. sapphireLight said:
    Hello,
    This is how I would set up a flashlight using Terrax Lighting that can be used from the menu.

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

    STEP 2
    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.

    STEP 3
    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
  8. 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. :)
  9. sapphireLight said:
    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...
  10. 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.
  11. Well, insomnia is keeping me awake tonight so I might as well just try that, thank you again :D
  12. @djooks I have deleted your post. Please do not spam threads with off-topic on-liners.