Luna Engine Configuration Guide

From Yanfly.moe Wiki
Revision as of 10:23, 22 June 2019 by Archeia (talk | contribs) (Part 4: Block 3 - Events/Animations)
Jump to navigation Jump to search

Welcome to the wiki! This is where you can find resources from Yanfly.moe, Ækashics.moe,
VisuStella, Caz Wolf, Fallen Angel Olivia, Atelier Irina, and other affiliated content creators.


Common Terms

This is a list of common terms you will find throughout all the configurations.

KEY DESCRIPTION
components A map of components and windows in the scene. The key is the window class name. Default windows (windows that are defined by RMMV) will have a more friendly name defined by LunaEngine. For the config of each component, see Component table.

It is important to remember that Components are only shown once and are not updated every instance.

layouts A map of layouts in the scene. MainLayout is required as it is the scene itself. The name of layout can be anything. See Layout table for more information.
events A conditional that triggers something to happen. Exclusively used for common UI animations such as transition in, transition out, on option select, and other similar effects.
lunatic Lunatic mode for each component. The key name will be the key name of component/window you want to activate lunatic mode.

Lunatic is always updated for every instance.

lunatic item A special type of component that is rendered for every entry in a list of data. Examples include things such as per party member during battle screens/status screens, per skill on skill screen, per item on the item screen, per command on a menu, etc.
type Defines what type of asset is rendered or how it is rendered. Examples for type of asset include: image, text, grid. Examples for styles of rendering include: horizontal, vertical, freestyle, fixed. Scenes/screens are also defined by type. In this case, the type will be scene, this to make sure LunaEngine knows this config is a scene config.
version This is a marker to see what version or iteration your current configuration is. This is helpful to keep track of your changes and what version has a previous feature you might’ve removed and what returned and so forth.

Common Config Commands

type: <string> 

Type is what kind of component you are using. Depending on what the type is defining, there are a number of valid strings.

version: 0.0.0 

Version, also known as Version History, is to keep track what version your Luna Config is. It is useful for Version Control and keep track of changes.

x: <number> 

X indicates either the width or horizontal position. A bigger number moves the object right, where a smaller number moves it left. Negatives are allowed for position.

y: <number> 

Y indicates either the height or vertical position. A bigger number moves the object down, where a smaller number moves it up. Negatives are allowed for position.

image: <string> 

Specifies the source image file. By default, Luna looks for all source files in the “systems” folder. Via encasing the filename (without file extension) in quotation marks, it’s possible to direct Luna to a subfolder. For Example:

image: "battlehud\cursor" 

Global Templates

Presets.yml

This yaml file is used for general configuration, something like a core engine. When using a “default” setting in any YML, it will refer back to the presets. It is possible to define multiple presets as long as they all have their individual names.

type: presets # Defines this as the preset configuration
version: 0.1.0 # Defines the version number

presets: # Indicates the below as different presets
  default:  # name of the preset. Input this into the configuration to call data entered into this preset. 
    fontName: DS Pixel Cyr  # Name of font in the font folder. Do not include font file extensions. 
    fontSize: 16 # Size of font
    fontOutline: # Indicates how the font outline is drawn. In pixels.
      enable: true  # Tells Luna you want font outlines
      lineWidth: 4  # Width of the font outline
      lineColor: rgba(16, 16, 16, 1)  # Colour of the font outline and transparency. 
    fontShadow:  # Indicates below defines the font shadow
      enable: true  # Tells Luna you want font shadows
      shadowOffset:  # Indicates shadow offset distance. In pixels. 
        x: 2   # Horizontal offset (bigger = more right, negatives accepted)
        y: 2  # Vertical offset (bigger = more down, negatives accepted)
      shadowColor: rgba(32, 32, 32, 0.6)   # The colour and transparency of the shadow
      shadowBlur: 4  # The amount of blur on the shadow (bigger = more blur)

    lineHeight: 36 # Space between lines of text. (bigger = more space). In pixels.
    textPadding: 6 
    windowPadding: 18   # Padding around the edge of the window. (bigger = more padding). In pixels. 

    gaugeOffset:
      x: 0
      y: 4
    gaugeHeight: 16
    gaugeOutline:
      enable: true
      lineWidth: 2
      lineColor: rgba(16, 16, 16, 1)
    gaugeSlanted: true

    windowSkin: BlueWindowSkin   # Name of the windowskin used without file extensions 
    Cursor:   # Indicates below defines the cursor
      type: normal # normal / image / none |Normal uses the one included in window skin. Image, allows for the use of a seperate image instead. None means an invisible cursor.
      blink: true   # Includes whether blink animation is used
      image: cursor   # Name of the image used if image type is used. Setting to “none” produces an invisible cursor
      offset:  # Offset of the position of the cursor
        x: 0  # Horizontal offset (bigger = more right, negatives accepted)
        y: 0  # Vertical offset (bigger = more down, negatives accepted)
 

