{"record":{"id":"c21db09744a86126","repo":"egametang/ET","slug":"condition-node-params-field-not-found-node-getty","errorCode":null,"errorMessage":"condition node params field not found: {node.GetType().FullName}.Params","messagePattern":"condition node params field not found: (.+?)\\.Params","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"Packages/cn.etetet.conditionexpr/Scripts/Model/Share/ConditionExprParser.cs","lineNumber":302,"sourceCode":"            if (fieldInfo == null)\n            {\n                throw new Exception($\"condition node owner key field not found: {node.GetType().FullName}.{nameof(BTNumericCompare.OwnerKey)}\");\n            }\n\n            if (fieldInfo.FieldType != typeof(string))\n            {\n                throw new Exception($\"condition node owner key field must be string: {node.GetType().FullName}.{nameof(BTNumericCompare.OwnerKey)}\");\n            }\n\n            fieldInfo.SetValue(node, ownerKey);\n        }\n\n        private void SetParamsField(BTCondition node, string[] paramValues)\n        {\n            FieldInfo fieldInfo = node.GetType().GetField(\"Params\", BindingFlags.Instance | BindingFlags.Public);\n            if (fieldInfo == null)\n            {\n                throw new Exception($\"condition node params field not found: {node.GetType().FullName}.Params\");\n            }\n\n            if (fieldInfo.FieldType != typeof(string[]))\n            {\n                throw new Exception($\"condition node params field must be string[]: {node.GetType().FullName}.Params\");\n            }\n\n            fieldInfo.SetValue(node, paramValues);\n        }\n\n        private void AddSequenceChild(BTSequence sequence, BTNode child)\n        {\n            if (child is BTSequence childSequence)\n            {\n                sequence.Children.AddRange(childSequence.Children);\n                return;\n            }\n","sourceCodeStart":284,"sourceCodeEnd":320,"githubUrl":"https://github.com/egametang/ET/blob/5cab01f7a8bee5f49f4781eebe9e2b1c6d7ebe0f/Packages/cn.etetet.conditionexpr/Scripts/Model/Share/ConditionExprParser.cs#L284-L320","documentation":"Thrown by SetParamsField when a condition expression used the parameter-call syntax `NodeName(Param1, Param2)` (the dedicated condition node form) but the selected node type has no public instance field named `Params`. Per AGENTS.md, only nodes that declare `public string[] Params` may use parenthesized parameters.","triggerScenarios":"Writing `HP(Friend1) > 0` against a node that has no Params field; registering a dedicated condition node and forgetting the Params field; renaming it to `Args`.","commonSituations":"Designer assumes any node accepts parameters and writes `NodeName(target)`; a custom node author copies a numeric-compare node template that lacks Params.","solutions":["Add `public string[] Params;` to the node class if it is meant to accept parameters.","If the node is not parameterized, remove the parenthesized arguments from the expression and reference it in the bare form."],"exampleFix":"// before\n[ConditionVariable(\"Distance\")]\npublic class DistanceNode : BTCondition { /* no Params */ }\n// used as: Distance(Friend1) > 0\n// after\n[ConditionVariable(\"Distance\")]\npublic class DistanceNode : BTCondition\n{\n    public string[] Params;\n}","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"static bool HasParamsField(Type t) =>\n    t.GetField(\"Params\", BindingFlags.Instance | BindingFlags.Public) != null;","tryCatchPattern":null,"preventionTips":["Only use `NodeName(args)` syntax with nodes that declare `public string[] Params;`.","Lint expressions to verify parameter syntax is only used on Params-capable nodes.","Document per node whether it is parameterized."],"tags":["csharp","unity","conditionexpr","reflection","attribute"],"backgroundTag":null,"analyzedSha":"5cab01f7a8bee5f49f4781eebe9e2b1c6d7ebe0f","analyzedAt":"2026-08-13T21:10:40.377Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}