设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
返回列表
+ 发新帖
查看: 212|回复: 0

[转载发布] Scripting shorthands - various utilities to make simple scripts easier

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    开心
    昨天 03:27
  • 签到天数: 222 天

    连续签到: 1 天

    [LV.7]常住居民III

    9102

    主题

    893

    回帖

    7万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

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

    灌水之王

    发表于 2026-7-29 16:26:32 | 显示全部楼层 |阅读模式


    An example of this plugin in action.

    Synopsis
    Howdy! Do you like to sometimes use scripts in your conditional branches and other commands? Are you annoyed at how much typing that requires? Well, you're in luck! *slaps roof of plugin* This bad boy can save you so many keystrokes! Let me show you just what it can do.

    Features
    $gv
    First of all, you no longer need to typeevery time you want to use a game variable - you now need 5 times fewer keystrokes with. But that's not all! Instead of usingandfunctions, you can read and writevalues just like with regular JavaScript variables, using an array-style bracket notation to specify the variable ID. What does that mean in practise? Just take a look at those examples:
    can be replaces withturns intobecomes just
    Behind the scenes, they still use regularandfunctions - for maximum plugin compatibility and to make sure event page conditions update properly (which they wouldn't if those were just simplealiases).

    $gs
    As you might have guessed, this shorthand serves a very similar function to, but it's for switches. That's about all there is to say about it, really.

    Examples:->->
    $ss
    And of course, there's also something for self-switches! Useto access self-switch X, e.g.to access self-switch A of the currently running non-parallel event. You don't even need an interpreter reference or know the ID of the that event.

    Use them similarly to $gv and $gs, e.g.->A check if all basic self-switches are on (doing this normally is so annoying I won't even show it) ->
    But that's not all! Download now and you'll get 22 brand new self-switches for free! That's right, you can also use letters from F to Z the same way you'd use A, B, C and D. The editor might not let you use those in most places, but they'll work just fine in scripts.

    $oss
    But what about self-switches on other events? Well, there's something for those too - four things in fact! Shorthands,,andcan each be used to access corresponding self-switches of another event on the same map, by adding its ID in brackets.

    Examples:->->
    But that's not all! They can also be used to access the same self-switch on a range of events simultanously, by using a string with two numbers separated by a dash to indicate the first and last ID.will return a list of the values of self-switch A for events 11, 12, 13, 14 and 15, e.g.will set self-switch A on all those events to true.

    There's no built-in function for doing this on non-consecutive event IDs, but it can still be done reasonably easily like so:.

    $es
    So, the problem with switches, is that while you can now more easily access them, you still have to name them, and set them where needed... what if you didn't have to? This shorthand is here to solve that problem too! Well, sometimes. Usually not. But sometimes.

    $es, standing for "event seen", is a quick way to check if the player has already interacted with another event on the same map.will be true if the event with ID 42 has already been interacted with - so if that's all you need to know, you no longer have to use a switch just for that. And since it's set tofor a given event when it ends, it also doubles as a quick way to check if this is the first time the player is interacting with the current event.

    Note: this feature is disabled by default, since it requires a change to the engine; you can enable it in plugin parameters.

    $inp
    The interpreter - it's needed to do all sort of things, and while it can be accessed withinside of an event, it can be a bit annoying to get it elsewhere. But fear not, for now you have a very simple shorthand to get the currently active non-parallel interpreter: simply type!

    $windows
    And this one here is an object with a bunch of different functions to help you with retrieving windows. Details can be found in the help file, but for an example of what it can do for you, you can now open the gold window anywhere withinstead of. Or useto get a list of all windows in the current scene, which is a really nice thing to have when trying to debug them from console.

    Terms
    Now, you might be asking yourself, what will all those cool features cost you? Well, it comes to a grand total of... $0. You really can't beat a price like that! It's also available under the MIT Licence - you can use it in your non-commercial games, in your commercial games, in your own plugins, or sell T-Shirts with the code printed out on them. Credit is appreciated but not required.


    I'm also very open to the idea of expanding this plugin with even more QoL features, so if you have any suggestions please feel free to send them my way.


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

    本帖子中包含更多资源

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

    x

    帖子地址: 

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

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-10-22 02:21 , Processed in 0.116000 second(s), 56 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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