Status
Not open for further replies.

Drakkonis

Veteran
Veteran
Joined
Mar 5, 2021
Messages
139
Reaction score
99
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,952
Reaction score
1,409
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
139
Reaction score
99
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
706
Reaction score
584
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
139
Reaction score
99
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,018
Reaction score
5,667
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

I realized that I don't talk about my game's plot too much. not that I'm hiding stuff, I just don't know what I should tell people in general that would be important. I know more so what plot points NOT to tell.
Have any of you read Sutter Kane?
jaynightwolf wrote on GalacticGod's profile.
hello GALACTICGOD I loved your characters especially the super heroes, I am new to this rpg program and I would like to know if you have more characters from DC comics, be they villains or heroes
My winter pack is now free on itch.io!
Writing music for Utara Forest, a location in All the King's Men. Nothing evokes a mysterious, dreamy sound like solo clarinet and modulation!

Forum statistics

Threads
111,471
Messages
1,061,347
Members
144,848
Latest member
YoSocrates
Top