English - Ralph-VX/LMBS-MV GitHub Wiki

Table of Contents

Installation

Download LinearMotionBattleSystem_Core.js and put it into /js/plugins/ folder under your project. Then enable it in Plugin Manager. There have several plugin parameters your can change in Plugin Manager to customize the behavior of your game.

Resource Placement

Image files for Battler are placed in new folders under img/sv_actors for both Actors and Enemies. The folder should be named as the battler name chosen in Data Base. Actual Images shown in the game are placed inside this folder separated for each motion, named 'pose'. The filename should in the format of Name[parameters], where the name is the name of the 'pose' image is representing, and 'parameters' describes some traits of the 'pose'. Parameters can have following types. Note that the order is not defined and not all parameters are required. When No parameter is presented, the brackets can be omitted.

  • L, when this letter presence in parameter, the system will loop the 'pose' when Creator is not handling it through skill motion.
  • H[n], where [n] should replace by a value. This represents the actual height of the 'pose'. This height will be used as the 'hit box' of the character if provided. Note that when plugin parameter Fix Character Size is set to true, this parameter will have no effect except the 'pose' is named as 'Stand'.
  • W[n], where [n] should replace by a value. This represents the actual width of the 'pose'. This width will be used as the 'hit box' of the character if provided. Note that when plugin parameter Fix Character Size is set to true, this parameter will have no effect except the 'pose' is named as 'Stand'. Image files for Projectiles are placed in new img/projectile. Create it if there haven't one. Image files in this folder can't use parameters.

When the project is deployed with option 'exclude unused files', these image folders will not included in the deployed project. Please copy the folders to deployed projects manually after the deployment is finished.

Battler Settings

You can Add following liens in battler's Note to set some properties of battler in battle.

  • <Move Speed:[n]>, replace [n] with any value. Set the speed of movement in battle for the battler. This note tag can be applied to both Actor and Enemy.
  • <<Battler Name:[s]>, replace [s] with any string. Set the folder name for battler that contains the Image files for it. This note tag can be applied on both Actor and Enemy.
  • <Attack Skill Set [n1]:[n2]>, replace [n1] with one of number from 0,2,4,6,8. representing the direction, and [n2] with a value of skill ID. Set the Normal Attack performed with each direction key holding. This note tag can only be applied to Actor.
  • <Target Type:[type]>, replace [type] with one of following strings: Nearest,Farest,HighestHP,LowestHP. Set the targeting type for the battler. This note tag can be applied to both Actor and Enemy. This feature is near-broken currently.
  • <Victory Skill:[n]>, replace [n] with a skill ID that contains the motion for the Actor's victory motion. This skill will be performed when Victory. This note tag can only be applied to Actor.
  • <Attack Rate:[n1],[n2]>, replace [n1] with the weight of 'Physical Skills' actor will perform when AI controlling him, and [n2] for 'Magical Skills' as same. This will change how likely this actor will use his skills.
  • <Ai Class:[s]>, replace [s] with the name of AI class. This is the advanced option, and should not be used when you can't scripting. This note tag can be applied both Actor and Enemy.

Skill Motion

