zlua-params
/zlua-params
Calls C# params T[] from Lua by expanding arguments or passing one T[] userdata. Use when a method or constructor ends with params, or when a Lua table or nil was incorrectly passed as the whole array.
- Author
- killop ↗
- Repository
- unity-mcp ↗
- Licence
- MIT
- Last repository change
- 02.11.2026
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 02.11.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
Calls C# params T[] from Lua by expanding arguments or passing one T[] userdata. Use when a method or constructor ends with params, or when a Lua table or nil was incorrectly passed as the whole array.
Original author description
Calls C# params T[] from Lua by expanding arguments or passing one T[] userdata. Use when a method or constructor ends with params, or when a Lua table or nil was incorrectly passed as the whole array.
How it works
SKILL.md has no level-two headings · 40 lines, 278 words
SKILL.md preview
---
name: zlua-params
description: >-
Calls C# params T[] from Lua by expanding arguments or passing one T[] userdata.
Use when a method or constructor ends with params, or when a Lua table or nil
was incorrectly passed as the whole array.
---
# params T[]
A trailing `params T[]` expands, matching C#. A normal `T[]` parameter does not expand. There is no `LuaMarshalType` for params. The old `ParamsTable` name is gone. Creating a real array is `zlua-array`.
| | Normal `T[]` | `params T[]` |
|--|--------------|--------------|
| `Foo(1, 2, 3)` | Not accepted | Expanded to elements of `T` |
| Omit the array | Depends on optional / null | Empty `T[0]`, not `null` |
| One `T[]` userdata | Accepted | Accepted when that single argument is assignable to `T[]` |
| Lua table as the whole array | Array-shaped table only where normal arrays allow it | Rejected |
| Lone `nil` as a null array | Can be a null reference | Rejected. `nil` is one expanded element |
```csharp
static void Sum(params int[] values) { }
static void Prefix(int head, params int[] tail) { }
static void CountNulls(params string[] values) { }
```
```lua
Demo.Sum(1, 2, 3)
Demo.Sum() -- int[0]
Demo.Prefix(0, 1, 2) -- head = 0, tail = { 1, 2 }
Demo.Sum(arr) -- arr is an int[] userdata
Demo.CountNulls(nil) -- string[] { null }
Demo.CountNulls("a", nil, "b")
```
Do not write `Demo.Sum({ 1, 2, 3 })` or `Demo.Sum(nil)` for a null `int[]`. Build an array, then pass it:
```lua
local arr = zlua.new_szarray_by_element_type(zlua.types.int32, 3)
arr[0], arr[1], arr[2] = 1, 2, 3
Demo.Sum(arr)
```
Overload ranking, after equal conversion scores: a whole userdata array beats expansion; a candidate without `params` beats one with `params`. `params` may take any argument count from `minLuaArity` upward. Constructors follow the same rules.
`params` is not supported on `GetFunction` delegates or on C# to Lua delegate bridges. See `zlua-delegate`.
Versions
The database has no other skills named zlua-params.
Database snapshot: 13.11.2026 · package version e878b0b72ca3 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 95zlua-csharp-call-lua
Calls Lua from C# with LuaAppDomain.Initialize and GetFunction. Use when writing a module loader, binding Action or Func to a Lua module method, or reloading scripts with Reset. - 95zlua-array
Creates and indexes C# arrays from Lua with zlua szarray and mdarray helpers, to_table, and to_bytes. Use when Lua needs a T[] or a multidimensional array, or when converting an array to a Lua table or a byte string. - 85Lua C Integration
Use when lua C API for extending Lua with native code including stack operations, calling C from Lua, calling Lua from C, creating C modules, userdata types, metatables in C, and performance optimization techniques. - 90lua-guide
Use when editing general-purpose Lua 5.4+: modules, scripts, configuration. Triggers on `.lua` files and prompts about module patterns, local scoping, metatables, coroutines, error handling, even when the user doesn't say 'Lua'. - 100kernelcad-params
Editable symbolic parameters — param(), params(), ParamRef arithmetic, MCP set_param. Use when the model needs values the agent or studio can change live. - 100lua-guide
Lua language guardrails, patterns, and best practices for AI-assisted development. Use when working with Lua files (.lua), or when the user mentions Lua/LuaJIT/Neovim/Love2D. Provides table patterns, metatable guidelines, coroutine usage, and embedding conventions specific to…