Skip to content

Need of more documentation on Actions  #19

@deltamish

Description

@deltamish

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions