HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Help: How to read MDX's EventObject(EVTS) in C++?

03-09-2005, 10:16 AM#1
Guest
in Nub's MDL/MDX - Warcraft III Model Format Specifications,
EventObject is:

EVTS // [EventObject]
long nbytes;
struct {
OBJ
ASCII "KEVT" // Actually a separate object
long ntrks; // usually (1)
0xFFFFFFFF
long frames[ntrks];
} events[nevts];

what's the meaning of "0xFFFFFFFF" and "ntrks"?
if i use this code to read EventObject's Data:
// test in "Units/NightElf/HeroDemonHunter/HeroDemonHunter.mdx"

struct EventObject
{
int objectID;
char cName[80];
int ntrks;
int frames;
};

struct mdxEventObject
{
int numEVTS;
EventObject* m_sEVTS;

void Read(TypePointer inP, int inSize)
{
m_sEVTS = (EventObject*)inP.p;
numEVTS = inSize / sizeof(EventObject);
}

int GetEVTSNum(){ return numEVTS; }

EventObject* GetEVTS(int n)
{
if(n>=0 && n<numEVTS)
return &m_sEVTS[n];
else
return NULL;
}
};

the result is
cName objectID Frame
MDX EventObject < SNDXKDH1 > < 96 > < -1 >
MDX EventObject < KEVT > < 1024 > < 0 >
MDX EventObject < > < 0 > < 0 >
MDX EventObject < > < 0 > < 0 >
MDX EventObject < > < 0 > < 2018791494 >
MDX EventObject < > < 827081286 > < 1414939979 >
MDX EventObject < f > < 2 > < 0 >
...

What's the problem?