Narrat Docs
Search…
Narrat Docs
Narrat
Functions Documentation
Save Commands
String commands
Text Commands
Random Generation
Logical Operators
Math commands
Math operators (+ - * /)
Other math operations
Jump
Choice
Modifying variables
If
Left-side Viewport commands
Clear Dialog
Audio commands (music and sounds)
Wait
Skills Commands
Notify
Stats Commands
Text Field
Features
Quests
Transitions
Inventory
HUD Stats
Screens
Skills System
Saving and Reloading
Playing Audio
Functions
Guides
Getting Help
Language syntax and expressions
Using items
Updating narrat
Getting Started
Old Template method
Config files
Useful Links
Theming the game and UI
Installing Narrat in a web app
Editing a narrat game
Building and exporting your game
Publishing on Steam (Steamworks integration)
Examples
Example Config
Example narrat script
Powered By
GitBook
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
Functions Documentation - Previous
Math commands
Next
Other math operations
Last modified
27d ago
Copy link