MV SDJB_Base (Tweaks and more for SDJB_Plugins)
BMM_Archive · July 15, 2026
Original Source
- Original title: MV SDJB_Base (Tweaks and more for SDJB_Plugins)
- Original author: ShadowDragon
- Original date: April 24, 2024
- Source thread: https://forums.rpgmakerweb.com/threads/sdjb_base-tweaks-and-more-for-sdjb_plugins.168037/
- Source forum path: Game Development Engines > RPG Maker Javascript Plugins > JS Plugins In Development
Summary
PluginName: SDJB_Base Author: ShadowDragon This plugin is my base, and would be required for most of my plugins, as I add and modify functions for my plugin (personal) as well for public plugins (free/paid).
Archived First Post
Author: ShadowDragon
This plugin is my base, and would be required for most of my plugins, as I add and modify
functions for my plugin (personal) as well for public plugins (free/paid).
What this base can do and what functions that are "improved", "new", "added" and more.
some plugins are not independent on this one, but I rewrite some of plugins to SDJB as
I improve the functions as well.
All functions available inside spoiler.
This list is also required for ALL plugins for different authors to be
set in the same order for maximum compability.
→ Tier 0: Core
→ Tier 1: Battle
→ Tier 2: Item
→ Tier 3: Skill
→ Tier 4: Equip
→ Tier 5: Status
→ Tier 6: GamePlay
→ Tier 7: Movement
→ Tier 8: Quest
→ Tier 9: Options
→ Tier 10: Eventing/Misc
→ Tier 11: Utility
way for a smoother gameplay, so it won't be noticed much.
The most imported function is the Base is my core code that is used
through my other plugins.
as it is optional, leave empty for not using it.
when ON, the background is shown, when OFF, it is removed.
to call the ID above 100, for "Battle" use PictureId + MaxPicture.
if Max Picture = 2000, than Battle Picture start at 2001.
$gameScreen.showPicture(pictureId, name, origin, x, y, scaleX, scaleY, opacity, blendMode)
Example:
$gameScreen.showPicture(1742, "File", 0, 10, 10, 100, 100, 255, 0)
Other scriptcalls are required as normal:
$gameScreen.movePicture(pictureId, origin, x, y, scaleX, scaleY, opacity, blendMode, duration);
$gameScreen.rotatePicture(pictureId, speed);
$gameScreen.tintPicture(pictureId, tone, duration);
$gameScreen.erasePicture(pictureId);
set it in the parameter to keep it or remove it.
You can use JavaScript to control the item like: <Item Limit: $gameVariables.value(12)>
to store the max Item Limit in there whatever the value may be.
it will take the item Id before the current item.
Example, you have the next in the database:
2: empty Bottle
3: empty Vial
10: potion 1/3 (in notetag <onUse: 2) you lose item 10 and gain item 2
11: potion 2/3 (in notetag <preVItem>) you lose item 11, and gain item 10
12: potion 3/3 (in notetag <preVItem>) you lose item 12, and gain item 11
the notetag <onUse: x> is optional, x can be a valid JS if it returns a number.
if you dont use the notetag <onUse: x> the item is lost as normal.
You can also have a change to consume the item upon using the item.
use the tag <useChance: 0.5> for 50% change.
You are able to combine them, so you can get a previous item <prevItem> or <onUse: x>
when the item is used when you use the tag <useChance: x>.
default is 0 which always shows the item number when reaching 1.
if set to 5, the item number is drawed at when the item possession reached 6.
it's recommended to either either choose 0 (always) or 1 (at counting 2 or more.)
you can go under your currency.
When that happens, you can decide what happens when they go under it.
you can kick the party out of the store or pay back the gold they owned first
before they can buy new stuff.
When its OFF, it uses the default behavior.
the same can be done for variables bought items and sold items.
BECAREFUL WITH ACHIEVEMENT AS THEY CAN CHEAT ON IT!
getTime() function has some usefull time parts that can set in a variable
or multiple variables to get the date you want to show.
Samples you can use in a variable or a Real Time System (must be set manually).
getTime() => returns default: "day" "fullMonth", "hour":"minutes"
getTime("string") can return the following if you them seperatly to read the systemTime.
"format" => get the format you set inside the parameters or default: DD-MM-YYYY
"hour" or "hr" => get the hours, number lower than 10 will convert it with a "0" in front
"minutes" or "min" => get the minutes, number lower than 10 will convert it with a "0" in front
"seconds" or "sec" => get the seconds , number lower than 10 will convert it with a "0" in front
"day" => get you the day of the week (1, 2, 3, ...)
"week" => get you the full Name of the week ("Sunday", "Monday", "Tuesday", ...)
"month" => get the month Name fully ("January", "February", "March", ... etc)
"monthN" => get the month value, number lower than 10 will convert it with a "0" in front
"year" => get the full year (2023)
"curTime" => returns the time "16:50"
"curDate" => returns "wednesday 29 march 2023"
Inside the Parameter, you can set a custom Time Format (like the samples above).
The possible options for this format are slightly different.
"YYYY" = Year
"MM" = Month Number
"DD" = Day Number (1,2,3, ... 30, 31)
"HR" = Hours
"MIN" = Minutes
"SEC" = Seconds
"WDAY" = WeekDays (Sunday, Monday, Tuesday...)
"MONTH" = Month Name
Format samples:
getTime() => defaul: 11 August, 19:10
getTime("format") => get default parameter setup DD-MM-YYYY
getTime("format", "YYYY/MM/DD HH:mm"); => "2025/08/11 14:42"
getTime("format", "DD-MM-YYYY"); => "11-08-2025"
getTime("format", "DAY, DD MONTH"); => "Monday, August 11"
Use comment tag to start with "=>"" and end with "<=" to rule out a section.
sample:
text 1
text 2
=>
text 3
text 4
text 5
<=
text 6
text 7
text 8
This example show in the text message, text 1, text 2, text 6, text 7 and text 8
SDJB.DistanceEP(4, 6) <= checks if event 4 is 6 tiles away from the player (in diamond shape)
SDJB.DistanceEE(eventId1, eventId2, distance)
SDJB.DistanceEE(12, 6, 5) <= checks if event 12 is 5 tiles away from event 6 (in diamond shape)
SDJB.unlock(); <= This will unlock both events and player movement
SDJB.lockEvents(); <= This will lock all events
SDJB.unlockEvents(); <= This will unlock all events
SDJB.lockPlayer(); <= This will lock the player
SDJB.unlockPlayer(); <= This will lock the player
By default, Event can be triggers with either "Event Touch" or "Player Touch".
By putting a NoteTag or Comment Tag <TriggerBoth>, this trigger both the
"Event Touch" and "Player Touch".
There are times you require both, now you can, permantly or temporarily.
for the shortcut to use.
sucLog(success, message)
infoLog(info, message)
warnLog(warning, message)
errLog(error, message)
set success, info, warning or error into quotes, message in qoutes unless a function
baseLog(message)
this uses the default console.log window
When Disabled: the game won't reboot.
When Enabled: the game will reboot as normal.
NOTE: this does NOT work online because the refresh button still works.
QUALITY OF LIFE FUNCTIONS
this will toggle any switch ID to be OFF => ON or ON => OFF.
Set a SelfSwitch on MapId, EventId, "A" "B" "C" "D", true/false.
Run a Common Event with the id specified.
Example: setTotalVar(1, 5)
This set the number in variable 1 to variable 5.
In case variable 5 has already a value, it will add the number to it.
IMPROVED FUNCTIONS / FIXES
as well for pixels on bitmap images.
Includes Mac15001900 SceneManager.update and SceneManager.updateMain
Improve selection in window, what is last, return to the first, up and down last item on the bottom.
this is not default as it stops on the last index and wont scroll/jump back to the top, so this is
implemented to make it work like that for smoother navigations.
Set a minimum MAX FontSize and a minimum MIN FontSize,
as well for increasing/decreasing with \{ and \}
You can use it with plugin that change fonts midgame like YEP_MessageCore.
This fix it as many forget to do this when name input is used.
\MAP[n] will show you MapId's Names (not the Display Name). (no more typo's in Map Names).
\VA[id][index] will take a value from a variable array, arrays needs to be manually initilized.
Example : Variable 4 = [1,3,5,6,9,12], so \VA[4][1] takes the value 3 (array index starts with 0)
Example 2: Variable 4 = ["3", 4, "power", 5, "8"], so \VA[4][2] takes "power" (array start with 0)
\JS{eval code} will evaluate any javaScript code (under construction)
\CALC[3]+[4] ~ \CALC[3]-[4] ~ \CALC[3][4] ~ \CALC[3]/[4] are calculations of 2 variables values.
...add up....~...subtract...~...Multiply...~....Divide....
\WAIT[n] will wait x frames, this gives you a bit more control when the text continues.
More might come or with idea's to add them.
<SE:[{
"name": "Filename",
"pan": 0,
"pitch": 100,
"volume": 100
}]>
Alternatively:
<SE:[{"name": "Filename", "pan": 0, "pitch": 100, "volume": 100}]>
Enclose the Filename in quotes ("File") without extension (.ogg).
Pan/Pitch/Volume are all numbers between 0-100
Leaving it empty will result in the default System SE.
This will remove a common event in the queue and play the next one.
Mini Version of the base MV & MZ
The RealTime System and Consume Item functions (confirmed).
I cannot test which version works in MZ from the MV base, but feel free to test.
=== TERMS OF USE ===
Free for Non-Commercial and Commercial use when credit is given.
credit one of the following:
ShadowDragon
ShadowDragonJB
Version + UPDATE'S
24-04-2024 Version 0.1.0 first release
04-06-2024 added Copyright, made changes, fixes
30-07-2024 changes <Hide Item> to Show Item parameter
18-11-2024 Added missing functions to the helpfile
=== WARNING ===
YOU ARE NOT ALLOWED TO:
* MODIFY without permission
* EXTEND without permission
* TAKE CODE without permission
* CLAIM AS YOU MADE IT
* REDISTRIBUTE but link back to the forum or itch.io
* SELL this product as standalone.
* DO NOT REMOVE THE HEADER.
Itch page will be later added, with some of the functionals this plugin can do.
Along with some samples and tutorials to various mechanics in my own way and
some that I use for your game.
This plugin is in WIP, but if there are issues, please let me know.
Download from itch.io
MV and MZ version can be downloaded from the link above.
Downloads / Referenced Files
RPG Maker Web attachments are mirrored locally when available. Other external links remain hosted by their original creator or third-party service.
- Download: itch.io
License / Terms Note
=== TERMS OF USE === Free for Non-Commercial and Commercial use when credit is given. credit one of the following: ShadowDragon
Creator Claims / Removal
If you are the original creator and want this listing reassigned, edited, or removed, join BMMPlay and contact the moderators with proof that matches the original RPG Maker Web profile, linked GitHub, itch.io page, or another public creator identity.
Replies (0)
No replies yet.
Topic Summary
Loading summary...