Skip to content

Math operators (+ - * /)

Operators

In narrat, everything is a command, including mathematical operators. There are commands for the following operators.

They are used by using the keyword of the operator (the command) followed by its parameters, like any other command in narrat.

Example:

set player.hp (+ player.hp $healAmount)

Availale:

+, -, *, /,

Other examples:

(/ 1 2) Will divide 1 by 2

(* 1 2) will multiply 1 by 2

(+ 1 2 3 4) Will add 1 2 3 4

(- 2 1) will substract 1 to 2

Those operators can accept any amount of parameters, so you can add/substract/multiply/divide many things at once

Released under the MIT License.