new player class and datablock don't load
by Cedrik zamo · in Torque 3D Professional · 12/24/2011 (2:10 pm) · 3 replies
Hi,
I wrote two new classes extending ShapeBase and ShapeBaseData but it don't load at all in the datablock editor.
I got the message "unable to create class AMHPlayer with datablock, starting as observer"
AMHPlayer.h
AMHPlayer.cpp
amhplayer.cs in game/art/datablocks excuted from datablockExec.cs
I wrote two new classes extending ShapeBase and ShapeBaseData but it don't load at all in the datablock editor.
I got the message "unable to create class AMHPlayer with datablock, starting as observer"
AMHPlayer.h
#ifndef _AMH_PLAYER_
#define _AMH_PLAYER_
#ifndef _SHAPEBASE_H_
#include "T3D/shapeBase.h"
#endif
struct AMHPlayerData :
public ShapeBaseData
{
public:
typedef ShapeBaseData Parent;
DECLARE_CONOBJECT(AMHPlayerData);
static void initPersistFields();
};
class AMHPlayer :
public ShapeBase
{
public:
typedef ShapeBase Parent;
DECLARE_CONOBJECT( AMHPlayer );
protected:
AMHPlayerData * m_AMHPlayerData;
// accessors
public:
inline AMHPlayerData * getData() { return m_AMHPlayerData; }
inline void setData(AMHPlayerData * Data) { m_AMHPlayerData = Data; }
public:
void processTick(const Move * move);
public:
AMHPlayer(void);
~AMHPlayer(void);
};
#endifAMHPlayer.cpp
/*
*/
#include "AMHPlayer.h"
IMPLEMENT_CO_DATABLOCK_V1(AMHPlayerData);
IMPLEMENT_CO_NETOBJECT_V1(AMHPlayer);
void AMHPlayerData::initPersistFields()
{
}
void AMHPlayer::processTick(const Move * move)
{
Con::printf("AMHPlayer is moving");
}
AMHPlayer::AMHPlayer(void)
{
}
AMHPlayer::~AMHPlayer(void)
{
}amhplayer.cs in game/art/datablocks excuted from datablockExec.cs
datablock AMHPlayerData(DefaultAMHPlayerData)
{
}
Torque Owner Kevin Mitchell
12 CatBlack Studios
Making a custom class in the T3D