Narrat 2.1.0 - New scripting features and many new commands


Narrat is a game engine for making interactive narrative RPGs packed with features.. Create your game by editing with a Simple scripting syntax. It supports Skills with skill check rolls, an Items inventory, and has a Quests System. The script system is very powerful and allows branching choices, functions, variables and conditions.

Narrat 2.1.0 is out

There have been many changes since the last devlog, with narrat 2.0.0 and 2.1.0

New scripting features

Narrat 2.0.0 was a big rework of the internal scripting system to turn the scripting into a more proper fully featured programming language. narrat scripts now support things like using expressions as arguments, variables, logic and math operators, and functions with return values.

See more about what 2.0.0 brought in the news page.

Note: The 2.0.0 update involved some small breaking changes to the syntax for writing conditions. There is a tool to help auto update scripts available though.

Lots of new commands

Narrat 2.1.0 brought a lot of new commands that were used in the making of the RPG demo.



Math operations

  • Negate numbers: neg 1 -> returns -1
  • Absolute function: abs -1 -> returns 1
  • Min - returns lowest passed number: min 1 2 -> returns 1
  • Max - returns highest passed number: max 1 2 -> returns 2
  • Clamp - returns number between min and max: clamp 1 2 3 -> returns 2 (syntax: clamp [min] [max] [value])

Random generation

  • Random number: random 1 10 -> returns an integer random number between 1 and 10 (inclusive)
  • Random float: random_float 1 10 -> returns a float between 1 and 10
  • Random from args: random_from_args "a thing" "another thing" 2 "things can be any value" -> returns a random item from the list of arguments

Strings

  • Concat: concat "a" "b" -> returns “ab” (Syntax: concat [string1] [string2] [string3]...)
  • Join: join ", " "a" "b" -> returns “a, b” (Syntax: join [separator] [item1] [item2] [item3] ...)

Skills

  • Set level: set_level agility 1 -> sets the level of the skill “agility” to 1
  • Get level: get_level agility -> returns the level of the skill “agility”
  • Get xp: get_xp agility -> returns the xp of the skill “agility”

Utility

  • Log: log $someVariable -> logs the value of the variable $someVariable to the console (Syntax: log [value1] [value2] [value3]...). Can be used to log anything for debugging

See more info in the news page for 2.1.0

Get Narrat

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.