Skip to main content

Posts

Showing posts from July, 2026

Verse, control flow

 In Verse, control flow works differently than in most traditional programming languages. It is heavily tied to the concept of Failure , where expressions don't just return true or false —they either succeed (and produce a value) or fail (and halt execution in that context). [1] This tutorial covers the essential control flow structures in Verse: conditional expressions, loops, and failure contexts. [2, 3] 1. Conditionals: if-else In Verse, if is an expression, meaning it can return a value. The condition inside an if statement is a failure context . If any expression inside the condition fails, the if block is skipped, and the else block runs. [4, 5] Basic if-else Syntax IsGameOver : logic = false if (IsGameOver?): Print("Game Over!") else: Print("Keep Playing!") Note the ? after IsGameOver . In Verse, to check a logic variable in a condition, you must use the ? operator to test if it succeeds (is true). [6, 7] Using if as an Expression B...

Mastering Verse Primitive Types

Verse’s basic types fall into a clean set of primitives optimized for deterministic game logic in Unreal Editor for Fortnite (UEFN). This tutorial unpacks each primitive type and demonstrates how to apply them in real-world game scripts. 1. Numeric Types Numbers form the foundation of gameplay logic—tracking positions, character stats, timers, and score thresholds. A. int (Integer Numbers) An int represents a whole number that can be positive, negative, or zero. At runtime, Verse integers support arbitrary precision. However, when you write literal numbers directly in your source code, they must fit within a standard 64-bit signed range. Standard arithmetic applies ( + , - , * ), but standard division ( / ) yields a rational type instead of an int . Health : int = 100 Damage : int = 25 RemainingHealth := Health - Damage # Results in 75 B. float (Decimal Numbers) A float handles fractional and decimal numbers using 64-bit IEEE-754 floating-point math. It includes native support for ...