Help:Neowtext

This is the Neowtext help page, where you can find documentation on the wikitext superset.
What is it?
Neowtext (pronounced /ɲɛw tɛkst/, like "nyeow text") was originally designed for the Statistics Editor to extend wikitext with new additions such as variables and math operations.
Wiki editors can define values and calculations once, which can then be referenced later. This lets them write dynamic and reusable calculations to be displayed rather than having to manually compute values over and over again.
Neowtext can be used on the wiki through Neowbunto, invoked through the {{Neow}} template.
Variables
In order to store and use variables, you first need to create a <var> block. Then, define variables by assigning them a value using = with the $...$ syntax.
- For example:
<var> $Hi$ = 7777 </var> The number is: $Hi$!
- Will result in:
- The number is: 7,777!
Additionally, variables can also be used to create aliases for another variable or function.
- For example:
<var> $Hello$ = World $Alias$ = $Hello$ </var> Hey there, $Alias$!
- Will result in:
- Hey there, World!
A name without the dollar syntax will be treated as a table column if it matches one.
Fundamentally speaking, variables are merely macros; they hold what was stored and paste it out, meaning if you have a calculation stored, it would not resolve until the very final usage.
- For example:
<var> $One$ = 1 + 2 <!-- resolves to 3 --> $Two$ = $One$ * 2 <!-- resolves to 1 + 2 * 2, not 3 * 2 --> </var> $One$ vs $Two$
- Will result in:
- 3 vs 5
Arrays
A semicolon-separated list of numbers is an array. Bare $Name$ is the element at the current row's level (schema-aware when $FNC-SCHEMA$ is set). $Name@N$ pins a level; $Name@N@branch$ pins a branch (letter or display name from $FNC-BRANCH$).
A non-numeric semicolon list renders as the whole text unless pinned, in which case that slot is the raw string (or a number if that slot parses).
$FNC-TOTAL-NAME$ sums the whole array (or a per-level formula) named $NAME$.
The tab title (letters and digits only, e.g. PVP, Golden) is the prefix. Write $PVP-COST$ in the PVP Cost column; $COST$ does not change meaning by tab. $FNC-TOTAL-COST$ on that tab sums $PVP-COST$ if it exists, otherwise $COST$.
- Example:
<var> $COST$ = 100; 200; 300 $TP$ = $FNC-TOTAL-COST$ </var> {| class="wikitable" ! Level !! Cost !! Total Cost !! Damage |- | 0 || $COST$ || $TP$ || 10 |- | 1 || $COST$ || $TP$ || 15 |}
Functions
Neowtext has special functions in order to do more complex tasks, which are used in the same way as referencing variables. Functions are split into two:
- FNC (function)
- FSE (function Statistics Editor)
Normal functions can be used in both the wiki and the stats editor, while stats editor-specific functions can only be used there and are pretty much no-operations on the wiki. However, as data on the wiki is also used in the stats editor, they should not be removed either.
Additionally, the existence of this $FSE- will create the "Open in Statistics Editor" button.
Some functions (like TOTALPRICE) do not need to be declared as a variable in the <var> block first; you can directly use them at any time.
However, array functions (like COST or UPGRADE) must be defined in your <var> block so that the engine knows how to build the tower's data.
You can prepend the tab title to those names, such as $FNC-PVP-COST$ or $PVP-COST$ for a tab named PVP. A tab without its own series inherits the unprefixed value. This does not apply to ROFBUG.
You can find the list of functions currently available below.
FNC
COST
An array of upgrade costs for each level starting from Level 0 (e.g., 8250; 3250; 7500).
Declaring this shows the Costs sidebar in the Statistics Editor. $FNC-TOTALPRICE$ sums it.
This function is deprecated. Prefer costs in table cells by using a generic $COST$ array (see #Arrays) and $FNC-TOTAL-COST$.
BRANCH
An array of table names to indicate which table corresponds to which upgrade branch, depending on the branch's declaration order on the schema.
- Example:
<var> $FNC-SCHEMA$ = N; A; A; B; B $FNC-BRANCH$ = Top Path Stats; Bottom Path Stats <!-- Top Path Stats = A; Bottom Path Stats = B --> </var>
INDEX
By default, tables are indexed by their first column. You only need to use this function if you want to override this behavior and force the engine to index a table by a different column.
This is highly practical for cross-referencing stats between tables that have mismatching rows for levels without having to duplicate data. The target column supports single numbers, ranges (e.g., 1-3), inclusive or (e.g., 1/3A).
- Example:
<var> $FNC-INDEX$ = Sentry Stats.Level </var>
RECURSION
Acts as a copy-down command. When placed in a cell with content, it stores that content and injects it into every subsequent cell in the same column that contains $FNC-RECURSION$. The recursion chain breaks at the first cell that does not contain the tag.
- Example:
| 4 || {{Money|$TP$}}$FNC-RECURSION$ |- | 5 || $FNC-RECURSION$ <!-- becomes: {{Money|$TP$}} --> |- | 6 || $FNC-RECURSION$ <!-- ditto --> |- | 7 || {{Money|$TP$}} yay$FNC-RECURSION$ |- | 8 || $FNC-RECURSION$ <!-- becomes: {{Money|$TP$}} yay -->
ROFBUG
Specifies which columns should calculate with the current Rate of Fire bug in mind.
ROFBUG: The latest Rate of Fire bug, currently pinned as Modern.ROFBUG-2019: Pre-Overhaul Rate of Fire bug.ROFBUG-2020: Overhaul Rate of Fire bug.ROFBUG-2022: Modern Rate of Fire bug.
- Example:
<var> $FNC-ROFBUG$ = Firerate <!-- Firerate cells will have its valued adjusted --> $FNC-ROFBUG-2020$ = Tick <!-- This is declared later, hence takes priority and disregards above --> </var>
SCHEMA
Overrides the default order of any functions that use a level schema, such as UPGRADE. There is technically no restriction on which letter to denote the trunk, but for convention's sake, please use "N" for the default linear level.
- Example:
<var> <!-- Level 1-3 is N A is first path with 2 levels (4-5) B is second path with 2 levels (4-5) --> $FNC-SCHEMA$ = N; N; N; A; A; B; B </var>
TOTAL
For any variable: $FNC-TOTAL-NAME$ sums $NAME$ from level 0 up to the current level.
Works with a semicolon number array, or a formula / #expr. You can pin a specific level using @N, which is useful for referencing a total outside of a table row context. You can also specify a branch as a second @ segment, using either the branch letter or its display name.
- Example:
$EXP$ = {{#expr:floor(75 * 1.075^(Level - 1))}} $TE$ = $FNC-TOTAL-EXP$ <!-- sum of EXP from 0 through this row's level --> $FNC-TOTAL-EXP@10$ <!-- same total but pinned at level 10 -->
TOTALPRICE
Same idea as $FNC-PRICE$, but for only upgrade cost: $FNC-TOTALPRICE$ sums $FNC-COST$ from level 0 up to the current level.
The @N / branch pins described in #TOTAL apply the same way here.
- Example:
$FNC-TOTALPRICE@3$ <!-- trunk total at level 3 --> $FNC-TOTALPRICE@5@A$ <!-- branch A total at level 5 --> $FNC-TOTALPRICE@5@TopPathStats$ <!-- same, using display name --> <!-- when no branch is specified, trunk is assumed. -->
This function is deprecated, see the reasoning in #COST.
FSE
CATEGORY
This function lets its value be used as a category on the Statistics Editor's home page (e.g., Golden Perks).
If no value is provided, "Custom" is assumed.
This function is deprecated, please use #META instead.
DETECTION
A strictly 3-item array defining the exact levels where a tower gains Hidden, Lead, and Flying detection, respectively. Leave a slot empty to indicate a passthrough; use "-1" to explicitly state that it never gains that detection type. For each split path declared in #SCHEMA, 3 more slots get added.
All values start with "-1" as their initial state.
- Example:
<var> <!-- Hidden is unlocked at level 3 Lead is never unlocked (a passthrough here is effectively -1, as there is no state before) Flying is unlocked at level 0 --> $FSE-DETECTION$ = 3; ; 0 <!-- Hidden; Lead; Flying --> <!-- Hidden is unlocked at level 3 (a passthrough here inherits the state before) Lead is unlocked at level 2 Flying is never unlocked (leaving it empty would be a passthrough, hence we have to explicitly set it) --> $FSE-PVP-DETECTION$ = ; 2; -1 </var>
META
This function lets its value be used as a category and image on the Statistics Editor's home page (e.g., Evolved; File:DefaultOperator0.png).
If no value is provided, "Custom" is assumed.
UPGRADE
An array of upgrade titles starting from Level 1 (e.g., Radar; Stronger Ammunition; Dual Turret).
This function respects #SCHEMA.
UPGRADEICON
An array of image filenames or Roblox asset IDs for the upgrade icons starting from Level 1 (e.g., File:Radar.png; File:Radar.png; File:Turret3.png).
This function respects #SCHEMA.
Formulas
All arithmetic operators from JavaScript are allowed to be used:
| Operator | Description |
|---|---|
+ |
Addition |
- |
Subtraction |
* |
Multiplication |
** |
Exponenatiation |
/ |
Division |
% |
Remainder |
++ |
Increment |
-- |
Decrement |
- Example:
<var> $EQ$ = 5 + 5 - 2**5 </var> 5 + 5 - 2^5 is $EQ$!
- Results in:
- 5 + 5 - 2^5 is −22!
Additionally, you could pair it with ParserFunctions' Expr syntax.
Dot Notation
In a case where a column exists in another table, but the column name was already used before, you can forcefully pull it using the full stop or the dot to specify which table you meant to the engine.
Tables in tabs (such as PVP) with no title inherit the Regular table title in the same position. For example, Warden Stats.Swingrate on an untitled PVP tab still reads that PVP table, not Regular.
- Example:
<var> $AdvDPS$ = "Base Stats.Damage / Base Stats.Firerate" </var> {| class="wikitable" ! colspan="3" | Base Stats |- ! Level !! Damage !! Firerate |- | 0 || 10 || 1.5 |- | 1 || 15 || 1.2 |- | 2 || 20 || 1.2 |} {| class="wikitable" ! colspan="3" | Advanced Stats |- ! Level !! DPS |- | 0 || $AdvDPS$ |- | 1 || $AdvDPS$ |- | 2 || $AdvDPS$ |}
- This will result in the Advanced Stats table automatically pulling the Damage and Firerate from Base Stats for levels.
If you ever need to index a table by a column other than the first one, you can manually override the engine by defining FNC−INDEX = Table Name.Column Name in your var block.
The @N pin syntax also applies to dot notation. For example, $Base Stats.Damage@3$ pulls the Damage value at level 3 from Base Stats, regardless of which row the expression appears in. This can be combined with branch pinning the same way as TOTALPRICE.
Directives
Directives are HTML comments that start with @se-. They tell the Statistics Editor how to treat the page. On the wiki, they serve as no-operations, similar to FSE.
The practical difference between directives and FSEs is that directives control the editor itself, whereas FSEs are data for the editor to handle and consume.
Most directives are automatically generated by the stats editor and are very cumbersome to write manually.
ignore
Skips a region so the Statistics Editor does not parse it. The wiki still renders whatever is inside.
<!-- @se-ignore -->: opening<!-- @/se-ignore -->: closing<!-- @se-ignore/ -->: self-closing, ignores that one line
This directive is an exception to the general rule of directives, as it does not start with @se-.
diff
Stores a JSON snapshot of changed cells so the editor can show a difference against a saved baseline.
memo
Stores the editor memo as JSON in the source. Adjacent @se-memo comments are concatenated if the payload is large.
