vikingcode wrote:
If I need to explain more than that, then this is the wrong forum for you. It is a general programming question and has nothing specifically to do with Horde3D.
Why did you post a general programming question in the "Tools" forum? You could just as well have posted it in the "Free Discussion".
imranhabib wrote:
With respect ! you are wrong I tried that yesterday but it doesn't work , creating an instantiation and then accessing that function with the object created , it doesnt work that way.
I didn't say to create an instantiation.. I said you need to reference it from an object of that class.
I haven't even used the game engine itself yet, but I had a quick look for you.. look further below for my insight..
imranhabib wrote:
and i think no one compelled you to answer me if you think that i am a low level programmer.
I guess there are people who are begginers in the Horde3d and they need guidance from experienced people like you but i don't know why do you criticise instead of guiding. If Horde3D is only for people who know each and everything since their birth then i am not amongst those ...
its a kind request to you that don't degrade your new coming students, May be each an every student is an asset in future , so let every1 learn from you.
I didn't actually criticise you even though I wanted to constructively. I can see that you do want to learn and I don't think you are stupid. Having said that I don't know how smart you are, and I think you are inexperienced.
I don't want to force you away from Horde3D but I must say that Horde3D is not for beginners.
The errors you are experiencing are trivial. That doesn't mean I know how to answer all your questions but it means I know the problem that needs fixing.
imranhabib wrote:
Anyways if you think you know evrything then let me know now the answer as i cleared you that creating object of that class doesnt work...
I am not experienced with Horde3D, I just have a University degree in Computer Science. I am not in the Horde3d team, I'm a user like you.
I understand a lot about programming and I can eventually work everything out myself, but I don't really know that much yet and I don't have much experience with different libraries.
imranhabib wrote:
in order 2 re explain my question .... i have a function get entity position in AgentActionComponent i want it in my application to get entity postition what should i do
If you look in the game engine source code, you will find a file called "GameEngine_AgentAction.cpp"
The method below is in that file. This method (and every method in that file) demonstrates how to access components.
Code:
AGENTACTIONPLUGINEXP void Agent_goToEntity( unsigned int entityWorldID, unsigned int dest_entityWorldID, float speed )
{
AgentActionComponent* component = 0;
GameEntity* entity = GameModules::gameWorld()->entity(entityWorldID);
if( entity && ( component = static_cast<AgentActionComponent*>(entity->component("AgentActionComponent")) ) != 0 )
{
component->goToEntity( dest_entityWorldID, speed );
}
}
Can you work it out from that?
For the game engine you need to link the components in the project settings. If you look at the AAA demo example and check the dependency settings and project settings you will see that the AgentActionComponent is referenced.
Regards,
vikingcode