MZ I try to write my first plugin, but i simply dont know how i can make progress without help. it feels like everywhere misses a tiny bit of information

Screenshot (1355)_cr.png
it may sound a little vague, but let me explain. at the moment i'm working on a plugin, which should extend the enemy loot system a bit. it should be compatible with the plugins of the visustella engine so my project doesn't have to start all over again. but my problem now is that i have no idea whether what i'm doing is right at all, and there's no way for me to find out for myself. I can't test the plugin because I would need to know the method from the visustella plugin, but I can't find its name. Also, this is my first time with javascript, and since I only know java, I don't know what to expect. the types are probably wrong, very likely even. I'm also analyzing note tags for the first time, and there are probably many hidden errors there as well. my IDE is also probably not perfectly optimized (Visual Studio). So my question is: how can I test my code myself so that I'm not busy asking stupid questions all day?
We are both in the same boat.

The only way I found was to test directly in-game. You write, save, then beta test.

As for Visustella, I never worked with it too. You probably will need to rummage through the code to find what you want, like I did with the codes from the plugins I was trying to fix and implement new things.
Write your plugins against the core scripts first. If you need to add functionality to an existing function, alias it so that it still routes through the original.

Once your plugin is confirmed working, *then* enable the VS plugins and make sure it still works. If it gives you errors, you know that their plugins have modified something that isn't covered by aliasing the functions you're working with, in which case you may need to contact the team to figure out a compatibility patch.
We are both in the same boat.

The only way I found was to test directly in-game. You write, save, then beta test.

As for Visustella, I never worked with it too. You probably will need to rummage through the code to find what you want, like I did with the codes from the plugins I was trying to fix and implement new things.
Which would lead to my next question...

How exactly is it possible to find the name of said method when the code of the plugin i need to look into looks like this?
Screenshot (1356)_cr.png
through you code which I dont get fully, you use arrow function
like this: - > instead of = > (without space) which is mistake 1.

hence the red underline of bad implentation.
Write your plugins against the core scripts first. If you need to add functionality to an existing function, alias it so that it still routes through the original.

Once your plugin is confirmed working, *then* enable the VS plugins and make sure it still works. If it gives you errors, you know that their plugins have modified something that isn't covered by aliasing the functions you're working with, in which case you may need to contact the team to figure out a compatibility patch.
hm, ok, sounds pretty plausible. in my case, i would need to look into the function of the core script which determines which drops appear at the end of a fight. Shouldn't be that difficult, but I already know that compatibility will be limited, partly because of the timing of the drops being determined.
How exactly is it possible to find the name of said method when the code of the plugin i need to look into looks like this?
It isn't. VisuStella's code is obfuscated, so you can't find specific function names or code. I was going to ask you exactly how you intended to write it as compatible with them, and Trihan posted first 😉

His recommendation is the only feasible route.
hm, ok, sounds pretty plausible. in my case, i would need to look into the function of the core script which determines which drops appear at the end of a fight. Shouldn't be that difficult, but I already know that compatibility will be limited, partly because of the timing of the drops being determined.
1672856010201.png
Very good, thanks 😀 I will look into it tomorrow... I was so focused on looking how to make it work that I forgot to drink, and now I started getting headaches...
Very good, thanks 😀 I will look into it tomorrow... I was so focused on looking how to make it work that I forgot to drink, and now I started getting headaches...
Oh dear, definitely look after yourself first. The code will still be there afterwards. 🙂
let's start from the beginning: a plugin is meant to, in the worst case, replace or override an existing functionality, and in the best case, overhaul an existing one or ADD a completely new one.

DO YOU know a given functionality well enough to be able to override it? at least?
minimum.
you can't expect to come up with a plugin overnight without understanding how the program works.
it feels like everywhere misses a tiny bit of information
That's because writing a plugin requires you to read the relevant parts of the core scripts, and figure out how they work, so that you can figure out what you need to do in order to get your desired effect. It's difficult for a single tutorial to teach you everything you could possibly need to know, since every situation is going to be a little different. But pretty much any information you could need is present in the core scripts, so you just gotta take your time studying it until you can wrap your head around it.

