Skip to content

Version 1.0.0 - Experimental 5

Pre-release
Pre-release

Choose a tag to compare

@Elektryk-Andrzej Elektryk-Andrzej released this 06 Jun 10:22
· 1 commit to main since this release

πŸš€ SER 1.0 update (experimental 5)

This is probably the last experimental update before version 1.0 is released.
Below, you will find the changelog that will most likely be used for the official 1.0 update.

This update represents a complete paradigm shift for the SER language. The flat, unstructured method architecture of v0.15.1 has been replaced with dot-notation namespacing, direct object manipulation, and dedicated syntax rules.

Caution

If you are upgrading from v0.15.1, your scripts will require rewriting.

πŸŽ‰ Community Shoutout

Luke & Jraylor - major SER sponsors! The 1.0 update wouldn't be possible without their support!

@RetroReul - newest SER contributor! Retro is behind some of the new methods and properties, glad to have you on our team! :)


1. Syntax & Operators Overhaul

The Arrow Operator (->) & Native Properties

The language now automatically hooks into underlying game objects, exposing their properties natively. You can drill through multiple objects in a single line, entirely replacing the old Info wrapper methods (like DamageInfo, ItemInfo, DoorInfo).

  • Direct Access: $name = @plr -> name completely replaces $name = {@plr name}.
  • Native Property Modification: You can now directly alter the game state using assignment expressions! If a property is settable, just assign it: *generator -> isOpen = true.
  • Chaining: Drill down through data seamlessly: $nameLengthOdd = @sender -> name -> length -> isOdd.

Mathematical Expressions

The "bracket tax" on mathematical operations has been eliminated. Math no longer requires wrapping in parentheses to be evaluated.

  • Old: $five = (2 + 3)
  • New: $five = 2 + 3

2. Scope & Block Management

Inline Block Parameters (with)

Looping and function definitions now use the with keyword to attach parameters or iterators directly, cleaning up visual clutter.

over @all with @plr
    Print {@plr -> name}
end

Ephemeral Variables (ephm)

Introduced the ephm keyword to define variables that automatically delete themselves the moment their current block (like a func or if statement) finishes executing, preventing memory leaks in complex scripts.

3. Native Keywords vs. Methods

Core logic and memory management have been moved out of the method parser and into the engine's low-level keywords for better performance.

  • Timing Flow: Wait 5s is now the native keyword wait 5s.
  • Conditional Flow: WaitUntil ... is now the native keyword wait_until ....
  • Memory Management: The old PopVariable $var method has been replaced by the native delete $var keyword.
  • Probability Flow: Added the native chance statement block to streamline random probability checks without needing math blocks.

4. The Great API Namespacing (Method Restructure)

Version 1.0 abandons the flat, cluttered global method list. Hundreds of methods were renamed and grouped into logical namespaces using dot-notation, while redundant methods were purged entirely.

  • Audio System (Audio.* & Speaker.*): LoadAudio is now Audio.Load. CreateGlobalSpeaker is now Speaker.CreateGlobal.
  • Admin Toys (Toy.*): CreateToy is now Toy.Create. TPToyPos is now Toy.TPPosition.
  • Collections (Coll.*): CollectionInsert is now Coll.Insert. EmptyCollection is now Coll.Create.
  • Discord (Discord.* & Embed.*): DiscordMessage is now Discord.CreateMessage. DiscordEmbed is now Embed.Create.
  • Web & Data (HTTP.*, JSON.*, DB.*): HTTPGet is now HTTP.Get. AppendDB is now DB.Add.
  • Text (Text.*): PadText is now Text.Pad. SubText is now Text.Slice.

5. New Core Frameworks

Brand new structural features were added to extend what SER scripts are capable of building.

  • Dictionaries (Dict.*): A full C#-style key-value mapping system natively implemented (Dict.Add, Dict.Contains, Dict.Create, Dict.Get, Dict.Remove).
  • Custom Roles (CRole.*): Base-game custom role handling without multi-file setups. Includes CRole.Register, CRole.SetCallbacks, and native framework integrations like CRole.CreateBracketSpawnSystem.
  • Configurations (Config.*): Scripts can now generate and read personalized configuration options natively (Config.GetOption, Config.Read).
  • Unified Map Queries: Added a singular, high-performance GetFromMap method that queries any object layout or structural element in the active round instance.

6. Player Control & Interactions

  • Native Base-Game Effects: Full status-effect bindings without requiring external EXILED plugin hooks (GiveEffect, ClearEffect).
  • Stamina & Actions: Added direct control over stamina (Stamina method) , jump height (Jump) , and combat visuals (ShowHitMarker).
  • Targeting & Rulesets: Added AddDamageRule / RemoveDamageRule and AddTeslaIgnoreRule / RemoveTeslaIgnoreRule.
  • Network / IP Data: Integrated GetIPInfo and GetIPInfoWithKey for proxy and connection validation directly inside scripts.

7. Compiler Safety & Tooling

  • Strict Compile-Time Linting: Invalid expressions inside text strings are now caught immediately at compile time. For example, if you write "my name is {get @x name}", the compiler will throw an error immediately, enforcing the correct v1.0 syntax: "my name is {@x -> name}".
  • Nested Bracket Engine Fix: The underlying text tokenizer now utilizes balancing groups, safely compiling deeply nested curly brackets (e.g., "{Round {*evDamageHandler -> damage}}") without breaking string parsing.
  • SER Visual Editor: Launched a standalone web application (available on GitHub) providing a visual node-based workspace to construct scripts without layout/syntax text editing issues.

🌟 Real-World Examples: v1.0 Syntax in Action

To give you a vague idea of how clean and readable SER scripting has become, here are a few snippets utilizing the new v1.0.0 syntax!

Example 1: Ephemeral Variables & Namespaces (Discord Webhooks)

Using the new ephm keyword to automatically clean up variables, and the new dot-notation namespaces for Discord embeds.

func *GetDiscordMessage
    # variables using 'ephm' are ephemeral and will be deleted after the function ends
    ephm $title = "{ServerInfo name} status"
    ephm $content = "There are {AmountOf @all} players on the server:{Show @all name "<br> -" true}"
    
    return Discord.CreateMessage _ $title _ {Embed.Create $title $content}
end

# ... later in the script ...
*msg = run *GetDiscordMessage
Discord.EditMessage $url $messageId *msg

Example 2: The chance block & Arrow Syntax (Chaos Coin)

A clean implementation of random probabilities using the new chance block, and direct object evaluation using the -> operator.

# 50% chance to lose the coin
chance 50%
    Hint @evPlayer 3s "<color=#ff5555>Your coin has turned into dust..."
    AdvDestroyItem {@evPlayer -> heldItemRef}
end

# Check if the player's role changed during a countdown
if {@evPlayer -> role} isnt $initRole
    ClearCountdown @evPlayer
    SetPlayerData @evPlayer "coin locked" false
    stop
end

Example 3: Native Custom Roles Framework

Registering custom roles natively in one file using the new CRole.* framework.

!-- OnEvent WaitingForPlayers

*spawnSystem = CRole.CreateChanceSpawnSystem ClassD 20%
CRole.Register janitor "LCZ Janitor" ClassD *spawnSystem
!-- OnCRole spawned
-- forRoles janitor

TPRoom @evPlayer LczToilets
GiveItem @evPlayer KeycardJanitor