Skill Motion is a list of commands that decides how battler will move in battle when he performed the skill/item. To set the skill motion, add <Skill Motion> and </Skill Motion> in note of the skill. Lines between these tag will be the commands that processed in battle. Skill Motion can also be set through predefined json files placed under data/motions' folder (create it manually). To use this way, insert <Skill Motion:[fn]>into the note of skill/item, replace[fn]` with the file name of the json file exclude the extension. this json file should contains an array, each elements of the array is one command of motion equivalent to the string commands. The format of object will be described at below sections too. The command will be processed one-by-one in the same frame until there have a 'pause' in the command, or the command list is the end. Following is the commands can be used in:

  • ChangePose [posename], replace [posename] to the name of 'pose', or the name of the Image file placed in the corresponding folder. The name should NOT contains the parameter part (i.e. write Stand if the file name is Stand[F4]).
    • The corresponding json format for this command is:{"type":"pose","name":"[posename]"}
    • This command change the 'pose' battler is showing to a desired pose. Use this command to show animations stored in different Image files.
  • FrameForward
    • The corresponding JSON format for this command is: {"type":"forward"}
    • This command let the frame index of the 'pose' increase for one. use this command combined with Wait command described at below section to show animation for skill.
  • FrameBackward
    • The corresponding JSON format for this command is: {"type":"backward"}
    • This command let the frame index of the pose decrease for one.
  • Move [dx],[dy],[duration], replace [dx] with the amount of movement in x-axis, [dy] with the amount of movement in y-axis and [duration] for the time in frames used to complete this movement. All values are integers.
    • The corresponding json format for this command is: {"type":"move","dx":[dx],"dy":[dy],"dur":[duration]}
    • This command move the battler in linear motion as described. This movement will not be interrupted by others except being hit.
  • Wait [duration], replace [duration] as the amount of time in frame.
    • The corresponding json format for this command is: {"type":"wait","dur":[duration]}
    • This command will pause the process of command, and stop the processing for [duration] frames.
  • StartInput
    • The corresponding JSON format for this command is: {"type":"startinput"}
    • When this command is triggered, system will start to accept input from Player/AI for chaining skill. This state will be kept until the skill motion finish, or EndInput command is be triggered.
  • EndInput
    • The corresponding json format for this command is: {"type":"endinput"}
    • When this command is triggered, system will stop to accept input from Player/AI.
  • StartDamage [rectx],[recty],[rectwidth],[rectheight],[damagePercent],[knockbackx],[knockbacky],[knockbackdir], replace [rectx],[recty],[rectwidth],[rectheight] with the property of the rect that will apply the damage, [damagePercent] with the percentage of damage deal by this damage action, and [knockbackx],[knockbacky] with the amount of power battler will be knockback when hit by this skill, [knockbackdir] to set how knockback's x direction will be.
    • The corresponding json format for this command is: {"type":"startdamage","rect":{"x":[rectx],"y":[recty],"width":[rectwidth],"height":[rectheight]},"damage":[damagePercent],"knockback":{"x":[knockbackx],"y":[knockbacky]},"knockdir":[knockbackdir]}
    • This command inform system to start deal damage in specified Rectangular area. The 0,0 coordinate for this rectangle is the position of battler, and positive x-axis will be the battler's facing direction. Damage value is same to the result of formula set in Skill/Item, multiply the value of [damagePercent]. One command will only deal damage to same target one time. [knockbackdir] can be 1 or 0. When this is set to 1, the knockback will be opposite direction of battler's current facing, otherwise it is same direction.
  • EndDamage
    • The corresponding JSON format for this command is: {"type":"enddamage"}
    • This command inform system to not deal damage anymore, until another StartDamage command is triggered.
  • Projectile [classname],[parameters], replacing [classname] to the name of the class object for projectile object that will be created, and [parameters] with the comma-separated arguments required by the class object.
    • corresponding json format for this command is: {"type":"projectile","classname":[classname],"parameters":[parameters]}
    • See detailed information at Projectiles
  • LetFall
    • The corresponding JSON format for this command is: {"type":"letfall"}
    • This command lets battler falling when it is not at the ground as regular. In default, this falling will not start when motion is playing.
  • NoFall
    • The corresponding JSON format for this command is: {"type":"nofall"}
    • This command lets battler to not falling when it is not at the ground. This is the default setting when a skill motion is playing.
  • WaitFall
    • The corresponding JSON format for this command is: {"type":"nofall","dur":1}
    • This command pauses the command process until system detect the battler is at ground.
  • WaitCast [duration], replacing [duration] with the time to pause command process.
    • The corresponding json format for this command is: {"type":"waitcast","dur":[duration]}
    • This command is same as the combination of ChangePose Cast and Wait [duration]
  • Rotation [angle],[direction],[duration], replace [angle] with the angle want the batter be, where 0 is normal angle, [direction] as the direction of rotation, where 4 represents counter-clockwise and 6 represents clockwise, and [duration] with the time this rotation need to perform, in frame.
    • The corresponding json format for this command is {"type":"rotation","rotation":[angle],"dir":[direction],"dur":[duration]}
    • This command let the battler sprite rotate to a desired angle. This angle will be retained until the motion finish.
  • SetHitStop [length], replace [length] with the length of the hit-stop preferred in later motion.
    • The corresponding JSON format for this command is {"type":"sethitstop","length":[length]}
    • Set the hit-stop when the skill damages some battler. The default value is 15. Changed value will be retained until the motion finish.

