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

[转载发布] EST - Build And Decor EX

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

    连续签到: 2 天

    [LV.7]常住居民III

    7959

    主题

    864

    回帖

    3万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

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

    灌水之王

    发表于 4 天前 | 显示全部楼层 |阅读模式
    ■ Information      ╒══════════════════════════╛
    EST - Build And Decor EX
    Version: 1.6
    By Estriole
    File name: EST_Build_And_Decor_EX.js

    ■ Introduction     ╒══════════════════════════╛
        Conversion of my EST - BUILD AND DECOR SERIES script from ACE.
    Mainly this script make you can have 'decoration' item that you
    can place to customize your map. if you're using my EST - EVENT SIZE AND TRIGGER
    plugin... you can also make the decoration as building. this plugin also include
    EST - DECOR MOVEMENT conversion from ACE instead making it separate plugin.
    thus this plugin named: EST - Build And Decor EX

    ■ Features         ╒══════════════════════════╛
    - bind 'decoration'/'building' to item.
       it's actually event in template map.
    - you can separate decoration by category. ex: building, wall, furniture, etc
    - you can move the decoration freely using parallel event page and selfswitch

    ■ Changelog       ╒══════════════════════════╛

    old changelog in spoiler

    Spoilerv1.0 2015.11.10           Initial Release   v1.1 2015.11.12      add documentation on how to use this.isAnyEventOnSelf()
                               also minor bugfix on that method to recognize Through event.

       v1.2 2015.11.23      add mouse detection for decor move:
                               Left mouse click => set event movement to that coordinate
                               Right mouse click => cancel decor movement. set selfswitch cancel
                               (so you can create event page to delete the event and give item)

       v1.3 2015.12.08      > add method to check event in xy have certain name or not.
                            > add method to return list of all event in current map that have certain name
       v1.4 2015.12.14      > fix when canceling placing decor will open up menu
                               > fix incompatibility with EST - EVENT SIZE AND TRIGGER which not
                               erasing master event size
                               > add plugin parameter to set delay for decor movement (15 is recommended)
                               > NEW DECOR MOVEMENT which more fluid with mouse. but also support touch screen.
                               which also support placing item from common event (see demo - 'table' item is reworked)
                               but if you prefer old decor movement just set in the plugin parameter.
    v1.5 2015.12.18      > NEW DECOR MOVEMENT now also check moved event SIZE...
                               so if the moved event size is placed in 'unplaceable' coordinate...
                               we won't be able to place the decoration.
                               to set size to moved event... add the comment tag in the parallel process
                               containing the decor movement command.
                               > add Region Limit to decor movement... now you can make Pokemon Center
                               only movable to region 100.
                               > when decoration/building cannot be placed... it will make it semi transparent.
                               so you have some visual help on where you can place your building.
                               i once want to color the decoration red... but chrome doesn't support it.
                               > fix bug in decor move plugin command.



         v1.6 2015.12.27      > Removed Plugin Parameter... now it always use neo movement...
                  also remove keyboard support since computer will have mouse and phone have touch screen.
                  change the behaviour... right click press (move event to mouse pos)...
                  right click release (place event in location)... so it should be more touch screen
                  friendly now.
                  > rework how the parameter for decor movement passed... old method still work
                  but there's new method that added...
                  > ability to set mapLimit for decor event. so you can only place it in certain map
                  > ability to ignore map passage... so now we can build shipyard at the shallow water
                  read 5.b in how to use...


    ■ Plugin Download ╒══════════════════════════╛

    (update the dead dropbox link)
    Dropbox



                                            www.dropbox.com                               



    warning: this plugin created using earlier MV version. this might not work in updated MV.
    you can ask other scripter to create compatibility patch since i already retired.
    i only update the link for people who want to make the patch.

    Demo
    Dropbox



                                            www.dropbox.com                               



    (update the dead dropbox link)
    warning: this plugin created using earlier MV version. this might not work in updated MV.
    you can ask other scripter to create compatibility patch since i already retired.
    i only update the link for people who want to make the patch.


    ■ ScreenShot ╒══════════════════════════╛
    thanks for makeratore for creating this gif's to show decor movement at work.





    ■ How to use       ╒══════════════════════════╛

    Open the spoiler Below (it's quite long)

    Spoiler1) Make Decoration Item
    create an item in database... give it notetags:

    mandatory: <decor_map: mapId> <decor_id: eventId> <decor_type: type>
    optional:

    <decor_xmod: x> <decor_xmod: y> change mapId => your template map id... you can have more than 1 template map
    change eventId => event in in your template map you want to place as your decoration
    change type => any string to mark the decoration type.
    change x => to any number of tiles you want the new decoration to shift it's placement.
                  positive value = right, negative value = left
    change y => to any number of tiles you want the new decoration to shift it's placement.
                  positive value = down, negative value = up


    <decor_xmod: x> <decor_xmod: y> will be ignored if in your decor selection call you add posfix value
    (it will be placed in posfix coordinate instead)

    example notetags:

    <decor_map: 8> <decor_id: 12> <decor_type: Building> <decor_xmod: 1> <decor_xmod: -1> the item is listed in decor selection for "Building"
    when that item is selected in decor selection...
    it will grab event from map 8 event id 12
    and place it in the position of event that called it
    but will shift it x by 1 and y by -1

    2) Giving Decoration Item to player...
    just give the item using event command / monster drop / anything

    3) Placing the Decoration using Decor Selection
    plugin command

       DECOR_SELECT decortype delete? posfix or script Call

         this.decorSelect(decortype,delete?,posfix) mandatory:
    decortype => will only list item with the decortype in script call this require
                   you to pass a string... so wrap it in "". in plugin command
                   it's not necessary. since all become string in plugin command.

    optional:
    delete? => delete the calling event / not. true = delete, false = don't delete.
                if you don't fill it... it will defaulted to true
    posfix => array containing [x,y] coordinate of where the new event placed.
                if you using this the <decor_xmod: x> and <decor_ymod: y>
               will be ignored... since the event will be FIXED to placed in that coordinate

    you can choose to not using the optional parameter. just don't fill anything and it works

    Some example:

    Plugin command:     decor_select building Script Call   :     this.decorSelect("building");
    yes the DECOR_SELECT is not case sensitive... i make it caps above so people read it better.
    will list all item which have <decor_type: building> (not case sensitive. so BuIlDiNG works fine)


    Plugin command:     decor_select building false Script Call   :     this.decorSelect("building", false); will list all item which belong to building type. also will NOT delete the calling event

    Plugin command:     decor_select building false [10,3] Script Call   :     this.decorSelect("building",false,[10,3]); will list all item which belong to building type. also will NOT delete the calling event
    and will PLACED the event at x = 10, y = 3 coordinate

    4) Removing Decoration
    plugin command:

         REMOVE_DECOR mastermap masteritem xmod ymod or script call:

        this.rmvDecoration(mastermap, masteritem, xmod, ymod) ALL is optional:
    fill this parameter only if you want the deleted decoration REPLACED by other event.
    for example replace the event to event that call decor_selection again.

    mastermap => map id for event which will replace deleted event
    masteritem => event id for event which will replace deleted event
    xmod => when placing replacement event it will shift x tiles from deleted event position
              positive value = right, negative value = left
    ymod => when placing replacement event it will shift y tiles from deleted event position

    it's optional so you don't need to fill it

    examples:

    Plugin command:     remove_decor Script Call   :     this.rmvDecoration(); will delete the decoration and that's it.

    Plugin command:     remove_decor 8 3 Script Call   :     this.rmvDecoration(8,3); will delete the decoration and replace it with event from map 8 event 3

    Plugin command:     remove_decor 8 3 6 7 Script Call   :     this.rmvDecoration(8,3,6,-7); will delete the decoration and replace it with event from map 8 event 3
    and shift x by 6 tiles to right and shift y by 7 tiles above

    5) Moving Decoration
    make a page in existing decoration event. make it activate when selfSwitch C activated
    (you can change the selfSwitch in plugin parameter. but C is the default value)

    change it to Paralles Process. and make sure it's same as character priority
    you can add the plugin command / script call in the event page.

    plugin command FORMAT:

        DECOR_MOVE selfSwitchEnd cancelSelfSwitchEnd regionLimit or script call:

        this.decor_move(selfSwitchEnd, cancelSelfSwitchEnd, regionLimit); ALL parameter is optional

    selfSwitchEnd => the selfswitch (default 'C') value when the decor move ENDED.
                      true / false.

                      it depend on how you set the event page...
                      > if decor movement placed in an event page that have selfSwitch C = ON as condition
                      and your "other" page is in page without condition. so you want selfSwitch C => OFF
                      at end of decor movement... use false.
                      > if decor movement placed in an event page that have no condition and the "other"
                      event page is the one with condition selfSwitch C = ON. so you want selfSwitch C => ON
                      at end of decor movement... use true.
              > after adding decor auto move feature... i decide this become false if you don't
              specify it (turning off the selfswitch)

    cancelSelfSwitchEnd => selfswitch (default 'B') value when the decor move CANCELED
                      true / false.
              > by default it will become true if not entered...
                      the decor move can be cancelled using escape keyboard button, or right click mouse button.

    regionLimit        => limit the region where you can PLACE the decoration / building to certain region only
                      useful to make building that can be placed in 'shallow water only' such as shipyard, etc
                      or limit where you can place your building...

    example:

    Plugin command:     decor_move false true 100 Script Call   :     this.decor_move(false, true, 100);  will move the decoration... when the decor movement end... it will flip selfSwitch you set in parameter to false (OFF).

      if decor move canceled. it will flip selfswitch cancel (default 'B') to true.

      and decoration only able to be placed on region 100

    Plugin command:     decor_move true Script Call   :     this.decor_move(true);  will move the decoration... when the decor movement end... it will flip selfSwitch you set in parameter to true (ON).

      if decor move canceled. it will flip selfswitch cancel (default 'B') to true.

    Plugin command:     decor_move Script Call   :     this.decor_move();  if you didn't fill true / false like above... it will defaulted selfswitch C to false
      and selfswitch B to true.


    5.a) YOU CAN make the event automatically enter movement mode (selfswitch C ON) by calling this
    BEFORE you call decor selection
    Plugin Command: DECOR_START_AUTO_MOVE
    Script Call   : $gameSystem._decorStartMove = true;

    5.
      THIS SCRIPT CALL / PLUGIN CALL can be called BEFORE decor_move plugin command to
    modify the decor move behaviour. it will override the setting you passed on decor_move:
    Plugin Call:

    DMSelfSwitchEnd false    > true / false
                    Code:       
    1. DMCancelSelfSwitchEnd true
    复制代码

        > true / false
                    Code:       
    1. DMRegionLimit 22
    复制代码

        > change 22 to region id you limit the event to be placed
                    Code:       
    1. DMIgnoreMapPass true
    复制代码

        > true / false
          if true it will ignore map passage and allow you to place event on wall (unpassable terain)
          now you can build a shipyard and place it at shallow water
                    Code:       
    1. DMMapLimit [6,12]
    复制代码

        > change [6,12] to array of map id you allow the event to be placed.

    Script Call:
                    Code:       
    1. $gameTemp._DMSelfSwitchEnd = false;
    复制代码

        > true / false
                    Code:       
    1. $gameTemp._DMCancelSelfSwitchEnd = true;
    复制代码

        > true / false
                    Code:       
    1. $gameTemp._DMRegionLimit = 22;
    复制代码

        > change 22 to region id you limit the event to be placed
                    Code:       
    1. $gameTemp._DMIgnoreMapPass = true;
    复制代码

        > true / false
          if true it will ignore map passage and allow you to place event on wall (unpassable terain)
          now you can build a shipyard and place it at shallow water
                    Code:       
    1. $gameTemp._DMMapLimit = [6,12];
    复制代码

        > change [6,12] to array of map id you allow the event to be placed.
      6) HAVING Event on Top of other event... and you don't want event below it to activate.
    example case: you place a table. then place a vase on top of it. you want vase to activate while table is not.
    in table event page use conditional branch: script:

    this.isAnyEventOnSelf() if true do nothing...
    if false (means there's nothing on top of it): place your event command if there's nothing on top of it.
    example you can remove the table, etc. which you don't want to trigger if there's vase on top of table.

    7) some script call to use in conditional branch:

    $gameMap.isXyHasEventName(name, x, y); will check x y coordinate. does it have event with that name.
    if found it will return true. if not found it will return false
    name could be string or regExp (if string it will be case sensitive)
         example:

         $gameMap.isXyHasEventName("Red Roof Building", 2, 2);     will return true if in coordinate 2,2 you have event named "Red Roof Building"
         case sensitive !!!

         $gameMap.isXyHasEventName(/Red Roof Building/i, 2, 2);     will return true if in coordinate 2,2 you have event named "Red Roof Building"
         not case sensitive. meaning that "ReD RoOF BuIlDiNg" will also detected

         $gameMap.isXyHasEventName(/Red/i, 2, 2);     will return true if in coordinate 2,2 you have event named that contain Red inside the name
         so something like "red roof building" "red wall building" is detected.
         not case sensitive because of /i. meaning that "ReD" will also detected.

    8) another script call to use...

    $gameMap.eventWithNameList(name) will list all events in current map which match the name.
    if found it will return array of Game_Event. if not found it will return false
    name could be string or regExp (if string it will be case sensitive)
        example:

         $gameMap.eventWithNameList("Red Roof Building")     will return array of events which have name "Red Rood Building"
         case sensitive !!!

         $gameMap.eventWithNameList(/Red Roof Building/i, 2, 2);     will return array of events that named "Red Roof Building"
         not case sensitive. meaning that "ReD RoOF BuIlDiNg" will also detected

         $gameMap.eventWithNameList(/Red/i, 2, 2);     will return array of events that contain Red inside the name
         so something like "red roof building" "red wall building" is detected.
         not case sensitive because of /i. meaning that "ReD" will also detected.

    XXX) FOR OTHER SCRIPTER that want to make compatibility patch for this plugin.
    check EST.Build_And_Decor exist or not.
    ex:

    if(typeof EST !== 'undefined' && EST.Build_And_Decor) {  place your code here. }



    ■ Dependencies     ╒══════════════════════════╛
    mandatory:
    EST - SAVE MAP EVENT
    EST - CLONE TRANSFORM DELETE EVENT
    optional:
    EST - EVENT SIZE AND TRIGGER
    EST - GRAPHIC SHIFT
    EST - REGIONMAPLOADER
    other coder optional:

    DMV - MapButton (Requires MVCommon and DMV CORE)

    TDDP - MouseSystemEx

    ■ Compatibility    ╒══════════════════════════╛
    I'm new in JS... and MV is new engine... so i cannot say for sure.
    but it should be compatible with most things.

    ■ Parameters       ╒══════════════════════════╛

      > VarIdForSelection
            Variable ID to be used to item selection
            default 7
      > DecorMoveSwitchId
            Switch ID to mark decor is being moved. also to stop player movement, open save, open menu
            default 7
      > DecorMoveSelfSwitch
            The self switch to flip when finishing decor movement
            A, B, C, or D
            default C
      > DecorMoveCancelSelfSwitch
            The self switch to flip when canceling decor movement
            (so you can give the item back then delete the event)
             A, B, C, or D
            default B

      > DecorMoveMovementDelay
            delay frame between decor movement
            default 15

      > UseNewDecorMovement
            use new decor movement which utilize mouse more fluid
           (true / false)
           default true


    ■ License          ╒══════════════════════════╛
    Free to use in all project (except the one containing pornography)
    as long as i credited (ESTRIOLE).

    ■ Support          ╒══════════════════════════╛
    While I'm flattered and I'm glad that people have been sharing and
    asking support for scripts in other RPG Maker communities, I would
    like to ask that you please avoid posting my scripts outside of where
    I frequent because it would make finding support and fixing bugs
    difficult for both of you and me.

    If you're ever looking for support, I can be reached at the following:
    [ http://forums.rpgmakerweb.com/ ]
    pm me : estriole

    ■ Author's Notes   ╒══════════════════════════╛
    This is FINAL part of the EST - DECOR AND BUILD SERIES.

    EST - SAVE MAP EVENTS

    EST - CLONE TRANSFORM DELETE EVENT

    EST - EVENT GRAPHIC SHIFT

    EST - EVENT SIZE AND TRIGGER

    EST - BUILD AND DECOR EX

    EST - REGIONMAPLOADER


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

    本帖子中包含更多资源

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

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

    使用道具 举报

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

    本版积分规则

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

    幸运抽奖

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

    立即查看

    聊天机器人
    Loading...

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

    GMT+8, 2026-8-1 05:44 , Processed in 0.131382 second(s), 56 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

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