Skip to content

Noir 1.10.0

Compare
Choose a tag to compare
@Cuh4 Cuh4 released this 08 Jul 07:50
· 187 commits to main since this release

πŸ“š Details

Version: 1.10.0

❔ Installation

Check out the documentation for information on how to install and use Noir in your addon.

πŸ’¬ Description

A bunch of things have been added in this release. All of these additions should not impact your addon whatsoever if you was to update Noir.

Additions

  • Added LongDescription, ShortDescription, and Authors attributes to the NoirService class. You can optionally fill out these attributes by passing new arguments to Noir.Services:CreateService().
  • Added descriptions and credit to every built-in service and library.
  • Added Noir.Services:RemoveService().
  • Added :GetSaveData() method to the NoirService class. Now you can directly modify the table instead of using :Save(), :Remove() and :Load().
  • Added a command example to the comment description of Noir.Services.CommandService:CreateCommand().
  • Added a :Notify() method to the player class. This allows you to easily send notifications to players.
  • Added Noir.IsDedicatedServer. Noir's bootstrapper automatically sets this upon Noir starting. As a result, do not modify this yourself. Treat it as a read-only variable.
  • Added a basic type checking module to Noir accessible via Noir.TypeChecking.
  • Added type checking to every Noir function and method. This took a while.
  • Added Noir.Services:FormatService(). This is used in the bootstrapper to display the authors of services that are being initialized/started. It is also used to show whether or not a service is built-in.
  • Added :GiveItem() to the NoirObject class. This method allows you to give SW characters items, including players.

Fixes

  • Fixed Noir.Services.PlayerService.OnLeave event being fired for all players when onDestroy was called for an addon reload. Unfortunately, OnLeave doesn't get called at all if players leave because the save was exited, or because players left while your addon errored. This will have to stay the case for now unfortunately.

Changes

  • When an object gets unloaded and removed from the game, it is removed from g_savedata. This is to prevent memory leaks.
  • Libraries are now classes instead of raw tables. The above attributes have also been added to the class and can simiarly be filled out by passing new arguments to Noir.Libraries:Create()
  • The :ServiceInit() method is no longer mandatory for services. Likewise, warnings will no longer appear if a service doesn't have the :ServiceStart() method.
  • If the addon is being ran in a dedicated server, the built-in PlayerService will no longer count the server itself as a player. This is another Stormworks quirk that Noir now builds around. :-)

Removals

  • Removed unnecessary logging when Noir starts (eg: when an object is loaded from service save data, when a player is loaded from server.getPlayers(), etc).