About Store Forum Documentation Contact
Donations:
178$/mo



Post Reply 
Questions regarding player class
Author Message
sjaakiejj Offline
Member

Post: #1
Questions regarding player class
Hi,

I've got two questions about problems I've encountered during the creation of the gameplay features.

1. Is the position of a character measured from the characters feet (as for the y position), or the middle, and is it possible to get the y-coordinate of the top of the characters head?

2. Is it possible to change character whilst leaving the original unaffected? Think Perfect Dark, in which you could send a bot out to do a task for you, but Joanna would remain in the spot where she sent out the bot. Once you're done with the bot, a button is pressed and control to the main character is returned. I'm wondering about this due to the way the player class is created, extending a class which already exists.

Thanks in advance.
08-22-2010 12:32 AM
Find all posts by this user Quote this message in a reply
fatcoder Offline
Member

Post: #2
RE: Questions regarding player class
1. Measured from the character's pivot point, usually set in a modelling program, but can also be adjusted in the Mesh Editor.

2. The bot would be a second "character". Input would be disabled on the primary character when the bot is created. Input would be reenabled on the primary character when the bot is removed.
08-22-2010 07:06 AM
Find all posts by this user Quote this message in a reply
sjaakiejj Offline
Member

Post: #3
RE: Questions regarding player class
Thanks for your answer. I've got one more question before I can continue:

I'm having a bit of trouble understanding the objGet method. What exactly does the method do? Because I need to be able to interact with certain objects in the world, and obviously this would only be possible if the character is facing in the direction of the object, and is standing close enough. Would I use objGet for this, or a different method?
Thanks in advance.
08-22-2010 04:53 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
RE: Questions regarding player class
objGet returns a container of pointers to objects (it lists all nearby objects)
08-22-2010 08:28 PM
Find all posts by this user Quote this message in a reply
sjaakiejj Offline
Member

Post: #5
RE: Questions regarding player class
Now one final question about the objects.. When I use "default" as an Access Method, the object doesn't appear on the world map when it's built. Is there any additional information I need to fill/code in for the object to appear?
08-23-2010 03:41 AM
Find all posts by this user Quote this message in a reply
sjaakiejj Offline
Member

Post: #6
RE: Questions regarding player class
Having a small problem with inheritance, as I'm used to doing it in Java, I might be doing something wrong.

Interactive.h
Code:
STRUCT(Interactive, Game::Obj)
//{

virtual void create(Game::ObjParams &obj);
};

Interactive.cpp
Code:
void Interactive::create(Game::ObjParams *obj)
{
__super::create(obj);
//code here
}

comes up with this error
Code:
1>interactiveObjects.obj : error LNK2019: unresolved external symbol
"public: virtual void __thiscall EE::Game::Obj::create(struct EE::Game::ObjParams &)" (?create@Obj@Game@EE@@UAEXAAUObjParams@23@@Z) referenced in function
"public: virtual void __thiscall Interactive::create(struct EE::Game::ObjParams &)" (?create@Interactive@@UAEXAAUObjParams@Game@EE@@@Z)
1>ProjectFox.exe : fatal error LNK1120: 1 unresolved externals
08-23-2010 07:23 PM
Find all posts by this user Quote this message in a reply
Harry Offline
Member

Post: #7
RE: Questions regarding player class
(08-23-2010 03:41 AM)sjaakiejj Wrote:  Now one final question about the objects.. When I use "default" as an Access Method, the object doesn't appear on the world map when it's built. Is there any additional information I need to fill/code in for the object to appear?

You should also set Type for your objects. For player it's OBJ_PLAYER as default. You can create your own objects enums by editing files in Enum folder.

as a second question try this:
void Interactive::create(Game::ObjParams &obj)
08-23-2010 08:46 PM
Visit this user's website Find all posts by this user Quote this message in a reply
sjaakiejj Offline
Member

Post: #8
RE: Questions regarding player class
Did the first one, I created a custom type called OBJ_INTERACTIVE, and set my object to that, but it still doesn't appear.

The second was a typo, sorry about that. I had the & and not the *. Any other ideas?

Thanks for your help so far.
08-23-2010 09:04 PM
Find all posts by this user Quote this message in a reply
sjaakiejj Offline
Member

Post: #9
RE: Questions regarding player class
I narrowed down the linker problem to the __super::create(obj) call, although I'm not sure why it comes up with the error still. I looked at tutorials, and all of them do it in the same way as I do, unless I'm missing something.
08-23-2010 10:23 PM
Find all posts by this user Quote this message in a reply
Dynad Offline
Member

Post: #10
RE: Questions regarding player class
Hi,

Why don't you do it like this?

PHP Code:
struct Interactive Game::Item
{
   
// manage
   
virtual void create(Game::ObjParams &obj);

   
// update
   
virtual Bool update();

   
// draw
   
virtual UInt drawPrepare();
   
virtual void drawShadow ();
   
virtual void drawPalette();
   
virtual void drawBlend  ();

   
// io
   
void save(File &f);
   
Bool load(File &f);

   
Interactive ();
}; 

There is always evil somewhere, you just have to look for it properly.
08-24-2010 02:23 AM
Visit this user's website Find all posts by this user Quote this message in a reply
sjaakiejj Offline
Member

Post: #11
RE: Questions regarding player class
Hi, The documentation suggests I use the STRUCT(Ext, Base) method. Although, I just tried the usual extends method that you suggested, but the same error pops up as before. :(

I'm extending Object rather than item, because the object is not an item, seems logically wrong to me that you would use the item class for it.
08-24-2010 06:28 AM
Find all posts by this user Quote this message in a reply
Driklyn Offline
Member

Post: #12
RE: Questions regarding player class
If you want to extend the Game::Obj class, look at the "EsenthelEngineSDK\Tutorials\Source\Advanced\4 - Demos, Game Basics\Game Basics\09 - Extending Game Object Class" tutorial.

You don't call __super::create(obj); when extending from Game::Obj which is why you're getting the linker problem.
08-24-2010 08:34 AM
Find all posts by this user Quote this message in a reply
sjaakiejj Offline
Member

Post: #13
RE: Questions regarding player class
Now I feel stupid lol, I had been staring at the files in that folder for ages but i never noticed that tutorial. Thanks for your help.

Now this for the last question
Quote:Now one final question about the objects.. When I use "default" as an Access Method, the object doesn't appear on the world map when it's built. Is there any additional information I need to fill/code in for the object to appear?

Add to that Constant, which doesn't do anything either. The only one that works is embed into terrain and grass.

Edit:
I think I found it, will update later if I'm wrong. Thanks for the help everyone smile.
(This post was last modified: 08-24-2010 10:04 AM by sjaakiejj.)
08-24-2010 09:41 AM
Find all posts by this user Quote this message in a reply
sjaakiejj Offline
Member

Post: #14
RE: Questions regarding player class
Ok so an interesting problem pops up with the custom object class. When I scale it, in the World Editor, or in my own code, it doesn't show up scaled, instead being its original size and floating in the air. I tried adjusting the matrices at runtime to see what would happen, but even those don't have any affect on the object itself. I checked other transformations, such as rotation, and these are working.

Is there any method I need to override/add in order to get scaling working?
08-28-2010 09:10 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #15
RE: Questions regarding player class
you should paste some code
remember that 'set*' matrix methods reset matrix
08-29-2010 01:19 PM
Find all posts by this user Quote this message in a reply
Post Reply