Hi,

I am working with ORK 3/ Makinom 2 beta version. I created a custom schematic node and want to allow for arguments (that will be used inside Execute function). How do I feed the arguments from the Editor ? "public", "[SerializeField]private" don't seem to work.

// Code Snippet

[EditorHelp("Speak","Uses TTS voice to speak supplied text","Must provide voice type,voice line and Audio source")]
[NodeInfo("Text-to-Speech")]
public class SpeakNode : BaseSchematicNode
{
public string voice_name;
public string voice_lines;
public AudioSource voice_actor;

public override void Execute(Schematic schematic){

// To be used here
}
}


Thanks
  • public is correct, but you need to assign values to your strings, e.g.:

    public string voice_name = "";
    You can also use the various value selection fields, e.g.:
    public StringValue<SchematicObjectSelection> name = new StringValue<SchematicObjectSelection>();

    However, AudioSource can't be used here - you can't store references to components of game objects in your scene (or prefabs), as the schematic doesn't have any connection to that.

    Instead, you'd use an object selection (e.g. to use the Machine Object or an actor) and get the component from that:
    public SchematicObjectSelection onObject = new SchematicObjectSelection();
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Thanks. This works. However, there is another issue that is bugging me.

    I am trying to setup an Event Handler inside the SchematicNode, which needs to get triggered for execution of the node to begin.

    image

    I am using an asset for TTS voice-over, which provides Speaker.Instance Singleton, with "OnSpeakComplete" event to confirm that the voice-line is over. The event will act as the trigger to move to next node (that handles next voice-line). This doesn't work and I don't know how exactly I must handle the event handler - speakComplete. Please help
  • Based on the code, you only add your method to the OnSpeakComlete event handler, but don't call anything to actually start whatever it should do.

    Using += or -= on event handlers is only adding or removing functions to them, they don't cause anything else, e.g. starting your text to speech functionality.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Thanks. I got it to work. The schematic can be made to wait and be triggered by Events. That is powerful.
Sign In or Register to comment.