About Store Forum Documentation Contact



Post Reply 
(MMO code)how to bring items from a world?
Author Message
gusrbehfdl Offline
Member

Post: #1
(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
Find all posts by this user Quote this message in a reply
BlackHornet Offline
Member

Post: #2
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
Visit this user's website Find all posts by this user Quote this message in a reply
gusrbehfdl Offline
Member

Post: #3
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
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #4
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
Find all posts by this user Quote this message in a reply
gusrbehfdl Offline
Member

Post: #5
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
Find all posts by this user Quote this message in a reply
gusrbehfdl Offline
Member

Post: #6
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
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #7
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
Find all posts by this user Quote this message in a reply
Post Reply