#author("2024-02-28T19:36:47+09:00","default:admin","admin")
#author("2024-03-08T16:53:51+09:00","default:admin","admin")
*Creation Tips [#n05590dd]
This page contains creation tips to achieve a variety of game systems by using combinations of Bakin's features.  The sample projects "Orb Stories" and "Dungeon RPG Sample" that appear below can be found in Bakin's Top Menu > Game Gallery.

#Contents
----
*Make Player Invisible [#b473b26f]
In the "Dungeon RPG Sample," to hide the player when in first person, specify "Stamp with no graphic setting" in Database > Casts > Graphic for Moving.

-In the "Dungeon RPG Sample," look at "Ken" in Database > Casts.  If you click on the moving graphic, you will see that it is assigned the 2D stamp DungeonPlayer_2D.

-Next, go to Resources > 2D Stamps and look at DungeonPlayer_2D, and you will see that the graphics section should be unspecified.  The subgraphic also specifies nothing for the graphic, only a local light. This is specified to illuminate the front as if the player has a light.

-This stamp with no graphic specification and only a subgraphic local light setting is also used in the last boss fight on the B1 map in the "Dungeon RPG Sample".
Place this stamp on the map as an event and turn off the subgraphic in the "Change Display State of Event Subgraphic" panel before defeating the boss.
Then, after the boss is defeated, the subgraphics are turned on and the local light is enabled to achieve the effect of changing the brightness of the room.

----
*Grid Movement [#p9aa4033]
Grid unit movement (movement in units of terrain squares) can be achieved by using a common event. 

-Please refer to the "Grid Move" event on the Common Events palette of the "Dungeon RPG Sample".  You can also export this event, create a custom event in your project's common event, and import it into that event to introduce grid movement.

-Walking speed can be changed using the "Change Player Movement Speed" panel at the beginning of the event sheet.  However, if the speed is too slow, it may not be possible to climb steps in some cases.

-In the event, the player operation is disabled, and the directional keys pressed are checked again.  The player is moved to the specified angle and also adsorbed in the center of the grid.

----
*Introduce the Concept of "Front Row/Back Row" to the Party in Battle [#k26cf574]
In the battles of the "Dungeon RPG Sample," the concept of front/back rows is specified on the party side.  (For the sake of simplicity, enemies are only in the front rows.)  Members in the back row cannot attack the enemy unless they have a long-range weapon, and conversely, bare handed attacks from the enemy will basically not hit them.  Bakin achieves these mechanisms by specifying the following:

** Specify the Positions of Allied Party Members in the Battle Layout [#o705979c]
You can specify the placement of allies and enemies during battles in the Game Definition > [[Rules and Operations]] > Battle Layout settings, the Map Settings palette > Enemy Distribution, and the "Execute Battle and Check Results" event panel.  Not only the display position during battles, but also the distance between allies and enemies is calculated based on what is specified here.  The Dungeon RPG sample is positioned as shown in the following image. 
#br
#ref(./BattleLayout_DRPGSample.png,70%)
#br
** Specify Attack Range [#pb519225]
To introduce the concept of attack range into battles, first, turn on "Use Attack Range" in Game Definition > [[Rules and Operations]].  Then, specify "Attack Range Judgment Type" as either "Line" or "Distance" in the pulldown.
For the difference between "Line" and "Distance", see Game Definition > [[Rules and Operations]] > "Attack Range Judgment Type".

Next, you need to specify the attack range of the weapon and the cast itself (bare handed attacks) in the Database > Items and Database > Casts > Basics tabs.  The unit of attack range is the grid of the battle layout.

The Front/Back indications that appear above the members during battles in the "Dungeon RPG Sample" are specified in the Layout Tool > Battle Status.
----
*Damage Indication [#c7ac0781]
In battle scenes in the "Dungeon RPG Sample," damage values and effects when attacked appear in the party status display area. 

This is accomplished by placing parts with the special coordinate specification tag DamagePosition on the Layout Tool > Battle Status screen.  Please refer to the "Damage Display Position" container in the layout parts list.
---- 
*Rearrange the Party Members [#yb204fa2]
When the concept of front/back rows is introduced into battles, it makes sense to rearrange the order, such as putting deeply damaged members in the back row.  In the "Dungeon RPG Sample," in addition to allowing "swapping places" as a battle command, we also handle such things as automatically moving members who have been disabled in battle to the back of the line.
#br
**Enable the Battle Command "Swap Places" [#g726711b]
To display the rearrange order command during battle, create a command in the "Battle Command Menu" under the Database > [[Casts]] > Battles tab, specifying "Swap Places" as the function to be assigned.
#br
**Enable Automatic Rearranging by "Status" [#ye138347]
To automatically send members to the back row depending on their state during battle, first, turn on "Rearrange by State During Battle" in Game Definition > [[Rules and Operations]].  You may turn on "Restore the Original Order when States are Removed" if necessary.
#br
And which state to move to the back is specified in the Basic Settings "Move to Back of the Party while Granted" in Database > [[State Definition]].
----
* Switching Battle Backgrounds [#s8a400e9]
In the "Dungeon RPG Sample," the background 2D graphics are switched as necessary, for example, between encounter battles and boss battles.  This is achieved by an event.

First, place an event for background graphics on the "Dungeon_2DBattleMap" used as the battle map.  Within that event, there are multiple event sheets that are activated by variable values, and background graphics are assigned to each of them.

Then, at the event where the battle occurs, the background is switched by putting the value for the event sheet you want to use as the background into a variable.
---- 
*Narrowing Down the Entries to be Displayed on the Layout [#l9a202ee]
In the "Dungeon RPG Sample," each menu corresponding to the "Item List" and "Picture Book" has a narrowed-down list of entries to be displayed, such as "Weapons Only" and "Valuables Only.  This is achieved through a combination of Database and Layout Tool functions.
#br
**Database Management Tags [#s9f73563]
You can freely set tags with a "#" in the Management Tags + Notes field under the Database Entry Tree.  Items also have internally generated tags by specifying "Consumables," "Weapons," and "Armor" in the Basic Settings and setting the price to 0.
#br
**Narrowing by Tags in the Layout Tool [#s11eb14e]
Use the Layout Tool to specify which of the tagged entries are to be displayed.  You can specify entries to be displayed by specifying tags in "Management Tags for Items to be Displayed" in the layout properties of the Item Selection screen, etc.  Note that specifying multiple tags will result in an AND condition ("00 and xx").
#br
**Display in the "Picture Book" Screen [#tbb6bb3c]
Please note that picture books will not be displayed unless "Register to Picture Book" is turned on in the "Others" tab of each option in the Database.
#br
The Dungeon RPG sample's picture book, or Monsters in the "Notebook," shows only the enemy casts.  To achieve this, we first specify the #Monster tag for casts that correspond to so-called monsters in Database > Casts.  And this is achieved by specifying #Monster for the layout property "Management Tags for Items to be Displayed" in Layout Tool > Cast Picture Book.
---- 
* Enhancement Items [#b5280f70]
In the "Dungeon RPG Sample," events occur where enhanced items like "Knife +1" come out of treasure chests or enhance items on hand.  This is achieved through a combination of the following features:

** Specify as Enhanceable Items [#i317aa54]
If you want to make an item enhanceable, remember to first go to Database > [[Items]] and turn on "Enhanceable" for the item you want to have enhanced.
**Enhancement Using "Custom Event" on Items [#q4cef2de]
For items from treasure chests, we have set up an item enhancement event in Database > [[Items]] with a custom event.  A custom event is triggered when an item is obtained.  In the event, items from "+1" to "+3" will appear using random numbers and loops.
** Enhancing Using Enhancement Item Selection Screen and Common Events [#v3ef6145]
The item enhancement event on the B1 map is achieved by a combination of Layout Tool and Common Events.  The common event "Item Enhancement_B1" is called from the action in the sub-menu container of the Layout Tool > Enhancement Item Selection screen.
Also, in the layout properties "Variable Specification," specify the "nth Parameter in the Inventory" variable to be used for "Item Enhancement" and "Advanced Variable Box Operation" on the Common Event side.  Note that the Enhancement Item Selection screen takes effect in combination with Common Events.

- You can specify which abilities of the item will be enhanced by the event content.

Please refer to sample events in the Common Events section for more information on enhancing items.

''(Caution)''
Each enhanced item is treated as a different type of item.
The capacity of the Inventory, which can be set in Game Definition > Rules and Operations, allows you to specify the number of "types" of items the player can have.
In other words, each enhanced item is counted as "one type".
----
*Mini Map [#s0b8f6de]
A mini map with auto-mapping is displayed on the screen.  Icons of doors and treasure chests found are now also displayed on maps. These are achieved through a combination of the following features:

**Display Mini Map [#vec244fb]
The mini map can be displayed simply by specifying the special format \minimappreview in the Layout Tool on the Panel for Rendering Strings.  The size and display position of the mini map will reflect the panel's settings.  In the "Dungeon RPG Sample," a layout called "minimap" is created in the Layout Tool > Free Layout for Events screen, and the mini map is displayed by calling the layout from a common event.

**Setting the Contents of the Mini Map Display [#m8ebb815]
- The color of the mini map to indicate where the area is traversable or non-traversable, the size of the grid on the screen, and whether or not auto-mapping is used can be specified in the Game Definition > [[Rules and Operations]] > Current Location Map Display Settings.

- Whether or not the player icon on the mini map is rotated according to "player orientation" can be specified in Game Definition > [[Rules and Operations]].

- The setting of whether or not to be able to walk on the terrain can be changed for each terrain in the Resources > [[Terrains]] section.

- You can specify how much of the map to display on the mini map by going to Map Settings > Map.   It is common to create maps that are larger than the area that the player can be walked around during play, for example, for visual purposes.  Specify this option to prevent unwanted areas from being displayed on the map. 

**Setting Icons on Mini Map [#wbb96aeb]
- The icons for doors and treasure chests on the mini map are specified as images in Game Definition > System Resources > Current Location Map. 

- The event sheet specifies where to display the images set in the System Resources. 
Please see the door event in the sample game. The image is specified in "Change Elements During Sheet Execution" > "Graphic Settings" > "Image for Displaying Map" in each event sheet when closed or opened.  By allowing each event sheet to specify its own icon, it is possible to switch the icon to be displayed depending on its status.
----
*Footstep Settings [#z219759e]
Footsteps can be sounded when the player walks on the terrain/object.

**Footstep Settings for Terrain [#fe31f6cd]
Footsteps can be set in "Sound Effects" under Resources > Terrains Properties.

**Footstep Settings for Objects [#e956310c]
Footsteps when walking on an object can be sounded by assigning a "terrain" with a set of sound effects.
Specify the terrain in the "Terrain Assignment" property of the simple collision in Resources > 3D/2D Stamps.
The "Sound Effects" set for "Terrain" will be applied.
-This setting is also valid when an object is evented.

-You can also apply the "state" changes assigned to "terrain" that are granted when walking on it.
This can be used, for example, to make the player "poisoned" when walking on an object.

//---The Physics Settings allow you to change the terrain to be assigned to each collision. 
//This can be used to create different footstep sounds within an object.

**Footstep Volume and Playback Speed Adjustment [#k3e9f7ea]
There are settings for footstep volume and footstep playback speed in Game Definition > Rules and Operations, which can be changed uniformly.
It can also be changed using the "Change Footstep Settings" event panel.
If you want to adjust the volume of individual footsteps, you can go to Resources > Sounds and change the volume of the footsteps you are using.

----
*Run up to the Enemy and Attack [#p5c184bc]
Actions such as running up to a monster and slashing at it during a battle attack can be accomplished by using battle events.

- First, create a new battle event on the [[Common Event Palette]] and create two event sheets, "Run up" and "Return".
Set up the following events on each sheet.

-- "Run up" sheet
---"When Command is Decided" to determine what the party cast does.
---If an "attack" is to be made, the number of the target enemy is identified, the enemy is made the operation target, and then the coordinates of the target monster are obtained.
---The attacking cast should be the operation target, and the coordinates of the cast should be obtained as the coordinates of the destination to return to after the attack.
---Walk the cast towards the coordinates of the monster.
---Finally, turn on the "Ran up to" event switch.

-- "Return" sheet
---If the event switch indicating rushing is on at "At the End of Action," then the attacking cast is the operation target.
---The cast walks toward the coordinates of where they are standing at the time before the attack, as obtained on the "Run up" event sheet.
---Finally, turn off the "Ran up to" event switch.

-''[Key Points]''
-- If you are using a pre-1.4.x version of the battle scripts, you will need to update to the latest version in order for this event to work properly.
  ''&color(red){If you have made any modifications to your battle scripts, please be sure to back them up. };''
  [[Map Editor Menu Bar:https://rpgbakin.com/pukiwiki_en/?Map+Editor+Overview#g26005fe]], go to Functions>Expanded Features, and under "Copy Battle- Related Scripts to Game File" to update your battle scripts to the latest version.
  If you have made modifications, please merge them into the latest version.

-- "Make Event Walk to Specified Coordinates" panel setting on the "Return" sheet
--- For "Orientation at the End of Move", turn on "Face Specified Angle" and specify an angle of 180 degrees to face the enemy after returning.
--- Checking the "Keep Current Motion" checkbox will avoid the cast from standing still after it returns. Alternatively, after returning, you can use the "Change Event Motion" panel to specify the motion.

Please refer to the images below for event details.
#ref(./RunuptotheEnemyandAttack_Runup.png,80%)
#ref(./RunuptotheEnemyandAttack_Return.png,80%)
----
*Continuous Damage Indication [#wa819449]
Actions that deal continuous damage in a single skill attack can be achieved by using common event.

- First, create a new common event on the [[Common Event Palette]].
-- Use the "Obtain Battle Information" panel to obtain the number of the enemy selected as the target when using the skill.
-- Then repeat using the "Recover/Reduce Battle Cast's HP/MP" panel to reduce the HP of the enemy in that number -> "Wait Specified Time".

- Specify the configured event in "Common Event to be Called" under Database > Skills > [[Basic Tab:https://rpgbakin.com/pukiwiki_en/?Skills#h3e7a611]].

-''[Key Points]''
-- After the damage dealt by this event is displayed, the damage set for the skill itself will be displayed.
-- If you wish to match the damage indication timing of the event and the skill effect, adjust the wait in the event accordingly.

Please refer to the images below for event detail.
#ref(./ContinuousDamage.png,80%)

----
*Level Cap Release Event [#wb954e0a]
You can specify a maximum level for casts and classes and then have events change that maximum level.
The [[Change Cast Status:https://rpgbakin.com/pukiwiki_en/?Statuses#gc32eaf9]] panel will be utilized.

-First, specify the maximum level.
--Specify the maximum level in the game at Game Definition > [[Rules and Operations]].
--Specify the maximum level of the cast in Database > Casts. Here, you should specify a value less than or equal to the value you just set in the Game Definition.

-Next, create an event to release the level cap.
--In the "Change Cast Status" panel, obtain the "Max Level" of the cast and specify the new maximum.

It's a good idea to specify events at game milestones, such as "when the first chapter is completed" or "when an item is obtained."

For example, the following can be achieved:
- The maximum level for the entire game is 99.
- The maximum level of Cast A at the start of the game is 20.
- At the end of the first chapter, the maximum level will be increased to 50 by an event. 


#ref(./Change_MaxLv.png,80%)

----
*Sway Grass Models Growing Out of the Ground [#vec24090]
Shaders such as a_n_wind_discard, a_n_rm_wind_discard, and map_wind_discard can be used to make the grass on the ground appear to sway in the wind.
Please refer to the material sb_obj_nature002_Grass01a (sb_obj_nature002_Grass01a) in the 3D stamp sb_obj_nature002_Grass01a in "Orb Stories".

-In Resources > Materials > Shader, select the above shader. Turn on the "Whether to Fix Y=0" setting in it. The roots remain fixed, while the grass can be animated to sway in the wind according to the degree of the settings.

-However, even if this is turned on, the Y axis may not be fixed as expected.
Please make sure that the following settings are specified in Blender for the model to be imported.
+Specify the "origin" as the root when creating the model.
+Check the "Transform > Apply Transform" setting box when exporting FBX from Blender.

Front page   Edit Diff History Attach Copy Rename Reload   New Page list Search Recent changes   Help   RSS of recent changes