ReGoap
ReGoap copied to clipboard
Need of more documentation on Actions
Hey,
I just started using your library. Loved the Debug view and the sensors implementation. I wanted to try out my first implementation of performing a waypoint follow. Decided to set Goal as Patrol and Actions were to be designed accordingly. I went though the doc it looked simple. But the example got me quite confused. in the FSM-Example Take GenericGoToAction.cs
The calss has something called IReGoapActionSettings<string, object>
public override IReGoapActionSettings<string, object> GetSettings(IReGoapAgent<string, object> goapAgent, ReGoapState<string, object> goalState)
{
settings = new GenericGoToSettings
{
ObjectivePosition = GetWantedPositionFromState(goalState)
};
return base.GetSettings(goapAgent, goalState);
}
public override ReGoapState<string, object> GetEffects(ReGoapState<string, object> goalState, IReGoapAction<string, object> next = null)
{
var goalWantedPosition = GetWantedPositionFromState(goalState);
if (goalWantedPosition.HasValue)
{
effects.Set("isAtPosition", goalWantedPosition);
}
else
{
SetDefaultEffects();
}
return base.GetEffects(goalState, next);
}
And these two Blocks of code just confused me. Could you caret o explain why are we overriding GetEffects and whats basically happening here
And could be kind enough to add a little more details on Actions in ReGOAP
Thanks