Difference between revisions of "Creating Techniques"

From Tuxepedia
Jump to navigation Jump to search
Line 1: Line 1:
Techniques in Tuxemon can be created by adding a JSON file to the <code>mods/tuxemon/db/technique</code> directory. 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 `mods/tuxemon/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 and there is a translation in the PO file (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)
| Corresponding msgid (translation PO file) will appear if the technique fails.
|-
| use_success (optional)
| Corresponding msgid (translation PO file) will appear if the technique hits.
|-
| use_tech
| Corresponding msgid (translation PO file) 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.


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


  json
=== Basic Info ===
  {
* '''slug''': A unique name used in code (e.g. <code>"sting"</code>).
* '''sort''': What kind of move it is (e.g. <code>"damage"</code> or <code>"meta"</code>).
* '''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
** <code>"ranged"</code>: Long-range
** <code>"touch"</code>: Requires physical contact
** <code>"reach"</code>: Slightly extended range
** <code>"special"</code>: Unique targeting
** <code>"reliable"</code>: Always hits
 
=== 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>

Revision as of 12:00, 1 August 2025

What Is a Technique in a Tuxemon Game?

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

Basic Info

  • slug: A unique name used in code (e.g. "sting").
  • sort: What kind of move it is (e.g. "damage" or "meta").
  • category: A label for how the move behaves (e.g. "powerful", "basic", "exotic").

Tags

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

Conditions

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

Effects

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

Flip Axes

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

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 true or false 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:
    • "attribute": "type" with "values": ["fire"] and "multiplier": 1.5 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. "fire", "water"). This affects how it interacts with other types.

Usability

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

Power & Speed

  • 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

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

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:
    • "melee": Close-range
    • "ranged": Long-range
    • "touch": Requires physical contact
    • "reach": Slightly extended range
    • "special": Unique targeting
    • "reliable": Always hits

ID & Accuracy

  • 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"
}