ServerDiceRoll

版本 v1.0.1·更新於 2024-01-22

A Valheim server mod to add shared dice roll functionality.

截圖 共 1 張

模組介紹 作者原文

Valheim Server Dice Roller

A Valheim server mod to add shared dice roll commands that show up in player's message hud.

Usage

With this plugin enabled on the server, players can use the following three commands from the chatbox.

Server operators can customize the prefix and name of each command, so check with them if you are having trouble.!roll

  • Rolls a die between 1 and ``.
  • If no size is specified a default value is used (by default, 100, but this is configurable).
  • Examples:

-!roll -> Soandso rolled a 100 sided die and got a 73!

-!roll 20 -> Soandso rolled a 20 sided die and got a 10!!award

  • Randomly picks between the names specified in ``.
  • Names should be comma seperated and cannot have spaces in them. They don't have to be in-game player names. For example: "Alice,Bob,Charlie,Dave,Ernie".
  • Optionally, anything that comes after the list of recipients will be passed along as a description of the item(s) being awarded.
  • Examples:

-!award Alice,Bob,Charlie ->

Soandso asks Odin to decide if Alice, Bob, or Charlie is worthy...

Odin picks Alice!

-!award Alice,Bob,Charlie some extra silver ->

Soandso asks Odin to decide if Alice, Bob, or Charlie is worthy of \"some extra silver\"...

Odin awards "some extra silver" to Charlie!!results

  • Re-sends the most recent history back to the player who issued the command.
  • Example:

-!results ->

Soandso rolled a 100 sided die and got a 92!

Johndoe rolled a 100 sided die and got a 36!

Features

A feature common to MMO's is some kind of "dice roll" command, to give people a fair way to randomly decide on who gets a rare piece of loot.

This mod adds this to a server in a way that is usable by all players. There are other mods out there that do this client-side,

but having the rolls handled by the server allows the server to serve as a neutral, trustworthy 3rd party (meaning, you don't have to rely on another player's

client-side roll mod being honest).

Configuration

All of the options are fully documented in the config file that the plugin generates. Here are some extra notes:

Colors

Options in the [Color] section allow you to customize the color of messages by their type.

You can use HEX color codes (RGB, and RGBA), or the following color names: black, blue, green, orange, purple, red, white, and yellow.

Setting the option to an empty string disabled color overriding and uses the Valheim default. For more information see Unity's RichTextColor docs.

Message Location

Under the hood this mod uses the Valheim MessageHud to send messages to clients. The two possible locations for messages (at time of writing these docs)

are TopLeft and Center. Both have tradeoffs.

The TopLeft option is where Valheim shows messages like "Unloading unused assets", and "Saving...".

The Center option is where Valheim shows messages like "The forest is moving".

TopLeft messages are more out of the way (i.e. less annoying to other players), but they fade fast and are harder to read.

Center messages, conversely, take up more screen space and are easier to read, but are (probably) more annoying for uninvolved players and can only show 5 lines at a time.

The default is TopLeft as it is the least intrusive option. But if you are playing on a server with just friends, give Center a try.

Why can't roll messages go to the chatbox? That would obviously be better!

Unfortunately it is not possible for the server to send chats to clients in Valheim (at least not without adding dependencies on other mods),

as all chats must come from a real/authenticated user. If you can figure out a workaround, submit a PR or let me know.

Installation

BepinEx for Valheim is required for this plugin to work.

Install from your favorite mod manager, or manually by following these instructions:

  • Download and extract the build artifact for the latest release
  • Place the bbar.Mods.ServerDiceRoll.dll file into \Bepinex\plugins
  • The first time the game starts with the plugin loaded, it will generate a config file: \

安裝與使用 安裝:BepInEx 外掛

  1. 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
  2. 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
  3. 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
  4. 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。

帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。 多人連線時,主機與所有用戶端需要安裝一致的模組。

前置依賴

下面這些內容需要先安裝,否則該模組不會生效:

denikson-BepInExPack_Valheim

檔案與校驗

檔案名稱
ServerDiceRoll-1.0.1.zip
檔案大小
16.7 KiB