Animations.yml

This yaml files defines the animations that can be called on in Block 3: Events of every scene/screen configuration.

Currently, all animations are keyframe animations with two keyframes:

  1. The start position
  2. The end position

This makes simple transition animations such as fade in from the top, or move left easy to set. As end keyframe offset is permanent unless it is changed by another animation, it’s suggested that both offset x and y is either set to 0 in the ending keyframe or a dedicated animation exists to move the offset back to 0, 0.

type: animations # Defines this as the animation configuration file
version: 0.1.0 # Defines the version number

Animations:  # Indicates below as animation settings
  FadeInDown:  #  Name of animation. Can be set to anything. 
	0:  # Starting keyframe (starting position of the animation)
  	 offsetX:  #  Offset of horizontal from predefined position in scene configuration for the asset/window
    	  type: fixed # fixed for animations only.|Defines what "value" means.  
    	  value: 0  # Amount of the X offset. (bigger = more right, negative allowed)
  	 offsetY:  #  Offset of vertical from predefined position in scene configuration for the asset/window
    	  type: fixed
    	  value: -150
  	 alpha: 0  #  Transparency of the asset the animation is targeting
	100:  # Ending keyframe (Ending position of the animation)
  	 offsetX:  #  Offset of horizontal from predefined position in scene configuration for the asset/window
    	  type: fixed
    	  value: 0
  	 offsetY:
    	  type: fixed
    	  value: 0
  	 alpha: 1

  MoveBack:  # Example of an animation designed to reset any prior animations
	100:   # Only has an ending keyframe. The starting keyframe is implied to be whatever state the asset is currently in.
  	 offsetX:
    	  type: fixed
    	  value: 0
  	 offsetY:
    	  type: fixed
    	  value: 0
  	 alpha: 1

Basic Configuration Overview

Part 1: Block Definition

All scene-related Luna YMLs are organized in the same way. The overall layout can be defined via four distinct blocks that all have their individual functions. By understanding what each of these Blocks do, it becomes far easier to understand what needs to be changed to get the intended effect.

Block 1: Basic Components

Contains the default windows available for configuration. Allows for the most basic configurations for windows such as size, position, spacing, font used, window skins, and much more.

components:#Header for Basic Components
  Background:#Window 1 (Background)
	#-Configurations removed for the sake of easy identification-
	
  TitleCommand:#Window 2 (Title Screen Buttons/Commands)
      #-Configurations removed for the sake of easy identification- 

Block 2: Layout

Determines the relationship windows have to each other and how they are layered on top of each other. Windows drawn later will be on top, while windows drawn first will be on the bottom.

For a window to appear, it must be listed somewhere within the layout. As such, there must be a “MainLayout”. Will only accept existing windows. Attempting to add a nonexistent window under layout will result in nothing happening.

Also allows for the ability to link windows together and move them as a whole unit.

layouts:#Header for Layouts
  MainLayout:#Name of Layout
	type: FreeLayout #Type of Layout (How it's displayed)
	components:#components of Layout
  	- Background #Window 1
  	- TitleCommand #Window 2 

Block 3: Events/Animations

Used for animations. Specifies what should happen on an event such as when something is selected, etc. Only predefined animations in the animations.yml can be used. Attempting to use a nonexistent animation will cause an error.

events: #Header for Events
  onSceneEnter:#Event Condition (When first opening the screen)
	#-Configurations removed for the sake of easy identification-

  onItemSelect:#Event Condition (When selecting an object/item/command/)
	#-Configurations removed for the sake of easy identification-


  onItemUnselect:#Event Condition (When unselecting an object/item/command)
	#-Configurations removed for the sake of easy identification- 

Block 4: Lunatic

Used for heavy customization.

Allows complete freedom to customize all existing windows mentioned in Block 1.

