Horde3D

Next-Generation Graphics Engine
It is currently 24.11.2024, 10:41

All times are UTC + 1 hour




Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: 24.03.2011, 16:15 
Offline

Joined: 09.02.2011, 17:02
Posts: 83
hello Evry 1
I have come accross a problem !actually AgentActionComponent provides a function getEntityPosition(characterid)...

i need to use this function to get the current position of character, but i am having problem using it,...
I call this function in this way

*******************************************************************
Vec3f currentPos = AgentActionComponent::getEntityPosition(m_characterID2);
*******************************************************************

but it doesnt recognize AgentActionComponent .. when i take my cursor to AgentActionComponent it says non static member reference
must be relative to a specific object ....

any sugestions..!
Regards Imran Habib


Top
 Profile  
Reply with quote  
PostPosted: 25.03.2011, 01:57 
Offline

Joined: 08.11.2010, 10:46
Posts: 35
You are calling the function as if it is a static method. It is a class method, so you need to reference it from an object of that class.
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.

Regards,
vikingcode


Top
 Profile  
Reply with quote  
PostPosted: 25.03.2011, 15:39 
Offline

Joined: 09.02.2011, 17:02
Posts: 83
vikingcode wrote:
You are calling the function as if it is a static method. It is a class method, so you need to reference it from an object of that class.
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.

Regards,
vikingcode


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.

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.

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...

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
... or if you think there is no other way or you can't help then its okay

Regards Imran Habib


Top
 Profile  
Reply with quote  
PostPosted: 25.03.2011, 18:19 
Offline

Joined: 11.09.2010, 20:21
Posts: 44
Location: Germany
I really don't know where you could have seen destructive criticism or an insult in his answer.


Top
 Profile  
Reply with quote  
PostPosted: 26.03.2011, 04:15 
Offline

Joined: 08.11.2010, 10:46
Posts: 35
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


Top
 Profile  
Reply with quote  
PostPosted: 26.03.2011, 18:23 
Offline

Joined: 09.02.2011, 17:02
Posts: 83
vikingcode wrote:
vikingcode wrote:
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


Firstly Thank U so much for evrything u wrote I respect that from my heart ...

I used the way it is used in the AAA ...
in simple adding header where it is defined into my application and then adding reference in project common properties and adding project dependencies ....
but there is a problem using it ... it has no problem when i am calling that function
************************************************************************************************************************
1>Handle.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall AgentActionComponent::loadFromXml(struct XMLNode const *)" (?loadFromXml@AgentActionComponent@@UAEXPBUXMLNode@@@Z)
1>E:\Imran Habib\WorkspaceHorde3D\Tools\GameEngine\bin\chasegame.exe : fatal error LNK1120: 1 unresolved externals
************************************************************************************************************************

what I understand is that i need another connection of AgentActionComponent with my file (.cpp) .... possible reason could be

1. There is no default constructor call of AgentActionComponent in my .cpp
2. as there is no default constructor in AgentActionComponent ... i mean constructor without any arguments so i created my own default constructor in AgentActionComponent
then i compiled the whole project (i mean ..whole so that changes in AgentActionComponent are compiled) but i i got the above error i dont know why this has occured now :cry:

i have checked all dependencies and references ... mostly this kind of errror is removed when i add refernce in project propperties->commmon properties or calling the constructor
of header file i use but this time it didnt work there is still something missing

kindly help...
Lastly about last message i m really sorry if something hurt u or made u feel bad ....

regards Imran Habib


Top
 Profile  
Reply with quote  
PostPosted: 26.03.2011, 22:14 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
Hi Imran,

you are not offending anyone but the Horde3D forums are really not the right place for such C++ beginner questions and this is your third thread now which deals with basic linker errors. If you think you can't solve these basic C++ problems yourself by reading a book or some articles on the net, please use one of the general programming forums that have a beginner section. Chances are also higher that you will get a quick answer there. Game development and especially graphics programming is a complicated field. We are happy to help people that are relatively new to graphics programming getting started with Horde but you need at least a solid programming background, otherwise it is just too overwhelming.

BTW, I would suggest you to not use any leet speak ("Evry 1") when you are dealing with engineering/programming as this looks very unprofessional.


Top
 Profile  
Reply with quote  
PostPosted: 28.03.2011, 11:33 
Offline

Joined: 09.02.2011, 17:02
Posts: 83
marciano wrote:
Hi Imran,

you are not offending anyone but the Horde3D forums are really not the right place for such C++ beginner questions and this is your third thread now which deals with basic linker errors. If you think you can't solve these basic C++ problems yourself by reading a book or some articles on the net, please use one of the general programming forums that have a beginner section. Chances are also higher that you will get a quick answer there. Game development and especially graphics programming is a complicated field. We are happy to help people that are relatively new to graphics programming getting started with Horde but you need at least a solid programming background, otherwise it is just too overwhelming.

BTW, I would suggest you to not use any leet speak ("Evry 1") when you are dealing with engineering/programming as this looks very unprofessional.



Sorry ! I will be carefull in future

Regards Imran Habib


Top
 Profile  
Reply with quote  
PostPosted: 11.05.2011, 14:06 
Offline

Joined: 07.05.2011, 21:12
Posts: 14
vikingcode wrote:
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


hello Imran just came accross your post as i was looking for a function in AgentActionComponent to use into my code ,
so did the above referred code work for you, I am also trying to use the same headerfile but another function i.e stopwalking()
but i have got function but may be my programing skills are also not fine , i am also stuck on linkage kind of error which says something as
follows kindly help if you can

*'''''''''''''''''''''''*****************************************************************
1>Handle.obj : error LNK2001: unresolved external symbol "public: void __thiscall AgentActionComponent::stopWalking(void)" (?stopWalking@AgentActionComponent@@QAEXXZ)
1>WorkspaceHorde3D\Tools\GameEngine\bin\chasegame.exe : fatal error LNK1120: 1 unresolved externals

**************************************************************************
i used exactly the above method that viking code mentioned

:( can you are anyone else help.....
Regards Elisbeth


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group