my problem now is that i have no idea whether what i'm doing is right at all, and there's no way for me to find out for myself
Sure there is--just test it out and see if it works. Ideally, you should actually be testing it incrementally as you write it, rather than waiting till the very end. I don't know how to explain it well, but there are ways you can test specific snippets or functions, to make sure that they behave the way you expect them to, without having to have the full plugin complete. The developer console can be very helpful for this.

I can't test the plugin because I would need to know the method from the visustella plugin, but I can't find its name
Unless I'm actively trying to extend a specific plugin, I usually just do it like Trihan said: I first write the plugin against the core scripts, get it working solidly in a vanilla project, and *then* I enable other plugins and handle conflicts if necessary. That way, I can easily differentiate whether an issue is actually being caused by a plugin conflict, or if it's simply an error on my part.

But off the top of my head, I don't think that any of the basic VisuStella plugins even mess with enemy loot, so you probably don't even have anything to worry about in this case anyway.

my IDE is also probably not perfectly optimized (Visual Studio)
Visual Studio and Visual Studio Code are two different things, so it depends on which one of those you actually mean. IMO, the latter (Visual Studio Code) is the best out-of-the-box editor for working with JavaScript on Windows... but honestly, any text editor (even Notepad) can do the job.
let's start from the beginning: a plugin is meant to, in the worst case, replace or override an existing functionality, and in the best case, overhaul an existing one or ADD a completely new one.

DO YOU know a given functionality well enough to be able to override it? at least?
minimum.
you can't expect to come up with a plugin overnight without understanding how the program works.
Good question. My current problem is the following: I wanna add a very specific way of determine the drops of enemies that goes beyond the usual "this drop has a x% chance". Trojan showed me that the method I search is the "makeDropItems" function. This is a thing I could theoretically also implement with a JS notetag from the extraEnemyDrops-Plugin, but to be honest, there is something in me that just doesn't trust that notetag. So I think at least I kinda know what I want.
Sure there is--just test it out and see if it works. Ideally, you should actually be testing it incrementally as you write it, rather than waiting till the very end. I don't know how to explain it well, but there are ways you can test specific snippets or functions, to make sure that they behave the way you expect them to, without having to have the full plugin complete. The developer console can be very helpful for this.
That's actually something I already do with my java projects, but I don't know I do set up that in JavaScript.
One Thing that particularly paralyzes me in general is how different it feels to make a program in Javascript. Normally, my code is very, well, "Ravioli-Style", many classes, clear structures, etc.
Alone the fact that the typing system in JavaScript is less strict then in java creeps the hell out of me.

But off the top of my head, I don't think that any of the basic VisuStella plugins even mess with enemy loot, so you probably don't even have anything to worry about in this case anyway.
Actually, there is a plugin that does that: extraEnemyDrops. And while I love the grafical additions of it, I wanna include a specific way of determine the loot which goes over the possibilities of the plugin.
That's actually something I already do with my java projects, but I don't know I do set up that in JavaScript.
Just like Arthran said, the developer console: you just press F8 while running a play test and go to the Console tab. Type or paste any code you like in there to see what it does.

One Thing that particularly paralyzes me...creeps the hell out of me...
You are way more emotionally connected to your code than I have ever experienced 🤣
Just like Arthran said, the developer console: you just press F8 while running a play test and go to the Console tab. Type or paste any code you like in there to see what it does.
Didn't even knew that that's possible.
Will try out that as soon as I can.
You are way more emotionally connected to your code than I have ever experienced 🤣

Likely this doesn't only count for code, I am in general pretty emotional.
Has advantages and disadvantages.
I can be highly determined, but I also have a low frustration tolerance.

Good example from yesterday: I tried to test my code and the rpg maker says "method not found" or something like that.

Honestly, at that point I simply didn't knew what to do until I looked today in the forums again.

Original thread: https://forums.rpgmakerweb.com/threads/i-try-to-write-my-first-plugin-but-i-simply-dont-know-how-i-can-make-progress-without-help-it-feels-like-everywhere-misses-a-tiny-bit-of-information.153760/