Each window is customized individually, allowing both the adding of removing of individual components, as well as components that only appear of a certain condition is true. The block of Luna’s customization is here.

lunatic:#Header for Lunatic
  TitleCommand:#Name of customized window. Must be the same as in Block 1.
   #-Configurations removed for the sake of easy identification- 

Part 2: Block 1 - Basic Components

Block 1 of all scene yaml files indicates the basic setup of each window that appears in the scene/screen. Only existing and defined windows can be configured. Each window has its own set of configurations under its window name.

If the parameter is predefined in preset.yml, it’s possible to call on those presets in all Block 1 configurations instead of redefining it here (but it’s still possible to redefine it if preferred).

When redefining a parameter, the entire parameter must be redefined. (Eg, if redefining font shadow, everything including shadow width, blur, etc must be redefined).

components: # Header to Block 1
 MenuCommand: # Name of Window
  type: Window  # Indicates that this is referring to a window
  x:  # Defines the horizontal position of the window. Relative based on where the window is placed in the layout in relation with other existing windows
   type: fixed  # fixed/ percentage | Determines how the number in value is interpreted. Fixed is a pure pixel value, while percentage moves the window via a percentage of its width. 
   value: 0 # Bigger = more to the right. Negatives are allowed. Percentage values have no limitations. 
  y: # Defines the vertical position of the window. Relative similar to X. 
   type: fixed
   value: 0
  anchor: # Defines where the position point is anchored on the window. 
 # 0 = Left side/Top, 0.5 = Middle, 0.5 Right side/Bottom
   x: 0 # Horizontal position of the anchor point
   y: 0 # Vertical position of the anchor point 

  width: # Width of the window
   type: fixed # Fixed only. Determines the value below as a pixel value
   value: 370 # Width of the window in pixels
  height: # Height of the window 
   type: fitLines # fitLines/ fixed | FitLines draws the height of the window based on the number of allowed lines of text. Fixed draws it based on specified height. 
   value: 1  # Either defines the number of lines the window can fit, or the height in pixel value as specified in type. 

  fontName: default # Customize the font used
  fontSize: default # Customize the font size
  fontOutline: default # Customize the font outline
  fontShadow: default # Customize the font shadow details

  lineHeight: default # Customize the line height
  textPadding: default # Customize the text padding
  windowPadding: default # Customize the window padding 
  contentsOffset: # Allows for the offset of the content in the window
   x: 150  # Amount of horizontal offset
   y: 0 # Amount of vertical offset

  windowSkin: default # Customize which window skin is used
  cursor: # Customize the cursor 
   type: none # normal / image / none  # Customize which cursor is used
   blink: true  # Turn on and off blink effect
   image: "battle_hud/selector"  # Image source of the cursor
   Offset:  # Offset of the cursor position 
     x: -16
     y: -45

  customBackground: # Allows for the use of a custom image for the window skin instead of what’s drawn from a window skin file. 
   enable: true # Turns custom background function on and off
   image: none # Source of the image file used for the custom background. Putting while keeping enable true produces an invisible window background, but keeps the contents visible. 

  columns: 7  # Determines the number of columns for commands/items/buttons.  Allows for the creation of horizontal menus if desired. 

Part 3: Block 2 - Layout

As mentioned before, layout determines the order windows are drawn in and how they are paired in relation with each other.

Windows can either be independent free bodies or paired with other windows to make a larger, multi window unit. This makes moving a set of windows more straightforward as it’s possible to just edit the position of the layout element rather than the windows themselves.

