Hello,
I want to try and get my custom decision node to go to a waypoint only if a variable I detect in a dialogue system plugin from unity is true.
Here is what I have:
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using RAIN.Action;
using RAIN.Core;
using PixelCrushers.DialogueSystem;
[RAINDecision]
public class convo : RAINDecision
{
private int _lastRunning = 0;
public override void Start(RAIN.Core.AI ai)
{
base.Start(ai);
_lastRunning = 0;
}
public override ActionResult Execute(RAIN.Core.AI ai)
{
ActionResult tResult = ActionResult.FAILURE;
if (DialogueLua.GetVariable ("end").AsBool) {
tResult = ActionResult.SUCCESS;
}
for (; _lastRunning < _children.Count; _lastRunning++) {
tResult = _children [_lastRunning].Run (ai);
if (tResult != ActionResult.SUCCESS)
break;
}
return tResult;
}
public override void Stop(RAIN.Core.AI ai)
{
base.Stop(ai);
}
}
Currently, as soon as I start the level, the move and animate child nodes immediately trigger and the NPC goes running. I want to have them conditionally trigger based on the value from the conversation system DialogueLua.GetVariable (“end”).AsBool.
This is my first post, so please excuse any noob mistakes I might be making, any advice and assistance would be greatly appreciated.
P.S. I asked this in an old thread a couple days back, but it got buried, so I’m starting a new one.
-
This topic was modified 1 year, 2 months ago by jayx2thez.