Battle System Documentation
Battle System Documentation
1
ORK: Okashi RPG Kit for Unity Battle System Documentation
Contents
1 Battle System Editor...........................................................................................................3
1.1 Battle System..............................................................................................................4
1.2 Battle Menu.................................................................................................................8
1.3 Battle Text.................................................................................................................13
1.4 Battle End.................................................................................................................18
2 Battle Animation Editor.....................................................................................................20
2.1 The Animation Step Concept....................................................................................21
2.2 Wait Step..................................................................................................................22
2.3 Go To Step................................................................................................................22
2.4 Random Step............................................................................................................22
2.5 Check Random Step.................................................................................................23
2.6 Check Formula Step.................................................................................................23
2.7 Spawn Prefab Step...................................................................................................24
2.8 Destroy Prefab Step.................................................................................................24
2.9 Calculate Step..........................................................................................................25
2.10 Set Camera Position Step......................................................................................26
2.11 Fade Camera Position Step....................................................................................26
2.12 Set Initial Camera Position Step.............................................................................27
2.13 Fade To Initial Camera Position Step.....................................................................27
2.14 Shake Camera Step...............................................................................................28
2.15 Rotate Camera Around Step..................................................................................28
2.16 Move To Step..........................................................................................................29
2.17 Move To Direction Step...........................................................................................30
2.18 Rotate To Step........................................................................................................31
2.19 Rotation Step..........................................................................................................32
2.20 Play Animation Step................................................................................................32
2.21 Stop Animation Step...............................................................................................33
2.22 Play Sound Step.....................................................................................................34
2.23 Stop Sound Step.....................................................................................................35
2.24 Fade Object Step....................................................................................................35
2.25 Fade Camera Step.................................................................................................36
3 Battle Arena......................................................................................................................37
3.1 Battle Setup..............................................................................................................38
3.2 Enemy Setup............................................................................................................39
3.3 Variable Setup...........................................................................................................40
3.4 Audio Setup...............................................................................................................41
3.5 Start/End Cam Setup................................................................................................42
4 Battle Agent......................................................................................................................44
2
ORK: Okashi RPG Kit for Unity Battle System Documentation
3
ORK: Okashi RPG Kit for Unity Battle System Documentation
System type
The system type defines which battle system type is used, there are two options:
• Turn
The battle system is turn based.
• Active
The battle system is active time based.
Turn based
The battle order (i.e. the order in which the combatants can choose and perform their
actions) is set at the start of each turn.
The settings for a turn based battle system are:
Turn calculation
The selected formula is used to calculate a time value for every combatant. Afterwards the
are sorted – the combatant with the highest time value performs the first action.
Active command
The command of each combatant is selected after the previous combatant finished it's
action. If not set, the commands are selected at the beginning of each turn and then
executed.
Defend (%)
The formula to calculate the base defence rate when using the defend command.
Escape (%)
The formula to calculate the base escape chance when using the escape command.
4
ORK: Okashi RPG Kit for Unity Battle System Documentation
Active time
Every combatant has a timebar which represents it's move time. If the timebar is full the
combatant can choose and perform it's command. The timebar is filled over time.
The settings for a active time battle system are:
Time calculation
The selected formula is used to calculate the value that is added to the timebar every tick.
It determines how quickly the timebar of a combatant is filled.
Start time calculation
The selected formula is used to calculate the value a combatants timebar will have at
battle start.
Action border
The maximum of the timebar. If a combatants timebar reaches this value the combatant
can choose and perform a command.
Pause on menu
The battle time (the filling of the timebar) is paused while your characters battle menu is
displayed (i.e. the battle pauses while you select your commands).
Attack, Item, Defend, Escape end turn
If selected the command will end a combantants turn (i.e. set it's timebar to zero). If not
set, you can define the value that will be subtracted from a combatants timebar after using
the command.
Note that the item command is used for all items – skills have their own end turn settings
when the active time battle system is selected.
Timebar use (only when a commands end turn isn't selected)
The value that will be subtracted from a combatants timebar after using the command.
Defend (%)
The formula to calculate the base defence rate when using the defend command.
Escape (%)
The formula to calculate the base escape chance when using the escape command.
5
ORK: Okashi RPG Kit for Unity Battle System Documentation
Use bonuses
If set turn bonuses will be used in battle.
(Consumable) status value
Define the value that should be added to the consumable status value.
Revive
If set, dead characters will be revived after battle.
Set (consumable) status value
If set, the consumable status value will be set to the defined value when reviving a
character.
6
ORK: Okashi RPG Kit for Unity Battle System Documentation
7
ORK: Okashi RPG Kit for Unity Battle System Documentation
Menu position
The dialogue position used to display the battle menu. Dialogue positions are defined in
the dialogue position editor.
Attack
The settings for the attack command. This command performs the characters base attack.
Enable attack
The attack command is displayed in the battle menu.
Name
The name displayed for the attack command.
Icon
The icon of the attack command. It must be stored in
Assets/Resources/Icons/BattleSystem in the Unity folder structure.
Skill
The settings for the skill command. This command opens the skill menu.
Enable skills
The skill command is displayed in the battle menu.
8
ORK: Okashi RPG Kit for Unity Battle System Documentation
Menu position
The dialogue position used to display the skill menu. Dialogue positions are defined in the
dialogue position editor.
Combine types
All skills are combined into one skill menu. If not set, the skills are divided into the different
skill types – so there will be a command for every skill type showing only this types skills in
the skill menu.
Name (only on combined types)
The name to display for the skill command.
Icon (only on combined types)
The icon of the skill command. It must be stored in Assets/Resources/Icons/BattleSystem
in the Unity folder structure.
Item
The settings for the item command. This command opens the item menu.
Enable items
The item command is displayed in the battle menu.
Menu position
The dialogue position used to display the item menu. Dialogue positions are defined in the
dialogue position editor.
Combine types
All items are combined into one item menu. If not set, the items are divided into the
different item types – so there will be a command for every item type showing only this
types items in the item menu.
Name (only on combined types)
The name to display for the item command.
Icon (only on combined types)
The icon of the item command. It must be stored in Assets/Resources/Icons/BattleSystem
in the Unity folder structure.
9
ORK: Okashi RPG Kit for Unity Battle System Documentation
Defend
The settings for the defend command. This command will let the character defend itself –
attacks will do less damage until the next turn.
Enable defend
The defend command is displayed in the battle menu.
Name
The name to display for the defend command.
Icon
The icon of the defend command. It must be stored in
Assets/Resources/Icons/BattleSystem in the Unity folder structure.
Escape
The settings for the escape command. This command lets the whole party escape from
the battle (if the escape chance applies).
Enable escape
The escape command is displayed in the battle menu.
Name
The name to display for the escape command.
Icon
The icon of the escape command. It must be stored in
Assets/Resources/Icons/BattleSystem in the Unity folder structure.
10
ORK: Okashi RPG Kit for Unity Battle System Documentation
Target selection
The settings for the target selection battle menu. The target selection is displayed when
selecting the target for a base attack, skill or item.
You can combine the different target selections.
Use menu
A menu based target selection is used.
Menu position (only on use menu)
The dialogue position used to display the target menu. Dialogue positions are defined in
the dialogue position editor.
Use cursor
A cursor object is used to show the selected target.
Cursor prefab (only on use cursor)
The prefab to be used as cursor object. It must be stored in
Assets/Resources/Prefabs/BattleSystem in the Unity folder structure.
Cursor offset (only on use cursor)
The offset added to the targets GameObject position when displaying the cursor object.
Blink target
The selected targets GameObject will blink while selected.
Blink children (only on blink target)
All child GameObjects of the target will blink.
Interpolation (only on blink target)
The interpolation used for fading – there is a wide variety of interpolations, try them to see
what suites your needs.
Blink time
The time used for blinking. The time is used for every direction (fading from-to and to-
11
ORK: Okashi RPG Kit for Unity Battle System Documentation
from).
Alpha, Red, Green, Blue (only on blink target)
If set, the color value will be faded according to the defined From and To values. E.g.
when the target should blink green, activate red and blue and fade them from 1 to 0.
12
ORK: Okashi RPG Kit for Unity Battle System Documentation
Info text
The info text displays the name of the item or skill that is used by a combatant.
Show infos
Info texts will be displayed.
Position
The dialogue position used to display the info text. Dialogue positions are defined in the
dialogue position editor.
Visible time
The time the info text will be displayed.
Battle messages
Battle messages are displayed at the beginning and the end of every battle.
Show messages
Battle messages will be displayed.
Position
The dialogue position used to display the battle message. Dialogue positions are defined
in the dialogue position editor.
Visible time
The time the battle messages will be displayed.
Text settings
Some text definitions used in the battle system.
13
ORK: Okashi RPG Kit for Unity Battle System Documentation
Miss text
This text is displayed when an attack or skill misses it's target (doesn't hit). It will be
displayed like set in the damage text settings.
Counter attack text
This text is displayed when a combatant counters an attack. It will be displayed like an info
text.
All allies text
This text is displayed when a skill or item targets all allies. It will be displayed in the target
menu.
All enemies text
This text is displayed when a skill or item targets all enemies. It will be displayed in the
target menu.
Color
The text color used. Text colors are defined in the project editor.
Shadow color
The shadow color used. Text colors are defined in the project editor.
14
ORK: Okashi RPG Kit for Unity Battle System Documentation
The following settings are the same for all damage texts – but are made individually for
every one.
Color
The text color used. Text colors are defined in the project editor.
Show shadow
Defines if the shadow should be displayed.
Shadow color
The shadow color used. Text colors are defined in the project editor.
15
ORK: Okashi RPG Kit for Unity Battle System Documentation
Shadow offset
The offset of the shadow to the text.
Visible time
The time this damage text will be displayed.
Fading
The damage text can fade in and out when it becomes visible/invisible. Activate Fade in or
Fade out if you want it to fade in or out.
Fade in/out time
The time used for fading.
Start alpha (in/out)
The alpha value at the beginning of the fade.
End alpha (in/out)
The alpha value at the end of the fade.
Interpolation (in/out)
The interpolation used for fading – there is a wide variety of interpolations, try them to see
what suites your needs.
Base offset
The base offset used on the target GameObjects position.
Random offset from/to
The random offset added to the base offset. Will generate a random number for every axis
based on the from-to values.
Animation
The damage text will be displayed at the position of a newly created GameObject. This
object can be moved around with the following settings.
Animate
The damage text will be animated.
X, Y, Z random
The movement speed along the axis will be random.
X, Y, Z speed (only if not random)
The speed the damage text will move along the axis.
X, Y, Z min/max (only if random)
The minimum and maximum of the random speed range.
Flashing
The target GameObject can be flashed when the damage text is displayed. The flash
settings are made here.
16
ORK: Okashi RPG Kit for Unity Battle System Documentation
Flash object
The target GameObject is flashed.
Time
The duration of the flash.
Flash children
All child GameObjects of the target will be flash.
Interpolation
The interpolation used for fading – there is a wide variety of interpolations, try them to see
what suites your needs.
Alpha, Red, Green, Blue
If set, the color value will be faded according to the defined From and To values. E.g.
when the target should flash red, activate green and blue them from 1 to 0.
17
ORK: Okashi RPG Kit for Unity Battle System Documentation
Position
The dialogue position used to display the battle end texts. Dialogue positions are defined
in the dialogue position editor.
Show gains
Victory gains are displayed at the end of a battle.
Money text
The text used to display the money dropped by the enemies. Use % to display the money
value.
Item text
The text used to display the items dropped by the enemies. Multiple items of the same
kind are displayed in one line, every item kind in its own line.
Use % to display the number of items, %n for the name of the item.
Experience text
The text used to display the experience gained. Use % for the value of experience, %n for
the name of the experience status.
18
ORK: Okashi RPG Kit for Unity Battle System Documentation
Level up notification
The notification shown when a characters level increases. The order of the single
notifications can be changed. All texts will be displayed in one message.
Show level up
Level up notifications are displayed at the end of a battle (if a characters level increases).
Level up text
The text is used to display the characters name and new level. Use % for the level, %n for
the name of the character.
Status value text
The text is used to display status value changes. Every status value is displayed in its own
line. Use % for the value that was added to the status value, %n for the name of the status
value.
Skill learn text
The text used to display new skills learned by the character. Every skill is displayed in its
own line. Use %n for the name of the skill.
19
ORK: Okashi RPG Kit for Unity Battle System Documentation
Add
Adds a new battle animation to the list.
Remove
Removes the currently selected battle animation from the list. It can't be removed if there
is only one left.
Name
The name of the battle animation.
Prefab settings
Prefabs are used to spawn objects in a battle animation. Add them here and select them in
an animation step to be used.
Destroy prefabs
All spawned prefabs will be destroyed at the end of the battle animation.
20
ORK: Okashi RPG Kit for Unity Battle System Documentation
Prefab
A prefab that will be spawned by an animation step. They must be stored in
Assets/Resources/Prefabs/BattleSystem in the Unity folder structure.
Audio settings
Audio clips are used to play sounds in a battle animation. Add them here and select them
in an animation step to be used.
Audio clip
An audio clip that will be played by an animation step. They must be stored in
Assets/Resources/Audio/BattleSystem in the Unity folder structure.
Note that every battle animation needs to have a Calculate step. If none is added, the
calculation of the action that used this battle animation (e.g. base attack) will be done at
the end of the animation.
The following settings are available in all steps:
Step enabled
This step is enabled and will be executed. If not set, the step wont execute and the next
step (this step's index+1) will be executed.
Next step
Defines the index of the next step that should be executed. When moving the step around
in the editor, the next step index will be changed automatically.
21
ORK: Okashi RPG Kit for Unity Battle System Documentation
Time
The time in seconds to wait before executing the next step.
2.3 Go To Step
Executes the defined step as next step. No further settings.
Minimum
The minimum step index to be executed.
Maximum
The maximum step index to be executed.
22
ORK: Okashi RPG Kit for Unity Battle System Documentation
Value (0-100)
The number to be checked. E.g. 33 for 33 % chance.
Next step fail
The step index to be executed when the check fails.
Formula
The formula to be used.
Character
The character used in the formula. The character will be user and target of the formula.
Next step fail
The step index to be executed when the check fails.
23
ORK: Okashi RPG Kit for Unity Battle System Documentation
Prefab
Select the prefab from the list of prefabs defined in this battle animation.
Prefab ID
The prefab will be attached with this ID. The ID is used to identify this spawned prefab in
other animation steps. Don't use the same ID twice, or the connection to the old spawned
prefab will be lost.
On arena center
Spawns the prefab on the center of the battle arena (i.e. the position of the battle arena,
see BattleArena component for details).
Spawn on (only if not on arena center)
Spawns the prefab on the GameObjects position of either the User or Target of the battle
action that uses this battle animation.
Spawn offset
The offset added to the spawn position.
Prefab ID
The ID of the prefab to be destroyed.
24
ORK: Okashi RPG Kit for Unity Battle System Documentation
Auto animation
Automatically play an animation according to the result of the battle action calculation (hit,
missed, etc.).
The following settings are only available if auto animation is enabled:
Wait
Wait until the animation finished before executing the next step.
Play type
Select how the animation should be played (Play, CrossFade, Blend, PlayQueued,
CrossFadeQueued – read the Unity documentation for details).
Play mode (not available for Blend play type)
Either StopSameLayer or StopAll – read the Unity documentation for details.
Fade length (only for CrossFade, Blend and CrossFadeQueued play types)
The time used to fade from the previous animation to the new one – read the Unity
documentation for details.
Target weight (only for Blend play type)
The target weight to blend to – read the Unity documentation for details.
Queue mode (only for PlayQueued and CrossFadeQueued play types)
Either CompleteOthers or PlayNow – read the Unity documentation for details.
25
ORK: Okashi RPG Kit for Unity Battle System Documentation
On arena center
Uses the center of the battle arena (i.e. the position of the battle arena, see BattleArena
component for details) for the camera position.
Set on (only if not on arena center)
Uses the GameObject of either the User or Target of the battle action that uses this battle
animation for the camera position.
Camera position
The camera position to use. Camera positions are defined in the camera position editor.
Time
The time in seconds used to fade the camera.
Wait
Wait until the fading is done before the next step is executed.
On arena center
Uses the center of the battle arena (i.e. the position of the battle arena, see BattleArena
component for details) for the camera position.
Fade to (only if not on arena center)
Uses the GameObject of either the User or Target of the battle action that uses this battle
animation for the camera position.
26
ORK: Okashi RPG Kit for Unity Battle System Documentation
Camera position
The camera position to fade to. Camera positions are defined in the camera position
editor.
Interpolation
The interpolation used for fading – there is a wide variety of interpolations, try them to see
what suites your needs.
Time
The time in seconds used to fade the camera.
Wait
Wait until the fading is done before the next step is executed.
Interpolation
The interpolation used for fading – there is a wide variety of interpolations, try them to see
what suites your needs.
27
ORK: Okashi RPG Kit for Unity Battle System Documentation
Time
The time in seconds used to shake the camera.
Wait
Wait until the shaking is done before the next step is executed.
Intensity (0-1)
How hard the camera should be shaken.
Shake speed
The speed the camera should be shaken.
On arena center
Rotates the camera around the center of the battle arena (i.e. the position of the battle
arena, see BattleArena component for details).
Rotate around (only if not on arena center)
Rotates the camera around the GameObject of either the User or Target of the battle
action that uses this battle animation.
Time
The time in seconds used to rotate the camera.
Wait
Wait until the rotation is done before the next step is executed.
Speed
The rotation speed.
28
ORK: Okashi RPG Kit for Unity Battle System Documentation
Angles
The camera rotates around angles that are not zero.
Time
The time in seconds used to move the user or prefab.
Wait
Wait until the move is done before the next step is executed.
Move to
Moves the user or prefab to either:
• Target
The target of the battle action this battle animation is assigned to.
• Base
The spot the user was originally standing at.
• Center
The center of the battle arena (i.e. the position of the battle arena, see BattleArena
component for details).
Face direction
The user or prefab looks into the direction it moves.
Move prefab
If selected, a prefab will be moved, not the user.
Prefab ID (only on move prefab)
The ID of the prefab to be moved.
Controller move
If selected, the users or prefabs CharacterController is used to perform the move – if
none is found or not set, the Transform is used. Read the Unity documentation for details.
Interpolation
The interpolation used for moving – there is a wide variety of interpolations, try them to see
what suites your needs.
29
ORK: Okashi RPG Kit for Unity Battle System Documentation
Time
The time in seconds used to move the user or prefab.
Wait
Wait until the move is done before the next step is executed.
Local space
The direction is defined in local space of the user or prefab. Use this setting e.g. to always
move the user forward, regardless its actual position in world space.
Direction
The direction to move into.
Face direction
The user or prefab looks into the direction it moves. Note that you need to define gravity
here, if you want it to be added to the move.
Move prefab
If selected, a prefab will be moved, not the user.
Prefab ID (only on move prefab)
The ID of the prefab to be moved.
Controller move
If selected, the users or prefabs CharacterController is used to perform the move – if
none is found or not set, the Transform is used. Read the Unity documentation for details.
30
ORK: Okashi RPG Kit for Unity Battle System Documentation
Time
The time in seconds used to rotate the user or prefab.
Wait
Wait until the rotation is done before the next step is executed.
Rotate to
Rotates the user or prefab to either:
• Target
The target of the battle action this battle animation is assigned to.
• Base
The spot the user was originally standing at.
• Center
The center of the battle arena (i.e. the position of the battle arena, see BattleArena
component for details).
Rotate prefab
If selected, a prefab will be rotated, not the user.
Prefab ID (only on rotate prefab)
The ID of the prefab to be rotated.
Interpolation
The interpolation used for rotating – there is a wide variety of interpolations, try them to
see what suites your needs.
31
ORK: Okashi RPG Kit for Unity Battle System Documentation
Time
The time in seconds used to rotate the user or prefab.
Wait
Wait until the rotation is done before the next step is executed.
Rotate prefab
If selected, a prefab will be rotated, not the user.
Prefab ID (only on rotate prefab)
The ID of the prefab to be rotated.
Speed
The rotation speed.
Animate
Either animate the User or Target.
Default animation
If selected, a default animation can be chosen from the list. The default animations are
defined by the characters and enemies in the project editor. Default animations are used
to allow the use of battle animations across multiple combatants, even if their animation
names are different.
32
ORK: Okashi RPG Kit for Unity Battle System Documentation
Animate
Either stop the animation on the User or Target.
Stop all
Stops all animations.
Default animation (only if not stop all)
If selected, a default animation to be stopped can be chosen from the list. The default
animations are defined by the characters and enemies in the project editor. Default
animations are used to allow the use of battle animations across multiple combatants,
even if their animation names are different.
33
ORK: Okashi RPG Kit for Unity Battle System Documentation
Wait
Wait until the sound has finished playing before the next step is executed.
Audio clip
Select the audio clip from the list of audio clips defined in this battle animation.
Play one shot
Uses the AudioSource.PlayOneShot method to play the audio clip – read the Unity
documentation for details.
Volume
The volume this audio clip is played at.
Min./Max. distance
The minimum and maximum distance this audio clip is played.
Rolloff mode
The rolloff mode used playing this audio clip – read the Unity documentation for details.
Pitch
The pitch used playing this audio clip – read the Unity documentation for details.
Loop
The audio clip will be looped.
On arena center
Plays the audio clip on the center of the battle arena (i.e. the position of the battle arena,
see BattleArena component for details).
34
ORK: Okashi RPG Kit for Unity Battle System Documentation
Pause
The audio clip is paused, not stopped.
On arena center
Stops the audio clip playing on the center of the battle arena (i.e. the position of the battle
arena, see BattleArena component for details).
Stop on (only if not on arena center)
Stops the audio clip playing on on the GameObject of either the User or Target of the
battle action that uses this battle animation.
Time
The time in seconds used to fade the user or target.
Wait
Wait until the fading is done before the next step is executed.
35
ORK: Okashi RPG Kit for Unity Battle System Documentation
Fade
Fades the GameObject of either the User or Target of the battle action that uses this
battle animation.
Fade children
All child GameObjects of the target will be faded.
Flash
The user or target will be flashed, not faded – i.e. half of the time is used to fade to the set
color values, half of the time to fade back.
Alpha, Red, Green, Blue
If set, the color value will be faded according to the defined From and To values. E.g.
when the target should fade/flash red, activate green and blue them from 1 to 0.
Interpolation
The interpolation used for fading – there is a wide variety of interpolations, try them to see
what suites your needs.
Time
The time in seconds used to fade the camera.
Wait
Wait until the fading is done before the next step is executed.
Flash
The camera will be flashed, not faded – i.e. half of the time is used to fade to the set color
values, half of the time to fade back.
Alpha, Red, Green, Blue
If set, the color value will be faded according to the defined From and To values. E.g.
when the camera should fade/flash white, activate apha from 0 to 1 and red, green and
blue them from 1 to 1.
Interpolation
The interpolation used for fading – there is a wide variety of interpolations, try them to see
what suites your needs.
36
ORK: Okashi RPG Kit for Unity Battle System Documentation
3 Battle Arena
Battle arenas are used for the actual battle. Every battle needs a battle arena which holds
its settings (enemies, spots to place the characters and enemies, etc.). Attach the
BattleArena component to a GameObject in your scene to use it.
The battle can be started by the battle arena itself or a battle agent.
A battle arena can be attached via Components > RPG Kit > Battle Arena.
The battle arena's settings are made in the inspector of the GameObject the battle arena
is attached to.
37
ORK: Okashi RPG Kit for Unity Battle System Documentation
Start type
Defines how this battle arena's battle can be started. Note that a battle agent can always
start a battle, regardless which start type a battle arena is set to.
• Interact
The battle is started upon interaction with the player (i.e. pressing the accept key or
clicking it with the mouse).
• Autostart
The battle is automatically started when the level is loaded.
• Trigger enter
The battle starts when the player enters a trigger attached to this battle arena. Read
the Unity documentation for details about triggers.
• Trigger exit
The battle starts when the player exits a trigger attached to this battle arena. Read
the Unity documentation for details about triggers.
• None
The battle can't be started through the battle arena. Only a battle agent can start
this kind of battle arenas.
Max mouse distance (only on interact start type)
The maximum distance between the player and the GameObject of the battle arena to
enable mouse interaction.
Deactivate after
The battle arena is deactivated after its battle has been completed.
Can escape
The escape battle command is enabled for this battle.
No game over
The game continues even if the party has been defeated.
Use battle animator
A simple animator will be used to handle the combatants idle and run animation during
battle. The idle and run animations are defined by the characters and enemies in the
38
ORK: Okashi RPG Kit for Unity Battle System Documentation
Party spots
The positions the party members are spawned at. Use a GameObject from your scene
here to define the position. There are as many party spots as the maximum battle party
size is set in the project editor.
Select enemy
Select the enemy from the list. The enemies are defined in the project editor.
Spot
The position this enemy will be spawned at or set to. Use a GameObject from your scene
here to define the position.
Spawn enemy
The enemy will be spawned by the battle arena. The prefab defined in the enemy's
settings is used for spawning.
Enemy object (only if not spawn enemy)
The GameObject from the scene to be used as the enemy's object.
39
ORK: Okashi RPG Kit for Unity Battle System Documentation
Variable conditions
The variable conditions needed for this battle to be executed.
Auto destroy all
When the scene is loaded and the variable conditions aren't true (i.e. the battle wont
execute), this battle arena and all it's objects will be destroyed.
Needed
Either All or just One of the variable conditions needs to be true.
Toggle
The toggle in a variable condition decides if the variable must be the defined value (==) or
mustn't be the defined value (!=).
Key
The first text field defines the key (name) of the variable.
Value
The second text field defines the value the variable is checked with.
E.g. key == value is true, when the variable 'key' has the value 'value', key != value is true,
when the variable 'key' don't has the value 'value'.
40
ORK: Okashi RPG Kit for Unity Battle System Documentation
Start sound
The audio clip to be played at the start of the battle.
Volume
The volume of the audio clip.
41
ORK: Okashi RPG Kit for Unity Battle System Documentation
Fade screen
The screen will be faded out and in. The screen will be faded out before the camera
position is changed.
Fade out time (only on fade screen)
The time in seconds used for fading the screen out.
Fade in time (only on fade screen)
The time in seconds used for fading the screen in.
Interpolation (only on fade screen)
The interpolation used for fading the screen – there is a wide variety of interpolations, try
them to see what suites your needs.
Alpha, Red, Green, Blue from/to (only on fade screen)
If set, fades the screen with the defined From and To values. Fade out fades from-to, fade
in fades to-from.
42
ORK: Okashi RPG Kit for Unity Battle System Documentation
43
ORK: Okashi RPG Kit for Unity Battle System Documentation
4 Battle Agent
A battle agent is a GameObject that will start a battle when it touches the player (or the
player step's into it's trigger). You'll normally use a battle agent as an enemy object in the
battle it starts.
The battle is started when the player triggers one of the following functions on the battle
agent's GameObject: OnCollisionEnter, OnControllerColliderHit or OnTriggerEnter
(read the Unity documentation for details).
A battle agents can be attached via Components > RPG Kit > Battle Agent.
44
ORK: Okashi RPG Kit for Unity Battle System Documentation
The battle agent's settings are made in the inspector of the GameObject the battle arena
is attached to.
Script
The battle agent script.
Battle arena
The GameObject which holds the BattleArena component that starts the battle.
Hunt player
If active, the battle agent will use a simple behaviour to hunt the player.
The following settings are only used when hunt player is active:
Move object
The object to be moved (i.e. the battle agent itself – but normally the BattleAgent
component will be a child of the actual enemy to allow having a trigger and a
CharacterController).
ControllerMove
The move objects CharacterController is used to move the object, if not set or not found,
the Transform is used.
Move to start point
The enemy will return to it's start point when the player is out of range.
Apply gravity
Gravity is added when moving.
45
ORK: Okashi RPG Kit for Unity Battle System Documentation
Move speed
The speed the object will move at.
Hunting range
The maximum distance to the player to hunt it. If the distance is exceeded the agent wont
hunt the player.
Max distance to arena
The maximum distance the agent can have to it's assigned battle arena. If the distance is
exceeded the agent will return to it's starting point.
Max movement range
The maximum distance to the player to do any kind of movement. If the player is farther
away then this value the battle agent wont move at all.
46