layouts:  # Indicates the start of the Layout Block
  MainLayout:  # Mandatory main layout. Dictates what appears in the scene
	type: FreeLayout  # Type of layout. For Main layout, Free is recommended
	components:  # What windows/layout sets are displayed. The order determines who the components are layered, with the higher up components in the list being on the bottom while the components lower on the list being displayed at the top.
  	 - Background  # It’s possible to simply list window names directly
  	 - BodyLayout  # Example of a layout unit

  BodyLayout:  # Name of a layout unit. It can be set to anything. 
	type: HorizontalLayout  # HorizontalLayout/ FreeLayout/ VerticalLayout |Type of layout unit. Horizontal automatically places the windows side by side without overlap while vertical stacks them without overlap. FreeLayout allows complete freedom in window placement, including overlap. 
	x:  # Horizontal position of Layout unit
  	 type: fixed  # Works the same as specified in Block 1. 
  	 value: 0
	y:  # Vertical position of Layout unit
  	 type: fixed
  	 value: 0
	width:  # Width of layout unit. It’s suggested to not tamper with this as it may cause unintended effects.
  	 type: percentage
  	 value: 100
	height: # Height of layout unit. It’s suggested to not tamper with this as it may cause unintended effects.
  	 type: percentage
  	 value: 100
	components: # Indicates what components are in the layout unit. Can be windows or other layout units. 
  	 - MenuCommand
  	 - RightColumn

  RightColumn: # Another example of a layout unit. 
	type: FreeLayout
	x:
  	 type: fixed
  	 value: 0
	y:
  	 type: fixed
  	 value: 0
	width:
  	 type: percentage
  	 value: 100
	height:
  	 type: percentage
  	 value: 100
	components:
  	 - MenuStatus
  	 - Gold
 

Part 4: Block 3 - Events/Animations

This block defines the animations that will play on “events” in the UI.

While there are limitations to what and how something can be animated depending on the manner windows were set up and the way Luna is structured, animations can be targeted at individual components or lunatic items as defined in Block 4: Lunatic by combining the component name with the window.

Example: Targeting the window “BattleStatus”:

target: BattleStatus <nowiki>

Targeting the “HpBar” component defined for the “BattleStatus” window in Block 4: Lunatic. 
 <nowiki>target: BattleStatusHpBar <nowiki>

Targeting Lunatic item 0 in the “BattleStatus” window as defined in Block 4: Lunatic. 
 <nowiki>target: BattleStatusLunaticItem0 <nowiki>

All currently available “events”:
*'''onSceneEnter:''' When the scene is first entered/ when the menu is first opening. 
*'''onExitEvents:''' When leaving the scene/when closing the menu. Due to the way RPG handles scenes, certain animations such as fade outs on the background will produce unintended results such as black screens. 
*'''onItemSelect:''' Animation that plays on selecting commands/items/button. Also works for certain windows that appear such as the actor select on skill or item scenes. 
*'''onItemUnselect:''' Animation that plays when unselecting a command/item/button. Commonly used to reset the animation from onItemSelect. Also works for certain windows that appear. 
*'''onComponentShow:''' An alternative to onItemSelect when targeting windows that appear. Necessary due to the way RPG maker handles certain windows such as on the battle scene. 
*'''onComponentHide:''' An alternative to onItemUnselect. The equivalent of onItemUnselect, but for onComponentShow.

 <nowiki>events: # Indicates that this is the event block
onComponentShow: # Event that will trigger the animation
   Command:#It’s possible to group animations under a name as long as the name is unique across block 3.
    - type: Animation # Specifies that the following is an animation
   	target: ActorCommand # Target of the animation (what is animated). The target in this case is the window “ActorCommand”
   	animation: FadeInDownMin # Name of the animation specified in animation.yml
   	duration: 500 # milliseconds. Length of animation
   	delay: 400  # Allows for the delaying of the animation. Optional.
   	ease: Quadratic.Out  # Allows for easing. Not including this section produces a perfectly linear movement. This is completely optional.
   	force: true # Attempts to force the animation to play. Does not always work, and is generally not necessary, but may fix certain uncooperative windows.

   BattleSkill: # Name of Animation command
    - type: Animation
    	target: BattleSkill # Targets the “BattleSkill” window
    	animation: FadeInDownMin
    	duration: 150 # milliseconds
    	ease: Quadratic.Out

  onSceneEnter: # Event that will trigger the animation
    - type: Animation # Animation commands can be directly listed instead of grouped under a name
  	target: BattleStatusLunaticItem0 # Targets Lunatic Item 0 within the “BattleStatus” window.
  	animation: FadeInDown
  	duration: 350 # milliseconds

    - type: Animation
  	target: BattleStatusHpBar # Targets the component called “HpBar” under the window “BattleStatus” as defined under Block 4: Lunatic
  	animation: FadeInDown
  	duration: 350 # milliseconds
  	delay: 100
  	ease: Quadratic.Out
 

test

test

test

Common Config Commands

Common Config Commands

Common Config Commands

Common Config Commands

Common Config Commands

Common Config Commands

Common Config Commands

Common Config Commands

Common Config Commands

Common Config Commands

Common Config Commands