1) 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:
DMCancelSelfSwitchEnd true
> true / false
> change 22 to region id you limit the event to be placed
> 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
> change [6,12] 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 = [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. }