DDS Script Extensions

版本 v1.1.0·更新於 2026-09-12

Lua driven script extensions for the DDS system to enable dynamic scripted text

模組介紹 作者原文

Piepieonline's DDSScriptExtensions

Lua driven script extensions for the DDS system to enable dynamic scripted text. Looks for JSON files named ddsscripts.sod.json in the Bepinex mods directory and subdirectories.

ddsscripts.sod.json Format

This is a subset taken from the default ddsscripts.sod.json file (/DDSContent/ddsscripts.sod.json) that comes with this mod:

{

"values": {

"citizen": {

"selected_random": {

"seed": "tonumber(inputObject.seed)",

"script": "return 'Random number is: '.. math.random(0, 10)"

},

"owner": {

"script": "return 'Current location owner is: '.. inputObject.currentGameLocation.thisAsAddress.owners[0].citizenName"

}

},

"random": {

"alpha6": {

"script": "return string.format('#%06X', math.random(0, 0xFFFFFF))"

}

},

"city": {

"player_name": {

"script": "return Player.citizenName"

}

},

"time": {

"twohourslater": {

"script": "return SessionData.TimeString(tonumber(CSToString(inputObject)) + 2, true)"

}

}

},

"scopes": {

"citizen": {

"vmail_participant_a": {

"scope": "citizen",

"script": "return inputObject.thread.participantA > -1 and CityData.citizenDictionary[inputObject.thread.participantA] or nil"

}

}

}

}

  • At the top level, scripts are split into scopes (contain other scopes and values) and values
  • Each script is placed into an existing scope, which means that the relevent scope object will be passed in as inputObject (So for a letter, it'll have the evidence scope).
  • The next level are keys that will be called from the DDS system, for example:
  • values
  • |writer.custom_selected_random| - Will generate a random number for each civilian, the same each time it is called
  • |writer.custom_selected_random_1| - Will call the above function, but generate a different number with an adjusted seed
  • |writer.custom_owner| - Will show the name of the owner of the current location of the writer
  • |random.custom_alpha6| - Will generate a random 6 digit hex code each time the text is shown
  • |city.custom_player_name| - Will show the player's citizen name
  • |killer.lastmurder.time.custom_twohourslater| - Will show the time (in 24 hour time) 2 hours after the previous murder was committed. Time is represented as a float where the integer component is hours since world start.
  • scopes
  • |customscope_vmail_participant_a.fullname| - Will set the scope to the first participant in the vmail chain, and then get the fullname value (Only valid in a vmail scope, which is based on the citizen scope)

When referencing scope scripts from the DDS system, each needs to be prefixed with 'customscope_'.

When referencing value scripts from the DDS system, each needs to be prefixed with 'custom_'. If a numeric postfix is attached, the generated seed will be offset by this number.

  • Instead of an inline script, a value or scope can specify "file": "path/to/script.lua", relative to the directory containing ddsscripts.sod.json
  • _caller is available in every script, and contains the name of the script being run without the custom_/customscope_ prefix
  • _cache is a Lua table available in every script for storing state between calls. It is cleared each time a city is loaded

Debugging

There is a debugging configuration flag to log a lot of information from each script execution.

Scripts can also be reloaded at runtime by running DDSScriptExtensions.DDSScriptExtensionsPlugin.ReloadScriptList() in UnityExplorer

Manual Installation

  • Ensure you have BepInEx BE installed
  • Extract the mod to ".\BepInEx\plugins\", so you should have ".\BepInEx\plugins\DDSScriptExtensions\DDSScriptExtensions.dll"

Source:

安裝與使用 安裝:按包內說明操作

  1. 解壓本站下載的壓縮包,先讀包內的 readme / 說明檔案。
  2. 多數模組依賴遊戲的模組載入器:常見做法是用社群模組管理器(如 r2modman)選中本遊戲安裝,由管理器自動處理載入器與依賴。
  3. 手動安裝時,把模組檔案放進遊戲目錄下對應的 Mod / plugins 資料夾。
  4. 啟動遊戲確認載入成功;帶「前置依賴」的模組需要把依賴一併安裝。

不同模組的安裝位置差異較大,包內說明是最可靠的依據。

前置依賴

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

BepInEx-BepInExPack_IL2CPPPiepieonline-Asset_Bundle_Loader

檔案與校驗

檔案名稱
DDS_Script_Extensions-1.1.0.zip
檔案大小
181.5 KiB