- Pokémon Essentials Version
- v21.1 ✅
Caruban's Dynamic Darkness
By Caruban
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.
By Caruban
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)
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 mapsFLASH_CIRCLE_RADIUS
Radius of darkness circle while using FlashVARIABLE_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 mapsOPACITY_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 flashFLASHLIGHT_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 flashlightFLASHLIGHT_MAX_DIST
The initial value of the maximum distance for a flashlightFLASHLIGHT_X_OFFSET
andFLASHLIGHT_Y_OFFSET
The value of a flashlight's light sources X and Y offset from the centre of the character spritesCUSTOM_IMAGE_DARKNESS
Custom darkness images based on Map ID
Images are located in "Graphics/Fogs/"
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.
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.
"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).
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.
"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.
"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
).
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