###Projectile The projectile is a special sprite generated during the skill motion. This sprite has a pre-defined movement and properties, and can be customized (in some way) through the arguments described in the motion list. Currently, there has two Projectile class that can use in a game. Description and the arguments required are:

  • Sprite_ProjectileLMBS.
    • Generates a sprite that will move in a straight line, with desired speed in both x and y-direction, and can deal a desired amount of damage when collide with battler(s). Parameter is as following, separated by comma.
    • File name of the projectile image file, without extension.
    • Amount of frames in the image.
    • Speed of animation.
    • Speed in x direction
    • Speed in y direction.
    • Percentage of damage deal to battler.
    • Knockback in x direction.
    • Knockback in y direction.
    • Direction of knockback, 1 for opposite and 0 for same direction with user.
  • Sprite_AnimationLMBS
    • Generate a sprite that will play an animation defined in the database. This animation can be mirrored and delayed, and can be set to follow a battler. The parameter is as following, separated by a comma.
      1. Target of the animation as the origin. can be one of following: target, to let the origin of animation be the position of current target. user, to let the origin of animation to be the position of user. screen to let the origin of animation to be the top-left of the screen.
      2. Difference in X direction from origin, can be negative number.
      3. Difference in Y direction from origin, can be negative number.
      4. filename of json descriptor placed under data/animations/ folder (create one if there doesn't exist), descriptor will be described in Animation Descriptor section.
      5. Animation id that will displayed
      6. Delay in frame to show the animation. Just provided as the core have it.
      7. Show animation in mirror or not. true stands for yes, false stands for no, and null stands for "depends on user's facing".
      8. will the animation follow the target. true stands for yes and false stands for no.

####Animation Descriptor A json file contains an object, having fields named as numbers (e.g. "1","2" and so on). Each numbers represents the frame in the animation, and the values for the fields will be an array of objects similar to the object for "StartDamage" in Skill Motion section. only differents is that the origin point of the damage rect is the coordinate of Target.

##Skill Settings There have several parameters can be set for each skills, define its properties that will be used when battler using it. All these parameters are set by add note tags into the note of the skill.

  • <Skill Priority:[num]>: Set the priority of the skill. when the [num] is positivie number, battler can only use skill with higher priority when he already casted a skill.
    • e.g. try to cast a skill with priority 1 while casting skill with priority 0
      • OK
    • e.g. try to cast a skill with priority 1 while casting skill with priority 2
      • Not Possible
    • Skills with priority 0 can be casted while casting skill with same priority. This is use to implement Normal Attacks that can be used one-by-one.
    • Skills with priority -1 can be casted after any skills, but can't let any skills casted after it.
    • Skills with priority -2 can be casted after any skills, and allow any skills be casted after it.
  • <Attack Skill Set [n1]:[n2]>: Same as the one set to Actors. This command allow a skill have its own Normal Attack chains. Note that skill prioritiy's restriction is still applied on these skills.
  • <Skill Range:[num]>: Set the theological range of the skill. [num] refers to the distance in pixels. This note tag is used by AIs to determine which skills is to used, and when to use. When this note tag is not been set, System will try to search through the skill motion and find first StartDamage command to calculate range.
  • <Aerial Cast:[id]>: Set the skill will be casted when this skill is used mid-air. [id] refers to the skill/item id that will be casted. When id is 0, this skill is casted straightly. When this tag is not set, the skill is not castable mid-air.