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

[转载发布] Automatic Updating Switches and Variables XP

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    开心
    3 天前
  • 签到天数: 221 天

    连续签到: 1 天

    [LV.7]常住居民III

    9100

    主题

    890

    回帖

    7万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

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

    灌水之王

    发表于 2026-7-26 12:52:22 | 显示全部楼层 |阅读模式
    Automatic Updating Switches and Variables
    By SailCat
    ​


    Introduction
    This script turns switches and variables into auto-updating by binding an expression to it.

    Features
    XP, unlike VX or VA, allows only switches, variables and self switches to be used for events. So it is difficult to set an NPC to be available when, say, Alexus is present, or a key item is held in inventory. The two conditions are available in later maker versions.
    This script makes a turnaround by setting a switch (variable as well) as always ready to represent a certain expression.
    If you want a switch to indicate whether Alexus is present, write its name as "=\P.i?(\N[1])" (remove quotation mark).
    If you want a switch to indicate whether a key is held, write its name as "=\I(29)>0"
    The first char, =, tells the plugin that the target switch is an auto-updating one. So instead of normally turning it on or off, it will instead evaluate the expression after it.

    You can far do more than what VX/VA can achieve.
    To test if Alexus is wielding mithril sword, name a switch as "=\N[1].w?(4)"
    To set an enemy to act in a way when party level is BELOW a certain value: name a switch as "=\L<15", and then set this switch as an action trigger, since default action triggers only allows party level ABOVE a certain value.

    To test whether you have collected enough items from anywhere (drops, NPCs, treasures).
    You had to:
    1. Set a common event to be parallel upon some switch
    2. Let the event judge the item number every frame, until you fulfill it
    3. Do the processes, and turn off the switch(to prevent the process from triggering a second time)
    Now with this script:
    1. Set a common event to be automatic upon some switch, and name the switch such as "=\I(x)>y && !s[z]"
    2. Do the processes, and turn on switch z(to prevent the process from triggering a second time)
    This saves the engine from updating an extra parallel common event every frame.

    To make an event like granting you Excalibur II when you reach it in less than 12 hours.
    You had to:
    1. Set the target event to be automatic in the first page, and use a second and third(empty) page.
    2. In the first page, use operate variables to load elapsed time, and turn Self Switch A on (to stop automatic processing)
    3. Set the second page to be on self switch A, and grant the reward on this page.
    4. Set the third page to be empty on "self switch A" and "variable > 43200" to hide the reward when time expires.
    Now with the script:
    1. Name a variable as "=-\F"
    2. Set the target event on "variable > -43200", and give the reward on the first page.
    3. No extra processing or pages required.

    How to Use
    Refer to the comment before plugin script.

    Terms and Credits
    Feel free to use in any kind of games.
    Please credit me by leaving the second line of the script.
    Redistributions are OK. Secondary development is not allowed.

                    Ruby:       



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

    帖子地址: 

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

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-10-20 01:14 , Processed in 0.090528 second(s), 54 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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