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

[转载发布] Hammy - MKXP-Z Screenshot

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    开心
    2026-7-12 04:10
  • 签到天数: 209 天

    连续签到: 2 天

    [LV.7]常住居民III

    9015

    主题

    864

    回帖

    6万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

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

    灌水之王

    发表于 昨天 15:42 | 显示全部楼层 |阅读模式
    Hammy - MKXP-Z Screenshot v1.01
    Configurable screenshot capture with timestamped filenames for mkxp-z




    Introduction

    This script provides a screenshot capture system for RPG Maker VX Ace running on mkxp-z. It allows players to capture the current game screen and save it as a timestamped image file.

    AI Disclaimer: Generative AI was used to refine the documentation and presentation of this script, as I am not a native English speaker. Additionally, AI was used for naming conventions in some places and for general beautification of the script.

    mkxp-z Disclaimer: This script is made exclusively for RPG Maker VX Ace running on mkxp-z (Ruby 3.1). It will not run on standard RPG Maker VX Ace without mkxp-z. See the mkxp-z section below for more information.



    Features

    Core Screenshot Features

    • One-press screenshot capture with Graphics.screenshot
    • Configurable keyboard and optional controller triggers
    • Automatic screenshot folder creation on first use
    • Timestamped filenames with collision-safe counter suffixes
    • European and American timestamp format support
    • Optional sound effect playback after capture
    • Configurable filename template and image file format



    mkxp-z

    mkxp-z is an open-source, cross-platform player for RPG Maker XP, VX, and VX Ace games. It is a heavily modified fork of mkxp originally built to run games based on Pokémon Essentials, which depends heavily on Windows APIs. It is best described as MKXP but supercharged - capable of running all but the most demanding RGSS projects with a bit of porting work.

    mkxp-z supports Windows, Linux (x86, ARM, and POWER), and both Intel and Apple Silicon versions of macOS. Because it ships with Ruby 3.1 rather than the original Ruby 1.9.2 bundled with RPG Maker VX Ace, scripts written for mkxp-z can take advantage of modern Ruby syntax and standard library features.

    This script requires mkxp-z and will not run on default RPG Maker VX Ace.



    Configuration

    Edit the constants in the Hammy::MkxpzScreenshot module to configure the keyboard and controller triggers, file locations, timestamp formats, and sound effect options.

    Keyboard Key Settings
    Configure the keyboard key used to capture a screenshot.

    SCREENSHOT_KEY
    Keyboard key used as the screenshot trigger.

    Bare RGSS3 symbols are routed through Input.trigger?. Tagged arrays can force routing with [:rgss, :SYM] or [:sdl, :SYM]. SDL routing and bare VK integers are mkxp-z only and use Input.triggerex?.

    - Valid values: RGSS symbol, tagged array, or VK integer
    - Default::F8

    Example
                    Ruby:       
    1. SCREENSHOT_KEY = :F8
    复制代码


    Controller Button Settings (mkxp-z only)
    Configure the controller button used to capture a screenshot on mkxp-z.

    SCREENSHOT_BUTTON
    Controller button used as the screenshot trigger.

    Only needed when SCREENSHOT_KEY has no default controller binding, such as an SDL-only key or a raw VK integer. Set to nil to disable the separate controller trigger.

    - Valid values: Any controller button symbol, or nil
    - Default:nil

    Example
                    Ruby:       
    1. SCREENSHOT_BUTTON = nil
    复制代码


    File Settings
    Configure where screenshots are saved and which image format is used.

    FOLDER_NAME
    Folder used for saved screenshots.

    Created automatically during startup if it does not already exist.

    - Valid values: Folder name or relative folder path
    - Default:"Screenshots"

    Example
                    Ruby:       
    1. FOLDER_NAME = "Screenshots"
    复制代码


    BASE_FILENAME
    Base name used for generated screenshot filenames.

    Combined with timestamp and collision counter by FILENAME_TEMPLATE.

    - Valid values: String
    - Default:"screenshot"

    Example
                    Ruby:       
    1. BASE_FILENAME = "screenshot"
    复制代码


    FILE_EXTENSION
    Image file extension used by Graphics.screenshot.

    mkxp-z automatically selects the encoder based on this extension.

    - Valid values: "png", "jpg", or "bmp"
    - Default:"png"

    Example
                    Ruby:       
    1. FILE_EXTENSION = "png"
    复制代码


    Timestamp & Filename Format
    Configure the timestamp text and final screenshot filename structure.

    EU_TIMESTAMP_FORMAT
    Timestamp format used for European date order.

    Uses standard Ruby Time#strftime directives.

    - Valid values: String
    - Default:"%d-%m-%Y_%H-%M-%S"

    Example
                    Ruby:       
    1. EU_TIMESTAMP_FORMAT = "%d-%m-%Y_%H-%M-%S"
    复制代码


    US_TIMESTAMP_FORMAT
    Timestamp format used for American date order.

    Uses standard Ruby Time#strftime directives.

    - Valid values: String
    - Default:"%Y-%m-%d_%H-%M-%S"

    Example
                    Ruby:       
    1. US_TIMESTAMP_FORMAT = "%Y-%m-%d_%H-%M-%S"
    复制代码


    FILENAME_TEMPLATE
    Final path template for saved screenshots.

    Available placeholders are %{dir}, %{base}, %{time}, %{counter}, and %{ext}. The counter placeholder is empty unless a filename collision is detected.

    - Valid values: String using the placeholders above
    - Default:"%{dir}/%{base}_%{time}%{counter}.%{ext}"

    Example
                    Ruby:       
    1. FILENAME_TEMPLATE = "%{dir}/%{base}_%{time}%{counter}.%{ext}"
    复制代码


    Date Format Fallback
    Configure the fallback date order used when no runtime setting exists.

    FORCE_EUROPEAN_FORMAT
    Controls the fallback timestamp date order.

    Only used when $game_system.european_format is unavailable.

    - Valid values:true: EU_TIMESTAMP_FORMAT, false: US_TIMESTAMP_FORMAT
    - Default:false

    Example
                    Ruby:       
    1. FORCE_EUROPEAN_FORMAT = false
    复制代码


    Sound Effect Settings
    Configure the sound effect played after a screenshot is captured.

    PLAY_SOUND
    Enables or disables screenshot sound playback.
    - Valid values: true / false
    - Default:true

    Example
                    Ruby:       
    1. PLAY_SOUND = true
    复制代码


    SOUND_NAME
    SE filename from the Audio/SE folder.

    Do not include the file extension.

    - Valid values: String
    - Default:"Decision1"

    Example
                    Ruby:       
    1. SOUND_NAME = "Decision1"
    复制代码


    SOUND_VOLUME
    Playback volume for the screenshot sound effect.
    - Valid values: 0 to 100
    - Default:80

    Example
                    Ruby:       
    1. SOUND_VOLUME = 80
    复制代码


    SOUND_PITCH
    Playback pitch for the screenshot sound effect.
    - Valid values: 50 to 150
    - Default:100

    Example
                    Ruby:       
    1. SOUND_PITCH = 100
    复制代码




    Usage

    This section explains when screenshots are captured and how saved files are named.

    Screenshot Capture
    The screenshot check runs once per frame from Scene_Base after the standard scene update. When the configured trigger fires, the current game screen is captured via Graphics.screenshot and written to disk immediately.


    • The default keyboard trigger is :F8.
    • A separate controller trigger can be enabled for SDL controller buttons.
    • Do not add a separate controller trigger for RGSS action buttons that already map to controller input through Input.trigger?.

    File Output
    The screenshot folder is created during startup before gameplay begins. Each capture uses the configured filename template to combine the output folder, base filename, timestamp, collision counter, and file extension.


    • Existing files are never overwritten; a numeric counter suffix is added when the generated filename is already taken.
    • The image encoder is selected by the configured file extension.
    • An optional sound effect can be played after a successful capture.

    Date Format Behavior
    If $game_system.european_format is available, its runtime value controls which timestamp format is used. Otherwise, the script falls back to the configured default format.


    • The optional Date Format Addon provides $game_system.european_format.
    • Both timestamp layouts are configured separately in the settings below.



    Installation


    • Copy the script to an open slot below ▼ Materials but above ▼ Main
    • If using Hammy - MKXP-Z Input Constants, place this script BELOW it
    • If using Hammy - Yanfly System Options - Date Format Addon, place this script BELOW it

    Note: Hammy - Yanfly System Options - Date Format Addon has not yet been released. It is currently in development and will be made available in a future update.



    Compatibility

    This script is made strictly for RPG Maker VX Ace running on mkxp-z (Ruby 3.1). It will not run on default RPG Maker VX Ace without mkxp-z.



    License

    MIT License - Free for commercial and non-commercial use.



    Credits

    No credits are required.



    Why VX Ace?

    You might wonder why I'm still making scripts for VX Ace instead of MV/MZ. The answer is simple: Ruby is pure beauty, while JavaScript is a terrible language. Ruby's elegant syntax, intuitive design, and expressive power make scripting a joy. JavaScript, on the other hand, is a chaotic mess of inconsistencies and quirks that I simply despise.

    I work with RPG Maker VX Ace for my own game project, and I share the scripts I create with the community. If you're still using VX Ace, you're in good company!



    Download

    Script:Download from GitHub
    Demo:Download from GitHub





    本贴来自国际rpgmaker官方论坛作者:buddysievers处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/hammy-mkxp-z-screenshot.183694/
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-8-4 17:32 , Processed in 0.117492 second(s), 54 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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