Skip to content

Port Creation Methods

Hippolippo edited this page Oct 17, 2022 · 2 revisions

CreateCommandPort(AgentGestalt, string, string, int)

Namespace: PlasmaModding

Class: CustomNodeManager

public static AgentGestalt.Port CreateCommandPort(AgentGestalt gestalt, string name, string description, int operation);

Parameters:

Required Arguments:

  • gestalt
    The gestalt for the custom node, can be created using PlasmaModding.CustomNodeManager.CreateGestalt
  • name
    The display name for the port in-game
  • description
    The description for the port in-game
  • operation
    The id number that will be used in the [SketchNodePortOperation(x)] attribute in the custom node's Agent class to describe this node being activated

Returns:

  • New AgentGestalt.Port object for a port.

Result:

  • Adds the created port to the gestalt provided through the gestalt parameter


CreatePropertyPort(AgentGestalt, string, string, Behavior.Data.Types, bool, Behavior.Data?, string?)

Namespace: PlasmaModding

Class: CustomNodeManager

public static AgentGestalt.Port CreatePropertyPort(AgentGestalt gestalt, string name, string description, Behavior.Data.Types datatype = Behavior.Data.Types.None, bool configurable = true, Behavior.Data? defaultData = null, string? reference_name = null);

Parameters:

Required Arguments:

Named Arguments

  • datatype - default: Behavior.Data.Types.None
    A value in the Behavior.Data.Types enum that describes the type of data that the port should accept
  • configurable - default: true
    Whether or not the property should be manually editable
  • defaultData - default: null
    Behavior.Data object matching the type specified by the parameter datatype describing what the default value of the property should be
  • reference_name - default: null
    If this value is not null, this string will be used to reference the port when calling PlasmaModding.CustomAgent.GetProperty instead of name, Must use if multiple property ports with the same name are present

Returns:

  • New AgentGestalt.Port object for a port.

Result:

  • Adds the created port to the gestalt provided through the gestalt parameter


CreateOutputPort(AgentGestalt, string, string, Behavior.Data.Types, bool, Behavior.Data?, string?)

Namespace: PlasmaModding

Class: CustomNodeManager

 public static AgentGestalt.Port CreateOutputPort(AgentGestalt gestalt, string name, string description, Behavior.Data.Types datatype = Behavior.Data.Types.None, bool configurable = true, Behavior.Data? defaultData = null, string? reference_name = null)

Parameters:

Required Arguments:

Named Arguments

  • datatype - default: Behavior.Data.Types.None
    A value in the Behavior.Data.Types enum that describes the type of data that the port will output
  • configurable - default: true
    Whether or not the property should be manually editable
  • defaultData - default: null
    Behavior.Data object matching the type specified by the parameter datatype describing what the default value of the property should be
  • reference_name - default: null
    If this value is not null, this string will be used to reference the port when calling PlasmaModding.CustomAgent.WriteOutput instead of name, Must use if multiple output ports with the same name are present

Returns:

  • New AgentGestalt.Port object for a port.

Result:

  • Adds the created port to the gestalt provided through the gestalt parameter