#the activity

1 messages ยท Page 1 of 1 (latest)

tired steppe
#

How does your look at goal message code look like?

brittle dew
#
class BTC_AIMessage_LookAt : SCR_AIMessageGoal // MESSAGE_CLASS(GenerateSendGoalMessage, BTC_AISendGoalMessage_LookAt)
{
    vector m_vLookAtPos; // VARIABLE(NodePort, LookAtPos)

    //------------------------------------------------------------------------------------------------
    static BTC_AIMessage_LookAt Create(vector lookAtPos, SCR_AIActivityBase relatedActivity)
    {
        BTC_AIMessage_LookAt msg = new BTC_AIMessage_LookAt();
        msg.m_vLookAtPos = lookAtPos;
        msg.m_RelatedGroupActivity = relatedActivity;

        return msg;
    }

    //------------------------------------------------------------------------------------------------
    void BTC_AIMessage_LookAt()
    {
        m_MessageType = EMessageType_Goal.LOOK_AT;
    }

}
#

i've made use of AIScript Generator plugin in the script editor

#

hence why you see the comments

#
//---------------------------------------------------------------------------------------
// Generated from class: BTC_AIMessage_LookAt
class BTC_AISendGoalMessage_LookAt : SCR_AISendMessageGenerated
{
    protected static ref TStringArray _s_aVarsIn =
    {
        SCR_AISendMessageGenerated.PORT_RECEIVER,
        "LookAtPos"
    };
    override TStringArray GetVariablesIn() { return _s_aVarsIn; }
    
    override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
    {
        AIAgent receiver = GetReceiverAgent(owner);
        BTC_AIMessage_LookAt msg = new BTC_AIMessage_LookAt();
        
        msg.m_RelatedGroupActivity = GetRelatedActivity(owner);
        
        msg.SetText(m_sText);
        
        GetVariableIn("LookAtPos", msg.m_vLookAtPos);
        
        if (msg.m_bIsWaypointRelated)
            msg.m_RelatedWaypoint = GetRelatedWaypoint(owner);
        
        if (SendMessage(owner, receiver, msg))
            return ENodeResult.SUCCESS;
        else
            return ENodeResult.FAIL;
    }
    
    override bool VisibleInPalette() { return true; }
}
tired steppe
#

Yeah... Goal messages are kinda strange to look at. lol

brittle dew
#

the resulting codes of that plugin

brittle dew
tired steppe
#

Yes they rly are...

#

I think all the goal messages are defined in the AI Character.
Like ChimeraAIAgent?

brittle dew
#

AIAgent_Full and SCR_AIGroup hold the goals that will be parsed by the AIUtilityComponent

tired steppe
#

Exactly.

brittle dew
#

vanilla goals are all defined in SCR_AIGoalReaction.c

tired steppe
#

Right.

brittle dew
#
  • HandleAmmo et cetera
brittle dew
#

which ticks without idling

tired steppe
#

yes.

brittle dew
#

everything is transferred to the group's soldiers by the Group.bt handling, when a waypoint is issued, HandleWP.bt runs, then HandleWP.bt checks for a behavior tree inside of the waypoint parameters and executes the found bt

#

which it's doing that without any problem

#

i'm probably getting a FAIL somewhere aborting the loop

#

but breakpoints in bts suck ass

tired steppe
#

Yes probably.

tired steppe
brittle dew
#

i'll commit to some more testing if i have any success i'll tell you

tired steppe
#

Yeah with this stuff i'm pretty much lost.

brittle dew
#

same

tired steppe
#

Well you will get there.

#

I never rly tryed it to begin with.

brittle dew
#

and the radio silence of the devs regarding this topic is testimony to the fact that they might be in a bit of pickle too

#

it's very old code

#

there's semicolons ending the class brackets just like it's done with structs in C

#

functions with names separated from their arguments

tired steppe
#

lol

brittle dew
#

it's PRETTY old

tired steppe
#

Well it was MUCh worse when the game first released.

#

Todays code and bts. are pretty advanced compared to it.

brittle dew
#

still spaghetti though

tired steppe
#

๐Ÿ™‚

#

So good luck with this! ๐Ÿ‘

#

And let me know what you did wrong.

brittle dew
#

i will

#

thanks

brittle dew
#

well i got it to work somewhat

#

Autocomplete has to be off on the waypoint

#

for it to keep looping

#

no need for repeater

#

as Autocomplete on wp is unchecked, Group.bt will continue executing the action(goal) in the queue