gusrbehfdl
Member
|
(MMO code)how to bring items from a world?
Hello,
from the original MMO code, I want to know how I can get some items from my world to perform picking up/drop items.
I'm not an expert on C++, but I have a basic understanding and know how to do these on non-networking projects. MMO codes just seem to be more complicated.
It doesn't look like I can simply derive Game::Item to NetItem,
so how?
|
|
01-03-2011 09:48 PM |
|
BlackHornet
Member
|
RE: (MMO code)how to bring items from a world?
I don't have MMO sample code atm, but what about multiple inheritance?
Urbanity Online: http://www.facebook.com/pages/Urbanity-Online/162454237136358
Join the Esenthel IRC Channel @ Freenode: http://webchat.freenode.net/?channels=##Esenthel
|
|
01-03-2011 10:28 PM |
|
gusrbehfdl
Member
|
RE: (MMO code)how to bring items from a world?
thanks for the reply,
I tried that like this,
Item: NetItem, Game::Item....
it builds fine, but when I login and try to load my world,
error msg shows up that class is not found in misc.h
what is this happening?
|
|
01-03-2011 11:19 PM |
|
Esenthel
Administrator
|
RE: (MMO code)how to bring items from a world?
Hi,
For items in World in MMO you need to base your class on Net::Obj
|
|
01-04-2011 12:30 AM |
|
gusrbehfdl
Member
|
RE: (MMO code)how to bring items from a world?
when I do this :
struct NetItem:Net::Obj
this error msg shows up
error C2440: 'static_cast' : cannot convert from 'Item *' to 'EE::Game::Obj *'
here are two lines in my Client Game.cpp that I added for items.
//Game::ObjMemx<Item>Items;
// .setObjType(Items,OBJ_ITEM)
I did made it working with
Game::ObjMemx<Game::Item>Items;
but will I be able to pick these items up?
I guess I'll have to add that function and check it out.
(This post was last modified: 01-04-2011 04:07 AM by gusrbehfdl.)
|
|
01-04-2011 03:54 AM |
|
gusrbehfdl
Member
|
RE: (MMO code)how to bring items from a world?
Can you explain little further on basing my item class to Net::obj?
|
|
01-23-2011 01:50 AM |
|
Esenthel
Administrator
|
RE: (MMO code)how to bring items from a world?
you shouldn't base on Game::Item, this is completely different.
look more into the player class that inherits from Net::Obj, it's NetChr or something like that.
|
|
01-23-2011 02:34 AM |
|