#the activity
1 messages ยท Page 1 of 1 (latest)
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; }
}
Yeah... Goal messages are kinda strange to look at. lol
the resulting codes of that plugin
they are incomprehensible pretty much
Yes they rly are...
I think all the goal messages are defined in the AI Character.
Like ChimeraAIAgent?
AIAgent_Full and SCR_AIGroup hold the goals that will be parsed by the AIUtilityComponent
Exactly.
vanilla goals are all defined in SCR_AIGoalReaction.c
Right.
Groupt.bt and Soldier.bt will then every engine tick (they have no idle) their trees to see if:
- new actions? do it
- new waypoint? run the HandleWP.bt
- HandleAmmo et cetera
Soldier is more of a slave to Group.bt
They are using RUNNING.
which ticks without idling
yes.
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
Yes probably.
True. ๐
i'll commit to some more testing if i have any success i'll tell you
Yeah with this stuff i'm pretty much lost.
same
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
lol
it's PRETTY old
Well it was MUCh worse when the game first released.
Todays code and bts. are pretty advanced compared to it.
still spaghetti though