じ☆ve冰风 发表于 2026-7-28 20:11:51

EST - Build And Decor EX

■ 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.


https://dl.dropboxusercontent.com/u/135990643/RPGMakerMV/Screenshot/EST_BUILD_AND_DECOR_EX_by_makeratore.gif


■ 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 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 Script Call   :   this.decorSelect("building",false,); 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.
data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7THIS 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:       
DMCancelSelfSwitchEnd true

    > true / false
                Code:       
DMRegionLimit 22

    > change 22 to region id you limit the event to be placed
                Code:       
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:       
DMMapLimit

    > change to array of map id you allow the event to be placed.

Script Call:
                Code:       
$gameTemp._DMSelfSwitchEnd = false;

    > true / false
                Code:       
$gameTemp._DMCancelSelfSwitchEnd = true;

    > true / false
                Code:       
$gameTemp._DMRegionLimit = 22;

    > change 22 to region id you limit the event to be placed
                Code:       
$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:       
$gameTemp._DMMapLimit = ;

    > change 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/
页: [1]
查看完整版本: EST - Build And Decor EX