MV - Community Lighting MV & MZ

● ARCHIVED · READ-ONLY
Started by ImaginaryVillain 1279 posts Page 53 of 64 View original ↗
  1. @finalrpg777 use flashLight ON/OFF in 1 condition brance
    and use a switch to check.

    (this is easier with a button common event (YEP or Eliaquim)
    or a key mapper plugger.

    If: script: Flashlight Switch = OFF
    flash light is ON
    Plugin command Flashlight ON
    else
    Flashlight is OFF
    plugin command flashlight OFF
    end

    alternative, you can toggle it ON off by item.
    but thats up to you.
  2. finalrpg777 said:
    How do i make a flashlight turn on and off with the F key?

    On whatever map you want this to work on, make an event set to parallel and do something like this:

    Code:
    ◆Script:Input.keyMapper[65] = 'fireball'

    Use this page for the number you use: https://asawicki.info/nosense/doc/devices/keyboard/key_codes.html

    In the case of "F" it would be 70. Put 'flashlight' instead of 'fireball' (this is an example from my game, so I have the letter "a" shooting a fireball).

    Then, make another event set to parallel and make a conditional branch, using this for the script:

    Code:
    Input.isTriggered("fireball")

    of course, change "fireball" to "flashlight." and then you can put whatever you want to happen, in your case, choose "common event" and choose the one you made. I would make a switch and then use that switch to tell if the flashlight is on or off. From there, I'd make a conditional branch in the common event to say if the switch is on, turn the plugin command to off and it's off, turn it to off.

    [edit: I was slow. :(]
  3. @ShadowDragon @mobiusclimber
    Thanks for the replies. I used ShadowDragon's method since i already have YEP_ButtonCommonEvents. I'm able to turn the flashlight on and off now!
    Which brings me to another problem i had. I added a chest to the map which gives the flashlight but my character can already use the flashlight by pressing F without the chest giving it to him.
  4. than you add a check to the flash light option:

    if: player has flashlight
    and the code above
    end

    this prevent the player using the flashlight if they dont have it :)
  5. And with my method, you'd set a condition on the two parallel events for either a switch to be on (and turn on the switch at the end of the treasure chest event), or simply set the condition to whether the player has the flashlight item. (In case anyone out there wants to use my method instead.)
  6. ShadowDragon said:
    than you add a check to the flash light option:

    if: player has flashlight
    and the code above
    end

    this prevent the player using the flashlight if they dont have it :)
    Done!
  7. @finalrpg777 you can add flashlight ON/OFF under the switches you set,
    else you set everything double which is mostly executed AFTER the first
    conditional check (this can delay things up).

    combine it imrpove performance like I did as example above without
    the flashlight check.
  8. ShadowDragon said:
    @finalrpg777 you can add flashlight ON/OFF under the switches you set,
    else you set everything double which is mostly executed AFTER the first
    conditional check (this can delay things up).

    combine it imrpove performance like I did as example above without
    the flashlight check.
    You mean add it to the chest instead? Could you show me your coding?
  9. to to flashlight switch like:

    if player has flashlight (this checks the inventory)
    If: script: Flashlight Switch = OFF
    flash light is ON
    Plugin command Flashlight ON
    else
    Flashlight is OFF
    plugin command flashlight OFF
    end
    end

    this way, its checks everything in 1 time within the conditional branch.

    the way you did now =
    check 1: check if player has flashlight, turn on switch
    check 2: check if switch is on
    check 3: check if switch is off

    which are 3 conditionals, where mine just check the conditional inside
    the 1 to see if its on else its off.
  10. ShadowDragon said:
    to to flashlight switch like:

    if player has flashlight (this checks the inventory)
    If: script: Flashlight Switch = OFF
    flash light is ON
    Plugin command Flashlight ON
    else
    Flashlight is OFF
    plugin command flashlight OFF
    end
    end

    this way, its checks everything in 1 time within the conditional branch.

    the way you did now =
    check 1: check if player has flashlight, turn on switch
    check 2: check if switch is on
    check 3: check if switch is off

    which are 3 conditionals, where mine just check the conditional inside
    the 1 to see if its on else its off.
    Your coding is missing "If Flashlight is ON" so i was confused at first but i got it now.
  11. I had it included :) so you might missreaded it, but it looks good.
    it should work, while you check if its ON, I did it OFF, but it should
    do the same way.

    if it works, than your mostly good to go :)
  12. ShadowDragon said:
    I had it included :) so you might missreaded it, but it looks good.
    it should work, while you check if its ON, I did it OFF, but it should
    do the same way.

    if it works, than your mostly good to go :)
    Sorry but the way you write it is confusing for a beginner.
    Like when you say "If: script: Flashlight Switch = OFF" for me "If" is a conditional branch, but you also write "script", so is it a conditional branch or a script?
    Is "flash light is ON" a plugin command?
    Theres no control switches used in your codes?
  13. plugin command = from the plugin you use,

    conditional branch => items => flashlight (check item in inventory)
    conditional branch => switch light => off
    switch light = ON
    plugin command flashlight on (from this plugin)
    else
    switch light = OFF
    plugin command flashlight off (from this plugin
    end
    end

    there reason I start with off, is that the status of the switch = off from the start,
    you can use ON but this has basicly the same result, depending the setup.

    while switches starts being OFF, its a nice idea to start with it.
    it might be a bit confusing how I wrote it, so my appoligies for that.
  14. I don't know if it had been asked before, but what are the proper Credits for this Plug-In?

    Or is it good enough to redirect directly to this page?
  15. emelian65 said:
    I don't know if it had been asked before, but what are the proper Credits for this Plug-In?

    Or is it good enough to redirect directly to this page?
    Everyone in the contributors list: Terrax, iVillain, Aesica, Eliaquim, Alexandre, Nekohime1989, Snaphat
  16. ShadowDragon said:
    plugin command = from the plugin you use,

    conditional branch => items => flashlight (check item in inventory)
    conditional branch => switch light => off
    switch light = ON
    plugin command flashlight on (from this plugin)
    else
    switch light = OFF
    plugin command flashlight off (from this plugin
    end
    end

    there reason I start with off, is that the status of the switch = off from the start,
    you can use ON but this has basicly the same result, depending the setup.

    while switches starts being OFF, its a nice idea to start with it.
    it might be a bit confusing how I wrote it, so my appoligies for that.
    Thanks!!! Your code is understandable now and it works without issues :hhappy:
  17. Thanks for this awesome plugin! However, trying to use this with the newly released ARPG plugin doesn't work (almost none of my other plugins work with it, including the lifesaver zoom-in plugin for 32px tilesets, ugh).
    Would there be any way to make it compatible or is it just plain impossible? The lighting makes a huge difference in my game and I'd hate having to edit the maps manually with parallax, lol. Seems like the problem is caused by this plugin and the ARPG both using the notetags or something.

    Any help is greatly appreciated!

    Edit: Okay, I got it to work somehow. If any problems arise I'll update here. (Off-topic but for anyone interested, the zoom-in still doesn't work, since the attack event needs to grab info from the map and it conflicts. The only viable way is to do a manual tileset change with a plugin)
  18. Really cool plugin, just a quick question...
    How do I make a certain map full black, except for the flashlight or aura around you?
    I know how to make the time change so it slowly gets dark over time, but I'm trying to make a cave that's pitch black, except for the flashlight.
    Like pokemon caves.

    Any help would be awesome.
    TIA

    --- edit
    Nvm I managed to do what I wanted using this plugin and the Fog Of War plugin by Pheonix KageDesu
  19. I'm having an issue now with some events causing crashes while trying to change time...
    Code:
    TypeError
    Cannot read property 'r' of null
    issue?
  20. @boydie96
    it might not be an issue, its more, you have a typo
    some somewhere or missing something to be readed
    correctly from the event or parallel you use.

    double check the event where you use it and helpfile
    to see what went wrong.

    keep in mind that some are case sensitive or require a a comma or CL in front
    if you didn't change parameters.