Preserved forum archive. This topic stores the original first post and locally mirrored RPG Maker Web attachments when available. It is posted by the BMMPlay archive account, not by the original creator.
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
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).
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.
QUALITY OF LIFE FUNCTIONS
IMPROVED FUNCTIONS / FIXES
Mini Version of the base MV & MZ
=== 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.
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.
The tier list I use use to organize my plugins.
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
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
This has function to improve the game, have various fixes along the
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.
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.
Set a Copyright text on the bottom of the game screen.
as it is optional, leave empty for not using it.
as it is optional, leave empty for not using it.
Blur Background is the snap that is taken when you open a menu,
when ON, the background is shown, when OFF, it is removed.
when ON, the background is shown, when OFF, it is removed.
when setting "Max Picture" higher than 100, use the scriptcall as default
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);
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);
Remove the plural letters A, B, C, D, ...etc from the same enemies in battle,
set it in the parameter to keep it or remove it.
set it in the parameter to keep it or remove it.
Set how many items you can carry per item, weapon, armor (if they can stack).
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.
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.
Set in the item notetag <prevItem> or <onUse: x>, upon using the item, with <preVItem>
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>.
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>.
Show the items number when you reach the amount for items, armor, weapons, keyitems.
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.)
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.)
There are times you can buy stuff, but not enough gold, if you set it to ON,
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.
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.
Set a variable to store the gold spent/gained from buying/selling items,
the same can be done for variables bought items and sold items.
BECAREFUL WITH ACHIEVEMENT AS THEY CAN CHEAT ON IT!
the same can be done for variables bought items and sold items.
BECAREFUL WITH ACHIEVEMENT AS THEY CAN CHEAT ON IT!
Run a Common Event after loading a saved game.
(for variables or conditional check on users System)
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"
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"
For debugging the event page to skip from start to end or parts can be done easy.
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
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(eventId, distance)
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.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.lock(); <= This will lock both events and player movement
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
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
This unique trigger can be helpful, so what does <TriggerBoth> tag do.
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.
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.
The Fancy Debug Log is intergrated into my base and for use easier use
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
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
F5 button can be disabled (default: false).
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.
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
Scriptcall: toggleSwitch(id)
this will toggle any switch ID to be OFF => ON or ON => OFF.
this will toggle any switch ID to be OFF => ON or ON => OFF.
Scriptcall: setSS(mapId, eventId, letter, state)
Set a SelfSwitch on MapId, EventId, "A" "B" "C" "D", true/false.
Set a SelfSwitch on MapId, EventId, "A" "B" "C" "D", true/false.
Scriptcall: runCE(id)
Run a Common Event with the id specified.
Run a Common Event with the id specified.
Scriptcall: setTotalVar(base, calc)
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.
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
Fix PlayTime to be accurate and FrameCount to avoid Game Freezes
as well for pixels on bitmap images.
Includes Mac15001900 SceneManager.update and SceneManager.updateMain
as well for pixels on bitmap images.
Includes Mac15001900 SceneManager.update and SceneManager.updateMain
Fix scrolling function (move cursor down, left, right, up)
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.
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.
Able to manipulate the fontSize settings.
Set a minimum MAX FontSize and a minimum MIN FontSize,
as well for increasing/decreasing with \{ and \}
Set a minimum MAX FontSize and a minimum MIN FontSize,
as well for increasing/decreasing with \{ and \}
Preload fonts that you use inside the game.
You can use it with plugin that change fonts midgame like YEP_MessageCore.
You can use it with plugin that change fonts midgame like YEP_MessageCore.
Fix letters on the Name Input window that aren't centered by default.
This fix it as many forget to do this when name input is used.
This fix it as many forget to do this when name input is used.
\S[id] checks the status "false" or "true" and could be used for debug
\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.
\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.
Add the following to any Item or Skill notetag you want to use a custom SFX:
<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.
<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.
Play all Common Events in a row that is set, otherwise, only the last one will play.
This will remove a common event in the queue and play the next one.
This will remove a common event in the queue and play the next one.
Fix the MoveRoute from events than start over from a move route when you interacted with it.
Mini Version of the base MV & MZ
This version has the Base Core function
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.
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
Log in to download
Log in, then follow the RPG Maker Developers Group to see these download links.
Log in to downloadLicense / 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.
0
replies
2
views
Topic Summary
Loading summary...