查看: 5034|回复: 2

[交流讨论] MV 脚本小练习

[复制链接]

…あたしは天

梦石
0
星屑
2308
在线时间
4033 小时
注册时间
2010-10-4
回帖
10548

开拓者贵宾

发表于 2015-11-7 10:19:58 | 显示全部楼层 |阅读模式

加入我们,或者,欢迎回来。

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

×
MV 脚本练习

有人说要从实践中学习脚本。其实自带的脚本就是很好的练习题呢~

题目要求:请根据注释,写出对应功能的脚本。
[fold=1]
[pre lang="javascript"]
/*:
* @plugindesc Change skill id of attack for each weapon.
* @author Sasuke KANNAZUKI
*
* @help This plugin does not provide plugin commands.
*
* When <skill_id:3> is written in a weapon's note field,
* skill id # 3 is used for the weapon's attack.
* If nothing is written, default id(=1) is used.
*
* Check Points:
* - When multiple weapons are equipped, the skill id of the weapon
*  held in the dominant hand (previously defined) is used.
* - It is most favorable for "skill type" to be "none"(=0),
*  otherwise you cannot attack when your skill is blocked.
*
* Usage examples of this plugin:
* - to create all-range weapons
* - to create dual-attack or triple-attack weapons
* - If healing skill is set when actor attacks, you can choose a friend to heal.
* - It is possible to make a weapon that functions similar to a guard command.
*/
[/pre][/fold]

[fold=2][pre lang="javascript"]
/*:
* @plugindesc Changes the position of the title command window.
* @author Yoji Ojima
*
* @param Offset X
* @desc The offset value for the x coordinate.
* @default 0
*
* @param Offset Y
* @desc The offset value for the y coordinate.
* @default 0
*
* @param Width
* @desc The width of the command window.
* @default 240
*
* @param Background
* @desc The background type. 0: Normal, 1: Dim, 2: Transparent
* @default 0
*
* @help This plugin does not provide plugin commands.
*/
[/pre][/fold]

[fold=3][pre lang="javascript"]
/*:
* @plugindesc make the skill that consumes HP, not only MP and/or TP
* @author Sasuke KANNAZUKI
*
* @help This plugin does not provide plugin commands.
*
* write following format at skill's note:
*  <hp_cost:30>  # the skill consumes 30 HP.
*
*  The skill can use even if subject's HP is less than skill's HP Cost.
*  In that case, let the subject's HP be 1.
*  (i.e. subject won't die by the skill.)
*/
[/pre][/fold]

[fold=4][pre lang="javascript"]
/*:
* @plugindesc Turns ON the specified switch when loading a game.
* @author Yoji Ojima
*
* @param Switch ID
* @desc The ID of the switch to be turned ON when loading a game.
* @default 0
*
* @help This plugin does not provide plugin commands.
*/
[/pre][/fold]

[fold=5][pre lang="javascript"]
/*:
* @plugindesc Changes a self switch for other events.
* @author Yoji Ojima
*
* @help
*
* Plugin Command:
*   OuterSelfSwitch on 3 A     # Turns on the switch A for the event #3
*   OuterSelfSwitch on 4 B     # Turns on the switch B for the event #4
*   OuterSelfSwitch off 5 C    # Turns off the switch C for the event #5
*   OuterSelfSwitch off 6 D    # Turns off the switch D for the event #6
*   OuterSelfSwitch off all A  # Turns off the switch A for all the events
*/
[/pre][/fold]

参考答案:MV 自带的插件(含免费的DLC)

@鑫晴  

评分

参与人数 2星屑 +6 收起 理由
狛尨鸮の传说 + 5 0v0..
鑫晴 + 1 (ΦωΦ)

查看全部评分

梦石
0
星屑
48
在线时间
784 小时
注册时间
2013-1-4
回帖
1057
发表于 2015-11-7 10:56:57 | 显示全部楼层
MV 脚本练习
请把P2换成P3
参考RM自带的core和pixi
【说起来git上已经有一个这样的项目了囧
RM-GUI延期。。。最近被黑心老板压迫T_T
二次元少女的shitake,长着长脸,身高165,蓝色卷双马尾,FCUP,瞳色黑色,病气和御宅属性,是天才少女。
回复

使用道具 举报

梦石
0
星屑
1232
在线时间
1017 小时
注册时间
2011-4-30
回帖
1464
发表于 2015-11-7 12:30:26 | 显示全部楼层
试了试第五个.....
....花了半天时间才搞出来  T _ T

点评

额,老是多写少写符号....然后发现事件里自带的独立开关操作,使用 打开 时传入值是0......T_T  发表于 2015-11-7 12:47
不难吧……遍历地图上所有事件就好了啊……  发表于 2015-11-7 12:33
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部