About Store Forum Documentation Contact



Post Reply 
How to change the character class methods / OBJ types in world editor
Author Message
Gian-Reto Offline
Member

Post: #1
How to change the character class methods / OBJ types in world editor
This is maybe a very stupid questions, but I couldn't figure it out myself:

I'd like to extend the Esenthel character class to make the movement more complex (like taking into account environment parameters like slopes when coming up with the speed), and add additional parameters.

Now, I have access to the character.cpp and all.... but: how should I proceed to get a new type in the editor (like 'OBJ_CHR', for example 'OBJ_CUSTOM_CHR')... I assume I also need to change the enum classes? Do I have access to these with the company license? I f yes, where do I find them, and where do I need to place them in my Esenthel SDK so that the World Editor has access to the changed code?

Or is there any good way to overwrite a classes methods in my main code? Can I change the character cpp and place it somewhere, and the changes are picked up by the game engine?

(total C++ noob.... coming from ajava background, I'm not always sure what exactly I can do with C++ smile )
04-01-2012 11:44 AM
Find all posts by this user Quote this message in a reply
JonathonA Offline
Member

Post: #2
RE: How to change the character class methods / OBJ types in world editor
The obj types are defined in the headers in your root directory Enum folder.
04-01-2012 01:59 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Gian-Reto Offline
Member

Post: #3
RE: How to change the character class methods / OBJ types in world editor
Okay, I see, thanks for the hint....

But now comes the question, if I add an addtitional obj type, where does the code decide what to do with it? E.g., what class to use to control it?

I assume somewhere in the code something sets "character" as the class responsible for controling an OBJ_CHR object... any idea where this is done?
04-02-2012 07:32 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: How to change the character class methods / OBJ types in world editor
this is covered in all "game basics" tutorials
Code:
Game::World.setObjType(Statics, OBJ_STATIC)  // set 'Statics' memory container for 'OBJ_STATIC' objects
              .setObjType(Items  , OBJ_ITEM  )  // set 'Items'   memory container for 'OBJ_ITEM'   objects
              .setObjType(Chrs   , OBJ_PLAYER); // set 'Chrs'    memory container for 'OBJ_PLAYER' objects
04-05-2012 03:11 AM
Find all posts by this user Quote this message in a reply
Gian-Reto Offline
Member

Post: #5
RE: How to change the character class methods / OBJ types in world editor
As far as I know this code just defines that the Array / Container Statics contains 'OBJ_STATIC' objects...

where is the code (if there is any) for OBJECT_STATIC objects? Where is it defined what class these objects use?
I see that there is a class character, and I see OBJECT_CHR objects definition in the enum.... but nowhere I see how these two get linked.

If I define a new type, lets say OBJECT_CUSTOM, which should be linked to the class custom.cpp for their methods, how would I do this?
04-05-2012 11:48 PM
Find all posts by this user Quote this message in a reply
fatcoder Offline
Member

Post: #6
RE: How to change the character class methods / OBJ types in world editor
Please take a look at tutorial "09 - Extending Game Object Class" in the Game Basics folder. You would then define your OBJECT_CUSTOM in the obj_type.enum.h file (in the Enum folder) in your project's Data folder.
04-06-2012 06:28 AM
Find all posts by this user Quote this message in a reply
Gian-Reto Offline
Member

Post: #7
RE: How to change the character class methods / OBJ types in world editor
Another useful tutorial I overlooked... I'll check it out.

Thanks for making me aware of it.
04-06-2012 08:39 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #8
RE: How to change the character class methods / OBJ types in world editor
Game::Static class sources are built-in to the game engine (EsenthelEngine.lib)
their sources are available for licensed developers in the Private section (Source Codes)
04-08-2012 07:44 AM
Find all posts by this user Quote this message in a reply
Gian-Reto Offline
Member

Post: #9
RE: How to change the character class methods / OBJ types in world editor
Okay, wrong part of the forum to discuss I guess.... I'll reopen the discussion elsewhere
04-08-2012 11:07 PM
Find all posts by this user Quote this message in a reply
Post Reply