Propdump (Sdk)

Propdump // Sdk

1  |  

mayor taz

Aug 20, 2002, 7:43pm
How hard is it to make a bot save property to a propdump file?


Aug 20, 2002, 10:37pm
[View Quote] YASBB does it (and several other bots do).



Aug 21, 2002, 1:18am
struct entry {
unsigned long owner;
unsigned long timestamp;
int x, y, z; // Placement
short ry, rx, rz; // Rotation
unsigned char mod, des, act; // Lengths

FILE *out;
struct entry Entry;
char *pModel, *pDescr, *pAction;

out = fopen ("propdump.txt", "wb");
fprintf (out, "propdump version 3\r\n");


fprintf (out, "%lu %lu %d %d %d %d %d %d %d %d %d ",
Entry.owner, Entry.timestamp,
Entry.x, Entry.y, Entry.z,
Entry.ry, Entry.rx, Entry.rz,
Entry.mod, Entry.des, Entry.act);

fwrite (pModel, 1, Entry.mod, out);
fwrite (pDescr, 1, Entry.des, out);
fwrite (pAction, 1, Entry.act, out);
fwrite ("\r\n", 1, 2, out);

As you don't get the three length elements from AW, you need to get
the length of the 3 strings AW_OBJECT_MODEL, AW_OBJECT_DESCRIPTION
and AW_OBJECT_ACTION (with strlen for example).
The three strings are pointers (if you use strdup/free), but could
as well be char [] like in the aw_string() example (with strcpy).

In all three strings you have to replace all occurances of linefeeds
(0x0d 0x0a) by (0x80 0x7f) - well, in the model name it cannot occur
but who knows. I'm not absolutely sure how the current SDK sends the
linefeeds, so you should verify this information.

[View Quote]

mayor taz

Aug 21, 2002, 6:48pm
okay thanks
[View Quote]

1  | is a privately held community resource website dedicated to Active Worlds.
Copyright (c) Mark Randall 2006 - 2024. All Rights Reserved.   ·   ProLibraries Live   ·   Twitter   ·   LinkedIn