Welcome Guest ( Log In | Register )

[ Big| Medium| Small] -



Post new topic Reply to topic  [ 2 posts ] 
    coyotecraft
  Sat Oct 24, 2015 10:43 am
User avatar
Sponsor

Big Dumb Guy
This is going to be a pretty pitiful lesson on MV's Plugins. This is just from a day one glimpse of RMMV. I'm sure someone else will make a better guide in the future.
Unlike the ruby script editor, Javascript plug-ins have to be written outside the program. Notepad is all you really need, however it won't colorize your code.

[Creating a New Plugin]
Saving from Notepad into your project's plugin folder, change the file type to All files (*.*) and end the filename with .js
Rpg Maker's Help file says it uses UTF-8 for character code, so that's what we'll change the encoding to.
ImageImage

[Setting Parameters]
First things first, add your documentation.
Any line starting with // will be a comment and not executed code.
The documentation that appears in the plugin editor begins and ends with /*: and closes with */ like so
Image
You can read more about the plugin parameters in the help file.

[Redefining Methods & Functions]
I think most people will want to make changes to what's already there. So what you can to do is search for the existing methods and functions like window and display items. There's no convenient script editor; being familiar with the RGSS in previous makers will clue you in to which .js you should look in, otherwise you may need to find what you're looking for.

I know I'm glossing over a lot. But I believe you'll pick up the proper syntax and structure as you play around.

For this example I'm going to change the Party Command List which is found in the rpg_windows.js
We don't want to edit it directly so we're going to copy it over to our plug-in file. Whatever changes we make in our plug-in will overwrite the original because we're using the same method name: Window_PartyCommand.prototype.makeCommandList
Image
With this function I can renamed the Fight and Escape commands. But that's dumb since we can edit the terms in the database. Instead we'll add a new command "Dance" between the Fight and Escape lines.

this.addCommand("Dance");
Image

All this does is add a new command to the list. Keeping this a simple demonstration, it won't actually do anything. Baby steps.
With the plugin enabled, and saved the changes to the project, when we test battle we should see this:
Image


[Aliasing]
some practical advice/ further explanations that might be hard to follow


[More to come?]
Where was I going with this
Image


Top Top
Profile      
 

    Amy
  Sat Oct 24, 2015 11:03 pm
User avatar
Staff

Big Dumb Guy
Cheers for this. I worked out most of it but this has cleared up a few things.

There's a lot of new keywords that will probably look scary to a newcomer, but once you're used to them and where they go (for example prototype: http://www.w3schools.com/js/js_object_prototypes.asp) it's pretty much Ruby with semicolons.


Top Top
Profile      
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 


Who is online

Users browsing this forum: No users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

We are an independent, not-for-profit game making community.
Homepage
Board Index
About Us
Downloadable Games
Free Browser Games
Games in Development
RPG Maker Support
Game Maker Support
Construct 2 Support
HBGames the eZine
Advanced RPG Maker
Site Announcements
Powered by phpBB © phpBB Group