I'm currently having issues to generally access AI functionality from game code.
What I'm currently trying to do is to set an entity's faction from code. My current approach:
Code: Select all
m_pFactionComponent = m_pEntity->GetOrCreateComponent<IEntityFactionComponent>();
m_pFactionComponent->SetFactionId( ??? );
it has the function:
virtual uint8 GetFactionID(const char* szName) const override;
This seems to be exactly what I want. And how do I get the FactionMap? My approach would be from the FactionSystem. If you look at this (line 45): https://github.com/CRYTEK/CRYENGINE/blo ... onSystem.h
you'll find the function
CFactionMap* GetFactionMap() { return &m_factionMap; }
So my approach would be to get the FactionSystem form game code. Then get the FactionMap from it and then use the GetFactionID function to get the faction id by the faction's name.
The problem is: It seems as if I'm not able to access the FactionSystem.
If I write gEnv->pAISystem, it seems as if the pAISystem doen't have any accessable members or functions. Can anyone help me out here? Thanks.
- Jannis