• Hi, Guest!
    Some images might be missing as we move away from using embedded images, sorry for the mess!
    From now on, you'll be required to use a third party to host images. You can learn how to add images here, and if your thread is missing images you can request them here.
    Do not use Discord to host any images you post, these links expire quickly!
Caruban's Dynamic Darkness

v21.1 Caruban's Dynamic Darkness 1.2.0

This resource pertains to version 21.1 of Pokémon Essentials.
Pokémon Essentials Version
v21.1 ✅
Caruban's Dynamic Darkness
By Caruban
DynamicDarkness.gif

I made this plugin after seeing NuriYuri's DynamicLight (PSDK).
With this plugin, you can make dark maps more lively with a light source that you can control freely.
One example of this kind of darkness is Ecruteak's Gym in HGSS, Dewford's Gym in RSE, and Hearthome's Gym in Platinum.​

How to install the script
  • Download and Extract the file
  • Move it to your plugin folder inside the main game directory.
  • Compile your game (press CTRL while booting your game in debug mode)
Settings
In the plugin Settings section, you may edit several variables.
Below is a list of the settings.
  • INITIAL_DARKNESS_CIRCLE
    The initial radius of the darkness circle on dark maps
  • FLASH_CIRCLE_RADIUS
    Radius of darkness circle while using Flash
  • VARIABLE_RADIUS_DARK_MAP
    Variable ID of initial radius based on Map ID. Any radius changes on these map IDs will be reset after the player gets out of the dark map and saved to this variable.
  • INITIAL_DARKNESS_OPACITY
    Initial opacity of darkness on dark maps
  • OPACITY_DARK_MAP_BY_ID
    Value of initial opacity based on Map ID. This will give a different opacity for every map IDs listed here.
  • FLASH_PROHIBITED_MAPS
    List of maps that prohibit the player from using flash
  • FLASHLIGHT_ONLY_MAPS
    List of maps where the player will automatically use a flashlight and also prohibit player to use Flash.
  • INITIAL_FLASHLIGHT_DIST
    Initial value of distance for a flashlight
  • FLASHLIGHT_MAX_DIST
    The initial value of the maximum distance for a flashlight
  • FLASHLIGHT_X_OFFSET and FLASHLIGHT_Y_OFFSET
    The value of a flashlight's light sources X and Y offset from the centre of the character sprites
  • CUSTOM_IMAGE_DARKNESS
    Custom darkness images based on Map ID
    Images are located in "Graphics/Fogs/"
    DynamicDarkness-CustomDarkness.gif
    Custom darkness image is located in "Graphics/Fogs/". The size of the image must have the same size as the map.

Script Commands
There are several script commands that you can use to control the darkness.
Below is a list of script commands.
  • pbGetDarknessOpacity
    This script command is used to get the darkness opacity on the current map.
  • pbGetDarknessRadius
    This script command is used to get the darkness radius on the current map.
  • pbSetDarknessRadius(value)
    This script command is used to set the darkness radius on the current map.
  • pbMoveDarknessRadius(value)
    This script command is used to change the darkness radius gradually on the current map.
  • pbMoveDarknessRadiusMax
    This script command is used to change the darkness radius gradually to the max on the current map. It will fully brighten the map.
  • pbMoveDarknessRadiusMin
    This script command is used to change the darkness radius gradually to the min on the current map. The player will be lost its light source.

    1705647885786.png
    DynamicDarkness-SetRadius.gif

Event Behaviours
These are several pieces of text that can be put into the event's name,
which will cause those events to have particular behaviours.
Below is a list of those texts and behaviours.
  • "glowalways"
    An event with this text in its name will always become a light source.
    1705646886978.png
  • "glowswitch(X)"
    An event with this text in its name will become a light source if the switch is ON. If there is a "glowswitchreverse" in its name, it will become a light source if the switch is OFF instead. The "X" is the game variable ID (1 - xxx) or the event's self switch (A, B, C, or D).
    1705647139061.png
    1705647155687.png
    DynamicDarkness-Switch.gif

    This will make the event light up if the switch is ON.
  • "glowsize(X)"
    An event with this text in its name will become a light source with a radius of "X" pixels. This is also treated as "glowalways" if there is no "glowswitch(X)" in its name.
    1705647295452.png
    DynamicDarkness-Size.gif
  • "glowstatic"
    An event with this text in its name will become a static light source. This is also treated as "glowalways" if there is no "glowswitch(X)" in its name.
    1705647381780.png
    DynamicDarkness-Static.gif
  • "flashlight" or "flashlight(X)"
    An event with this text in its name will use a flashlight. The "X" is the distance of the flashlight (max. FLASHLIGHT_MAX_DIST).
    1706065272359.png
    DynamicDarkness-Flashlight.gif

Limitations
This plugin has several limitations that make it work properly.
  • It only work on dark maps. You can check it on your map metadata PBS file.
  • It doesn't support connected maps.
  • It doesn't support colored light source.
Credits
Caruban
Author
Caruban
Downloads
330
Views
2,593
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from Caruban

Latest updates

  1. Minor update (v1.2.0)

    Add a new event behaviour "glowswitchreverse", so now it can be used for events that only glow...
  2. v1.1.0 Update

    v1.1.0 Update Change logs: Added flashlight effect Added custom darkness image function
Back
Top