Difference between revisions of "Creating Techniques"

From Tuxepedia
Jump to navigation Jump to search
(Explaining "sort" in more detail)
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
Techniques can be created by creating a simple [http://en.wikipedia.org/wiki/JSON JSON] text file in the '''Technique Folder''' folder under `resources/db/technique`. This folder contains all of the details of each technique available in Tuxemon. Here you can specify the technique's type(s), power, and [[Technique effects]]. With each new technique, the following data must be specified:
= What Is a Technique in a Tuxemon Game? =


{| class="wikitable"
In a Tuxemon-style game, a '''technique''' is a special move that a creature can use during battle. Think of moves like '''Sting''', '''Ram''', or '''Shuriken'''. Each move has different properties that define how it works in the game.
|-
! Name
! Description
|-
| tech_id
| The id of the individual technique.
|-
| accuracy
| Float parameter between 0 and 1 which decides against a random value if the technique hits or not.
|-
| animation
| Name of the animation under `resources/animations/technique` to use when the move is used.
|-
| conditions
| Conditions are the prerequisites on which a technique fails or not.
|-
| effects
| Effects can change some characteristics of the enemy. By using the example below: "give poison,target" will give [[Poisoned]] status to the enemy and "damage" will inflict damage to the enemy.
|-
| flip_axes
| On which axes the animation needs to be flipped, by default is empty '''""'''.
|-
| is_fast
| Boolean, whether the technique is fast or not. Fast means that will be used before the enemy ones. By default is '''False'''.
|-
| potency
| Float parameter between 0 and 1 which decides against a random value if the technique will give a [[:Category:Condition]].
|-
| power
| Float parameter between 0 and 3 that will be used to calculate the quantity of damages.
|-
| range
| The kind of technique: [[Melee]], [[Ranged]], [[Touch]], [[Special]], [[Reach]] or [[Reliable]].
|-
| recharge
| Recharging time of the technique (eg 2 = it can be used every 2 turns).
|-
| sfx
| The sound effect under `resources/sounds/technique` to play when using the move.
|-
| slug
| The slug identifier of the technique. It defines the name of the technique, since inside the PO file there is a translation corresponding at the slug (msgid "sting" - msgstr "Sting") as well as the description (msgid "sting_description" - msgstr "Describing the technique").
|-
| sort
| Whether damage or meta, meta doesn't do damage.
|-
| target
| The target can be set among "enemy_monster", "enemy_team", etc.
|-
| types
| The technique's types [[:Category:Type]].
|-
| use_failure (optional)
| Text will appear if the technique fails.
|-
| use_success (optional)
| Text will appear if the technique hits.
|-
| use_tech
| Text will appear when the technique is used in battle.
|}


Here is an example of what a technique file might look like:
We use a '''JSON file''' to describe each move in detail. This file tells the game engine everything it needs to know about the move—how it looks, how strong it is, who it targets, and more.


`resources/db/technique/sting.json`
== What Each Field Means ==


  json
=== Basic Info ===
  {
* '''slug''': A unique name used in code (e.g. <code>"sting"</code>).
* '''sort''': In which stage it occurs. All regular techniques should be <code>"damage"</code>, even if they are non-damaging. (<code>"meta"</code> is available for things like fleeing combat, switching to another monster, and so on).
* '''category''': A label for how the move behaves (e.g. <code>"powerful"</code>, <code>"basic"</code>, <code>"exotic"</code>).
 
=== Tags ===
* '''tags''': Keywords that describe the move (e.g. <code>"toxic"</code>, <code>"bug"</code>). These help group similar moves together.
 
=== Conditions ===
* '''conditions''': Rules that must be true before the move can be used. For example, <code>"current_hp"</code>.
 
=== Effects ===
* '''effects''': What happens when the move is used. Examples:
** <code>"damage"</code>: Hurts the target.
** <code>"give"</code>: Adds a condition like <code>"hard_shell"</code> or <code>"poisoned"</code>.
 
=== Flip Axes ===
* '''flip_axes''': If the move’s animation should be flipped horizontally (<code>"x"</code>), vertically (<code>"y"</code>), both (<code>"xy"</code>), or not at all (<code>""</code>).
 
=== Target ===
* '''target''': Who the move affects. You can target:
** The enemy monster
** The enemy team
** The enemy trainer
** Your own monster
** Your own team
** Yourself (own trainer)
 
Each of these is a <code>true</code> or <code>false</code> value.
 
=== Animation & Sound ===
* '''animation''': The name of the animation to play.
* '''sfx''': The sound effect file to play when the move is used.
 
=== Modifiers ===
* '''modifiers''': Special changes to how the move behaves. For example:
** <code>"attribute": "type"</code> with <code>"values": ["fire"]</code> and <code>"multiplier": 1.5</code> means the move is fire-type and does 1.5× damage.
 
=== Text Feedback ===
* '''use_tech''': Message shown when the move is used.
* '''use_success''': Message shown when the move hits.
* '''use_failure''': Message shown when the move misses.
* '''confirm_text''' and '''cancel_text''': Labels used in the UI when confirming or canceling the move.
 
=== Types ===
* '''types''': What kind of move it is (e.g. <code>"fire"</code>, <code>"water"</code>). This affects how it interacts with other types.
 
=== Usability ===
* '''usable_on''': Can the move be used outside of battle? (<code>true</code> or <code>false</code>)
 
=== Power & Speed ===
* '''power''': How strong the move is (e.g. <code>1.9</code>).
* '''speed''': How fast the move is. Options include:
** <code>"extremely_slow"</code>
** <code>"very_slow"</code>
** <code>"slow"</code>
** <code>"normal"</code>
** <code>"fast"</code>
** <code>"very_fast"</code>
** <code>"extremely_fast"</code>
 
=== Randomness ===
* '''randomly''': If the move is chosen randomly (<code>true</code> or <code>false</code>).
 
=== Healing ===
* '''healing_power''': If the move heals, how much healing it does.
 
=== Recharge ===
* '''recharge''': How many turns you must wait before using the move again.
 
=== Range ===
* '''range''': How far the move reaches. Options include:
** <code>"melee"</code>: Close-range (compare user's Melee to target's Armor)
** <code>"ranged"</code>: Long-range (compare user's Ranged to target's Dodge)
** <code>"touch"</code>: Requires mere contact (compare user's Melee to target's Dodge)
** <code>"reach"</code>: Slightly extended range (compare user's Ranged to target's Armor)
** <code>"special"</code>: Does not involve damage
** <code>"reliable"</code>: Does a uniform amount of damage regardless of stats.
 
=== ID & Accuracy ===
* '''tech_id''': A unique number for the move.
* '''accuracy''': Chance to hit (from <code>0.0</code> to <code>1.0</code>, where <code>1.0</code> is 100%).
* '''potency''': How effective the move is overall (can affect damage, status chance, etc.).
 
<syntaxhighlight lang="json">
{
   "tech_id": 1,
   "tech_id": 1,
   "accuracy": 0.8,
   "accuracy": 0.8,
   "animation": "pound",
   "animation": "needle",
   "effects": [
   "effects": [
     "give poison,target",
     {
     "damage"
      "type": "give",
      "parameters": [
        "poison",
        "enemy_monster"
      ]
    },
     {
      "type": "damage"
    }
   ],
   ],
   "flip_axes": "",
   "flip_axes": "",
   "is_fast": false,
   "speed": "normal",
   "potency": 0.4,
   "potency": 0.4,
   "power": 1.25,
   "power": 1.25,
Line 86: Line 117:
   "slug": "sting",
   "slug": "sting",
   "sort": "damage",
   "sort": "damage",
  "modifiers": [],
   "target": {
   "target": {
     "enemy monster": 2,
     "enemy_monster": true,
     "enemy team": 0,
     "enemy_team": false,
     "enemy trainer": 0,
     "enemy_trainer": false,
     "own monster": 0,
     "own_monster": false,
     "own team": 0,
     "own_team": false,
     "own trainer": 0
     "own_trainer": false
   },
   },
  "category": "simple",
  "tags": [
    "bug",
    "toxic"
  ],
   "types": [
   "types": [
     "wood"
     "wood"
Line 100: Line 137:
   "use_success": null,
   "use_success": null,
   "use_tech": "combat_used_x"
   "use_tech": "combat_used_x"
  }
}
</syntaxhighlight>

Latest revision as of 12:29, 25 October 2025

What Is a Technique in a Tuxemon Game?[edit | edit source]

In a Tuxemon-style game, a technique is a special move that a creature can use during battle. Think of moves like Sting, Ram, or Shuriken. Each move has different properties that define how it works in the game.

We use a JSON file to describe each move in detail. This file tells the game engine everything it needs to know about the move—how it looks, how strong it is, who it targets, and more.

What Each Field Means[edit | edit source]

Basic Info[edit | edit source]

  • slug: A unique name used in code (e.g. "sting").
  • sort: In which stage it occurs. All regular techniques should be "damage", even if they are non-damaging. ("meta" is available for things like fleeing combat, switching to another monster, and so on).
  • category: A label for how the move behaves (e.g. "powerful", "basic", "exotic").

Tags[edit | edit source]

  • tags: Keywords that describe the move (e.g. "toxic", "bug"). These help group similar moves together.

Conditions[edit | edit source]

  • conditions: Rules that must be true before the move can be used. For example, "current_hp".

Effects[edit | edit source]

  • effects: What happens when the move is used. Examples:
    • "damage": Hurts the target.
    • "give": Adds a condition like "hard_shell" or "poisoned".

Flip Axes[edit | edit source]

  • flip_axes: If the move’s animation should be flipped horizontally ("x"), vertically ("y"), both ("xy"), or not at all ("").

Target[edit | edit source]

  • target: Who the move affects. You can target:
    • The enemy monster
    • The enemy team
    • The enemy trainer
    • Your own monster
    • Your own team
    • Yourself (own trainer)

Each of these is a true or false value.

Animation & Sound[edit | edit source]

  • animation: The name of the animation to play.
  • sfx: The sound effect file to play when the move is used.

Modifiers[edit | edit source]

  • modifiers: Special changes to how the move behaves. For example:
    • "attribute": "type" with "values": ["fire"] and "multiplier": 1.5 means the move is fire-type and does 1.5× damage.

Text Feedback[edit | edit source]

  • use_tech: Message shown when the move is used.
  • use_success: Message shown when the move hits.
  • use_failure: Message shown when the move misses.
  • confirm_text and cancel_text: Labels used in the UI when confirming or canceling the move.

Types[edit | edit source]

  • types: What kind of move it is (e.g. "fire", "water"). This affects how it interacts with other types.

Usability[edit | edit source]

  • usable_on: Can the move be used outside of battle? (true or false)

Power & Speed[edit | edit source]

  • power: How strong the move is (e.g. 1.9).
  • speed: How fast the move is. Options include:
    • "extremely_slow"
    • "very_slow"
    • "slow"
    • "normal"
    • "fast"
    • "very_fast"
    • "extremely_fast"

Randomness[edit | edit source]

  • randomly: If the move is chosen randomly (true or false).

Healing[edit | edit source]

  • healing_power: If the move heals, how much healing it does.

Recharge[edit | edit source]

  • recharge: How many turns you must wait before using the move again.

Range[edit | edit source]

  • range: How far the move reaches. Options include:
    • "melee": Close-range (compare user's Melee to target's Armor)
    • "ranged": Long-range (compare user's Ranged to target's Dodge)
    • "touch": Requires mere contact (compare user's Melee to target's Dodge)
    • "reach": Slightly extended range (compare user's Ranged to target's Armor)
    • "special": Does not involve damage
    • "reliable": Does a uniform amount of damage regardless of stats.

ID & Accuracy[edit | edit source]

  • tech_id: A unique number for the move.
  • accuracy: Chance to hit (from 0.0 to 1.0, where 1.0 is 100%).
  • potency: How effective the move is overall (can affect damage, status chance, etc.).
{
  "tech_id": 1,
  "accuracy": 0.8,
  "animation": "needle",
  "effects": [
    {
      "type": "give",
      "parameters": [
        "poison",
        "enemy_monster"
      ]
    },
    {
      "type": "damage"
    }
  ],
  "flip_axes": "",
  "speed": "normal",
  "potency": 0.4,
  "power": 1.25,
  "range": "melee",
  "recharge": 1,
  "sfx": "sfx_blaster",
  "slug": "sting",
  "sort": "damage",
  "modifiers": [],
  "target": {
    "enemy_monster": true,
    "enemy_team": false,
    "enemy_trainer": false,
    "own_monster": false,
    "own_team": false,
    "own_trainer": false
  },
  "category": "simple",
  "tags": [
    "bug",
    "toxic"
  ],
  "types": [
    "wood"
  ],
  "use_failure": "combat_miss",
  "use_success": null,
  "use_tech": "combat_used_x"
}