设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 95|回复: 0

[转载] TUTORIAL: The Absolute Basics of Plugin Making

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    慵懒
    昨天 15:43
  • 签到天数: 207 天

    连续签到: 1 天

    [LV.7]常住居民III

    3122

    主题

    862

    回帖

    2万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    20214
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    24228

    灌水之王

    发表于 昨天 21:58 | 显示全部楼层 |阅读模式
    This will only cover the BASICS of plugin making.  I will add more to this when the video is up ( i.e. how to pull params from the user to use in your plugin)

    A video will accommodate this in a little bit.  You will NOT become a level 99 Warlock after this... maybe. a level 5 Wizard?.

    Anyways,

    1.  Download my template

    View attached files.

    2. Download an IDE,  or a Text editor specifically for coding  ( I use Notepad ++)  (you can use regular note pad, but that's boring)

    https://notepad-plus-plus.org/

    3. Load my Template and read through my comments.  You can adjust code if you'd like.

    Believe it or not,  this is actually a working plugin as well.  Load this to your plugins folder and turn

    on your Text Drawing on your title screen.. see what happens!

    * I will explain this below for the newer guys later tonight*  Please read through replies on this thread for errors or best practice.

    Shaz said:
    Moving to Learning Javascript, & pinning

    I think you should highlight the aliasing and calling of aliased methods more.  First read through I didn't think you had it in there at all.  This should be explained VERY well, and recommended as best practice, otherwise we're going to get a LOT of people writing plugins that just overwrite methods, which is going to give us a lot of incompatible plugins.                
    Click to expand...

                    JavaScript:        
    //============================================================================= // Toms_Example Template // by Faytless / Thomas Pham // Date: 10/25/2015 //============================================================================= /*: * @plugindesc xxxxx  // Describe your plugin * @author yyyy       // your name goes here * * @param xxxxx      //name of a parameter you want the user to edit * @desc yyyyy       //short description of the parameter * @default zzzzz    // set default value for the parameter */   // NOTE: THIS WILL NOT MAKE YOU A DARK WIZARD. HERE ARE SOME BASE FOR YOU TO LAY A FOUNDATION FOR PLUGINS!   // NOTE: THIS WILL NOT MAKE YOU A DARK WIZARD. HERE ARE SOME BASE FOR YOU TO LAY A FOUNDATION FOR PLUGINS!   // NOTE: THIS WILL NOT MAKE YOU A DARK WIZARD. HERE ARE SOME BASE FOR YOU TO LAY A FOUNDATION FOR PLUGINS!     // NOTE: THIS WILL NOT MAKE YOU A DARK WIZARD. HERE ARE SOME BASE FOR YOU TO LAY A FOUNDATION FOR PLUGINS!     // NOTE: THIS WILL NOT MAKE YOU A DARK WIZARD. HERE ARE SOME BASE FOR YOU TO LAY A FOUNDATION FOR PLUGINS!       // NOTE: THIS WILL NOT MAKE YOU A DARK WIZARD. HERE ARE SOME BASE FOR YOU TO LAY A FOUNDATION FOR PLUGINS!       // NOTE: THIS WILL NOT MAKE YOU A DARK WIZARD. HERE ARE SOME BASE FOR YOU TO LAY A FOUNDATION FOR PLUGINS!         // NOTE: THIS WILL NOT MAKE YOU A DARK WIZARD. HERE ARE SOME BASE FOR YOU TO LAY A FOUNDATION FOR PLUGINS!         // NOTE: THIS WILL NOT MAKE YOU A DARK WIZARD. HERE ARE SOME BASE FOR YOU TO LAY A FOUNDATION FOR PLUGINS!           // NOTE: THIS WILL NOT MAKE YOU A DARK WIZARD. HERE ARE SOME BASE FOR YOU TO LAY A FOUNDATION FOR PLUGINS!                       // Declare your function // 1.  change *** to your plug ins file name below. // You are telling RPG maker that this plugin exsists. (function() {  var parameters = PluginManager.parameters('template');       // NOTE: THIS WILL NOT MAKE YOU A DARK WIZARD. HERE ARE SOME BASE FOR YOU TO LAY A FOUNDATION FOR PLUGINS!     // Now find something you want to edit in the core plugins.  You can     // find them in the Project\www\js folder     // 2. find the EXACT function you want to edit         /*  This function can be found in rpg_scenes.js       Scene_Title.prototype.drawGameTitle = function() {           var x = 20;           var y = Graphics.height / 4;           var maxWidth = Graphics.width - x * 2;           var text = $dataSystem.gameTitle;           this._gameTitleSprite.bitmap.outlineColor = 'black';           this._gameTitleSprite.bitmap.outlineWidth = 8;           this._gameTitleSprite.bitmap.fontSize = 72;           this._gameTitleSprite.bitmap.drawText(text, x, y, maxWidth, 48, 'center');           */               // You need to come up with a name for your modification while keeping       // class name the same.           // the name of the function I want to edit is called         //  Scene_Title.prototype.drawGameTitle         // The name of my function will be called _Scene_Title_xxx       // Follow for ease of use,  follow the template below.       // Start your var as _NAME_NAME_YOURCLASSNAME       // Have it equal the function you are replacing           var _Scene_Title_xxx = Scene_Title.prototype.drawGameTitle;             // make your adjustments by adding code, or adjusting them below.     // This is an exact copy of the code above,  but with some of my adjustments     // to some of the parameters.  Later,  I will show how you can call your parameters that the user adjusts     // so your plugin has a little more control           Scene_Title.prototype.drawGameTitle = function() {                 // _Scene_Title_xxx.call(this);           //sometimes you have to call your function to get this to work.  In this case you don't Ill explain why later.           var x = 20;           var y = Graphics.height / 4;           var maxWidth = Graphics.width - x * 2;           var text = $dataSystem.gameTitle;           this._gameTitleSprite.bitmap.outlineColor = 'black';           this._gameTitleSprite.bitmap.outlineWidth = 8;           this._gameTitleSprite.bitmap.fontSize = 200;           this._gameTitleSprite.bitmap.drawText(text, 0,0 , maxWidth, 48, 'center');             }           })();  // dont touch this.




    本贴来自国际rpgmaker官方论坛作者:Faytless处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/tutorial-the-absolute-basics-of-plugin-making.47215/

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有账号?立即注册

    x
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2026-7-8 00:54 , Processed in 0.144817 second(s), 57 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表