About Store Forum Documentation Contact
Donations:
309$/mo



Post Reply 
Player parameters
Author Message
AndrewBGS Offline
Member

Post: #1
Player parameters
I've had this post before but my language skills leave a lot to be desired.
To put it simply, I want to know this:

Is there a way to make Player objects have some specific parameters that NOT all character objects have? Parameters I can set from the engine, not manually in the code (that i can handle).

I want all players to have stamina, but not all character objects should have it. The stamina (example) should be an obj param I can edit in the world editor, and use it in the code.
Can I achieve this? If so, what's the right way to do it?
04-25-2013 01:04 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: Player parameters
Something like this:
Code:
class Chr : Game.Chr
{
}
class Player : Chr
{
    flt stamina;
}
This is covered in Bloody Massacre tutorial, and possibly in some other tutorials.
04-25-2013 01:06 PM
Find all posts by this user Quote this message in a reply
AndrewBGS Offline
Member

Post: #3
RE: Player parameters
This works ok, and I already have it for some parameters. But I can't edit from the editor. There are those class elements, like OBJ_CHR and OBJ_PLAYER.
Apparently I can't seem to get parameters specific to OBJ_PLAYER class only. all I managed to got was the standard OBJ_CHR ones.
In bloody massacre, you got the bolld colour param for example.
In Bloody Massacre, the OBJ_PLAYER element class is empty however. Mine isn't, it has some parameters and i don't know how to get them in code.
I know I'm bad at explaining things... but I hope you get what I'm saying.
04-25-2013 04:30 PM
Find all posts by this user Quote this message in a reply
Rubeus Offline
Member

Post: #4
RE: Player parameters
I think Scarlet went over some of this in his Game Objects tutorial videos.
http://www.esenthel.com/community/showth...p?tid=6084
I'm not sure if that answers your question, but might help?
04-25-2013 04:43 PM
Find all posts by this user Quote this message in a reply
candam Offline
Member

Post: #5
RE: Player parameters
(04-25-2013 04:30 PM)andreim44 Wrote:  This works ok, and I already have it for some parameters. But I can't edit from the editor. There are those class elements, like OBJ_CHR and OBJ_PLAYER.
Apparently I can't seem to get parameters specific to OBJ_PLAYER class only. all I managed to got was the standard OBJ_CHR ones.
In bloody massacre, you got the bolld colour param for example.
In Bloody Massacre, the OBJ_PLAYER element class is empty however. Mine isn't, it has some parameters and i don't know how to get them in code.
I know I'm bad at explaining things... but I hope you get what I'm saying.

smile Hello Andreim I think you can do what do you ant this way

Create new class object from the editor select your class name then add your parameters then you can actually access them through the code easily
04-25-2013 04:55 PM
Find all posts by this user Quote this message in a reply
AndrewBGS Offline
Member

Post: #6
RE: Player parameters
I already have the OBJ_PLAYER class, and the the tiny human on the map IS a member of that class. In the world, he is loaded like in the example:

Game.World.setObjType(Items , OBJ_PLAYER ); //among others

However, the player's class extends the character class in code. So I only manage to get parameters from OBJ_CHR. Not sure exactly where these two mingle. I'm currently checking out those tutorials, but it doesn't seem to address this particular issue. The problem is that my guy should indeed by a character, but he's also a player. Any way I can make my OBJ_PLAYER class element "extend" the OBJ_CHR? I think that should solve it.
(This post was last modified: 04-25-2013 05:12 PM by AndrewBGS.)
04-25-2013 04:59 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #7
RE: Player parameters
Hello,
In the Editor an object class cannot extend another one, you can do this in following way :
Just make copy of all chr parameters to the player class
Or
In the world editor override class of your player object from character class to player class, it's possible that with this method you can automatically inherit parameters from character class, but not from player class
04-27-2013 08:38 AM
Find all posts by this user Quote this message in a reply
AndrewBGS Offline
Member

Post: #8
RE: Player parameters
I've tried the 2nd solution, but it didn't seem to work.
I guess I'll just edit the player specific parameters in code only. After all, all players should be created within the application, not laying around in the world.
Thanks for the help.
04-27-2013 08:52 AM
Find all posts by this user Quote this message in a reply
Post Reply