Status
Not open for further replies.

Drakkonis

Veteran
Veteran
Joined
Mar 5, 2021
Messages
137
Reaction score
98
First Language
English
Primarily Uses
RMMZ
Since I got MZ before getting MV, my plugins are written with MZ in mind, and the bigger the plugins get, the more likely that they CAN'T work with MV. Is there a good way to detect if a plugin is being used in one over the other? I figure the most obvious way is to try calling a function native to MZ, and deciding MV is being used if that fails... but I'd like something a bit less... random-looking? A dev who doesn't look at the code wouldn't notice or care, but a fellow code monkey might be wondering why a ColorManager call(for example) was being tried when there was nothing in the plugin dealing with colors.

Basically I'd like to make all my plugins compatible with both engines without having to code and release a separate version. Ideally I'd detect the engine at startup, have MV and MZ versions of functions with exclusive code, and call the right one based on the engine detected.

Kinda got inspired by reading up on FOSSIL, and thought about doing pretty much the reverse, "retro-proofing" my plugins.
 
Last edited:

Eliaquim

Hakuen Studio
Veteran
Joined
May 22, 2018
Messages
1,946
Reaction score
1,403
First Language
Portuguese - Br
Primarily Uses
RMMZ
I wish I had this approach before =/
Anyway, you can use the Utils for both: In one engine it will return "MV" in another "MZ".
JavaScript:
if(Utils.RPGMAKER_NAME === "MV"){
// Do MV code
}else{
// Do MZ code
}
 

Drakkonis

Veteran
Veteran
Joined
Mar 5, 2021
Messages
137
Reaction score
98
First Language
English
Primarily Uses
RMMZ
I wish I had this approach before =/
Anyway, you can use the Utils for both: In one engine it will return "MV" in another "MZ".
JavaScript:
if(Utils.RPGMAKER_NAME === "MV"){
// Do MV code
}else{
// Do MZ code
}
Awesome, that is EXACTLY what I needed! I'd already gotten the "ColorManager" version working, and along the way discovered I was using try... catch... wrong. MZ didn't care, but MV threw an absolute fit over it. Oh well, I already needed to rewrite parts of my TP Control plugin if I was gonna retro-proof it, I just need to remember to update all the try... catch... code in there while I'm at it.

...also means I need to start studying MV's code as I work on retro-proofing what I have... and as I work on stuff in the future, since I DO eventually want to start working on scenes and such. And I had just started getting a glimmer of hope that I was figuring MZ out.... :dizzy:

Thanks!
 

Restart

Veteran
Veteran
Joined
Mar 15, 2019
Messages
704
Reaction score
580
First Language
English
Primarily Uses
RMMV
Awesome, that is EXACTLY what I needed! I'd already gotten the "ColorManager" version working, and along the way discovered I was using try... catch... wrong. MZ didn't care, but MV threw an absolute fit over it. Oh well, I already needed to rewrite parts of my TP Control plugin if I was gonna retro-proof it, I just need to remember to update all the try... catch... code in there while I'm at it.

...also means I need to start studying MV's code as I work on retro-proofing what I have... and as I work on stuff in the future, since I DO eventually want to start working on scenes and such. And I had just started getting a glimmer of hope that I was figuring MZ out.... :dizzy:

Thanks!

My advice is to open up notepad++, put the rmmv version on the left tab, the rmmz on the right tab, and cross your eyes so you look at both version at once :p
 

Drakkonis

Veteran
Veteran
Joined
Mar 5, 2021
Messages
137
Reaction score
98
First Language
English
Primarily Uses
RMMZ
My advice is to open up notepad++, put the rmmv version on the left tab, the rmmz on the right tab, and cross your eyes so you look at both version at once :p
I use Visual Studio Code. Could potential still do it that way, but I think the easier option is to try to run my plugins in MV, see what breaks, and chase it down. Right now it's all simple stuff, and the only strict incompatibility I'm aware of in my plugins all involve ColorManager. So if I want to make a retro-proofing plugin like a reverse FOSSIL, that'd be the first place to start. Which I think I might start doing now... the idea has wormed into my brain. This is gonna be a long, hard, frustrating ride.... and I don't think I could come up with as creative a name as FOSSIL....
 

Wavelength

MSD Strong
Global Mod
Joined
Jul 22, 2014
Messages
6,013
Reaction score
5,662
First Language
English
Primarily Uses
RMVXA

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

Latest Threads

Latest Posts

Latest Profile Posts

TFW you discover how the script batching works in VNMaker... after you've had the program for almost 3 years.
hAx6iQ3.gif

Writes that the characters have to climb a mountain.

Realized that I have to draw six sets of models where characters are climbing.

At least I know how to draw something. :)
I'm currently scratching my head on how to design plains. What do I even put in plains? Some trees (but not too many or it turns into a forest)? Grass? A few bushes? That's a bit dull.
I'm looking for tutorials but Google didn't seem to find much (or maybe I have the wrong keywords). I don't know how to map plains and I don't know how to learn.
I should probably be dragged kicking and screaming away from Daz3D... I was playing with 8.1 models and came up with this. Thoughts?
and_remember_tomorrow_miranda_8_1.jpg

Forum statistics

Threads
111,403
Messages
1,060,852
Members
144,750
Latest member
corvid
Top