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

[转载发布] Random Map Events

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

    连续签到: 2 天

    [LV.7]常住居民III

    9072

    主题

    864

    回帖

    6万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

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

    灌水之王

    发表于 2026-7-27 09:40:07 | 显示全部楼层 |阅读模式
    Introduction/Features


            This plugin allows for randomly allocating events on the map manually via a plugin call or automatically when transferring. An event will be placed in one of the regions you specify, or in the same place if desired. You can designate a chance for the event to spawn, and have it spawn more than once.


            A new map will generated with these events. The new map will be stored into the save file, allowing you to safely load the save file with the generated map intact. You can also choose to change the tileset.


            This plugin is useful anytime you want to automate variation in where or if an event spawns, and how many times. It can allow you to quickly add variation to a map so it is different every time. I had dungeon crawler games in mind when I wrote this plugin - you can create dungeon floors with randomly placed enemies, treasure, traps, secrets and entrance and exit. Through the use of a random number choose function provided by this plugin and a little javascript, you can also easily randomly choose maps and tilesets.


            P.S. This is not the dungeon generator I am still working on, but it will either use code from this plugin or require this plugin. The event allocation idea is about the same.


    * ============================================================================
    * How To Use
    * ============================================================================
    * ============================================================================
    * Plugin Commands
    * ============================================================================
    * AllocateEvents x y
    *  This command will randomly allocate events and transfer the player to the
    *  new map.
    *  x - Optional. Fade Type. Use -1 to use default.
    *  y - Optional. Tileset id of new generated map.
    *  
    *  In order for events to be placed on the new map, they MUST have the
    *  notetags <RandomRegion: x> or <AllocateSame>.
    *  Make sure to read below in "Event Notetags" to learn how to use these.
    * ============================================================================
    * Event Notetags
    * ============================================================================
    * <RandomRegion: x> will allow this event to be randomly allocated in the
    * specified regions. This is required for events to be spawned in the
    * generated map, unless you use <AllocateSame> below.
    * Example:
    * <RandomRegion: 1-4 7 10> will have the event spawn in regions 1-4, 7 or 10.
    * If you want it to be able to spawn in any region, enter 1-255 (or whatever
    * the max is in your case).
    *
    * <AllocateSame> will cause this event to be put in the same exact spot it was
    * before the allocation process began.
    *
    * <AllocateStart> will cause the player to spawn at the point this event is
    * placed at. Use this tag for only one event. If this event does not exist or
    * is not allocated, the player will spawn on the same tile they were at when
    * the map began allocating events.
    *
    * <AllocatePriority: x> will determine the order that event is allocated. Lower
    * numbers get allocated first. Events without a priority get allocated last.
    * I recommend using the lowest value for the AllocateStart event.
    *
    * <AllocateMin: x> will attempt to the spawn the event a minimum of x times.
    * Do not use if you want an event to only spawn 1 time, because that is the
    * default.
    * Do not use with <AllocateStart>.
    *
    * <AllocateMax: x> will attempt to the spawn the event a maximum of x times.
    * Use this only when you are also setting a minimum. Must be greater than the
    * minimum. Do not use with <AllocateStart>
    *
    * <AllocateChance: x> will give the event x chance to spawn. This is tested
    * for every attempt at placing the event.
    * Example:
    * <AllocateChance: 55> will give the event 55% chance to spawn.
    *
    * <AllocateTag: x> This tag is used to label events for special conditions.
    * At the moment, it is only useful for the notetag below.
    *
    * <AllocateMinimumDistance: x y> will require that the event be spawned away
    * at least y tiles from events tagged with x (from <AllocateTag: x>).
    * If no tiles fit this criteria, then the event may not be spawned.
    * Because of this, it is a good idea to utilize allocation priority to
    * ensure that events that have a conditional distance placement are allocated
    * after events they must be placed away from.
    * You can use more than one distance condition.
    * Example:
    * <AllocateMinimumDistance: Start 4 End 9> will require that this event
    * can only be placed 4 tiles or more from events tagged with Start and
    * 9 tiles or more from events tagged with End.
    *
    * <RemoveSelectedRegion> will prevent the region this event is placed in from
    * having any other events placed in it.
    *
    * <RemoveRegion: x> will prevent the regions specified from having any
    * other events placed in it, after this event is placed.
    * Example:
    * <RemoveRegion: 1-4 7 10> will prevent regions 1-4, 7 and 10.
    *
    * ============================================================================
    * Map Notetags
    * ============================================================================
    * <AllocateEvents> will automatically allocate events on map load.
    *
    * <AllocateWallAutotileRegion: x> This will set all wall autotiles to be
    * considered region x, besides tiles that you have manually set a region to.
    *
    * <AllocateRoofAutotileRegion: x> This will set all roof autotiles to be
    * considered region x, besides tiles that you have manually set a region to.
    *
    * <RandomTileset: x> when a new map is generated from this map, it will select
    * one of these tileset ids for the new map.
    * Example:
    * <RandomTileset: 1-4 7 10> will select from ids 1-4, 7 or 10.
    * ============================================================================
    * Event Commands
    * ============================================================================
    * Events will the retain the same event id with one exception. Any time that
    * the same event is copied to the map more than once, the extra clones have
    * new ids. This means that the first copy will retain the same id as on the
    * base map, but the other copies will not. This only applies when using the
    * <AllocateMin: x> notetag, otherwise an event will never have extra clones.
    * ============================================================================
    * Functions
    * ============================================================================
    * Functions you may find useful.
    *
    * new DXMapRandomElements(args) - Equivalent of the plugin command
    * AllocateEvents. Useful if you want to use a tileset id that you generated.
    * Example:
    * new DXMapRandomElements("0 5") - will have 0 as the fade type and 5 as the
    * tileset id.
    *
    * DreamX.RandomMap.RandomNumber(string) - Will return a random number from the
    * string given. Useful for getting a random tileset id, among other things.
    * Example:
    * DreamX.RandomMap.RandomNumber("1-4 7 10") will return numbers 1-4, 7 or 10.
    * ============================================================================
    * Future Updates
    * ============================================================================
    * Be able to use events from other maps.
    * Be able to choose the position on a wall to place an event.
    * Be able to auto assign a region to any tile id.
    * Be able to set limits for a region based on event tag. For example, you
    * could set a limit where only 2 events with the tag Enemy can be placed in it.
    * ============================================================================
    * Terms Of Use
    * ============================================================================
    * Free to use and modify for commercial and noncommercial games, with credit.
    * Credit Yanfly as I used some of the same code/concepts from their
    * Item Core plugin.
    * ============================================================================
    * Credits
    * ============================================================================
    * DreamX
    * Thanks to Yanfly for code/concepts from their Item Core plugin.


    Script


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

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-8-22 07:53 , Processed in 0.137558 second(s), 52 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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