Page MenuHomeFeedback Tracker

BehaviourGroupInfectedPack cast return NULL
New, UrgentPublic

Description

Is it normal that this code return NULL on behaviourGroupInfectedPack? (script in 4_world)

AIGroup m_AIGroup = GetGame().GetWorld().GetAIWorld().CreateGroup( "MyIaGroup" ); //=> ok AI group is created
BehaviourGroupInfectedPack behaviourGroupInfectedPack;
Class.CastTo( behaviourGroupInfectedPack, m_AIGroup.GetBehaviour() ); //=>  behaviourGroupInfectedPack=NULL

Details

Severity
Feature
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Category
General

Event Timeline

Liven created this task.Aug 25 2020, 2:03 PM

Did you configure the Infected you're spawning to use that behavior? By default they don't use that, it's what the Survivor Games Infected used though.

komer added a subscriber: komer.Aug 25 2020, 5:26 PM
komer added a comment.Aug 25 2020, 5:31 PM

Jacob_Mango, do you mean in the config or somewhere else in the scripts?

Liven added a comment.Aug 25 2020, 8:52 PM

Jacob_Mango, I didn't.
Do you have any hint to activate this feature?
I looked at SG and Expansion code but didn't find where configure the infecteds.
Would like so much use this on my Pvzmod Dark Horde.

Liven added a comment.Aug 26 2020, 4:50 PM

Jacob_Mango, thanks. I will dig on that.

Liven added a comment.Aug 28 2020, 8:31 PM

Jacob_Mango, I tried many many things but still can't figure out how this system works.
I don't have the “null” problem any more (the group is created with a BehaviourGroupInfectedPack) but I think my zombies are still not link to the group behavior because they continue to move randomly.
I looked at SG and Expansion code and tried to adapt config.cpp files (in \IA\, \data\aiconfigs\ and \Characters\) to link group behaviours to zombies but didn't succeed.

It is sad to not be able to tell to a zombie “go here” (not necessary with group behavior). So many things could be done with just this feature.

@DayzDevs, some documentation, example or help would really be welcome.

Hunterz added a subscriber: Hunterz.EditedJun 23 2022, 1:33 PM

I already figured that.

in class GroupBehaviourTemplates
is needed have something like below

 class GroupBehaviourTemplates
{
	class YoursInfectedGroupBeh
	{
		type = "InfectedPack";
...

Yours CfgAIBehaviours

should look like this:

class CfgAIBehaviours
{
        class YoursAwesomeBehaviour
	{
		HeadLookBoneName="pin_lookat";
		teamName="Zombies"; 
		defaultGroupTemplateName="YoursInfectedGroupBeh";
		class BehaviourHLInfectedPack
		{
...

Then it started working. I am using this way for control waypoints of my dog.

Unfortunately got another issue: https://feedback.bistudio.com/T166175