PRM Delveopment

About PR usage and development, and about the POP format.
Locked
ugmo_joe
Efendi
Efendi
Posts: 12
Joined: February 22nd, 2004, 3:55 pm
Location: Melbourne, Australia
Contact:

PRM Delveopment

Post by ugmo_joe »

Hey, TeeJay thought that I might be of service by trying to update Thraka's Princed Resource Manager. We've briefly discussed the idea and have decided that a "WinZip" style user-friendly GUI would work best.

poirot, do you think you could write me up a document containing the file format of the *.dat files, including things such as what markers to look for and so forth? Given the information I've found I managed to put together a quick *.mid extractor for the MIDISND1.DAT and MIDISND2.DAT files.

Any help would be greatly appreciated! :)
All ideas are welcome!
poirot
Developer
Developer
Posts: 394
Joined: March 24th, 2003, 8:52 pm
Location: Australia
Contact:

Post by poirot »

Did Tammo Jan read my mind? that was exactely what I was going to tell you! I'll send you the sources of PRM. Can you register a username in http://project.princed.com.ar so I can add you in the developer team?

I can't explain how the format works, it's too complex for a thread post, even for a forum. But I have something better: the pr.dll!!! this dll can be used in VB programs to extract files from a dat file. Please subscribe to the developer email too, so we will be a bit more in touch. Anyways, I'm trying to add your ICQ un my jabber transport.
ugmo_joe
Efendi
Efendi
Posts: 12
Joined: February 22nd, 2004, 3:55 pm
Location: Melbourne, Australia
Contact:

Post by ugmo_joe »

Hey, I managed to register my name at [url]http://sourceforge.net/[/url] which is the same thing I hope! I couldn't find a link on [url]http://project.princed.com.ar[/url] except on the left hand side where it read: "New user via SSL". If I've made a mistake, just tell me. My user name is the same as my registered name here: ugmo_joe.

I have the pr.dll and thought about using it, but then I ran into the complication of viewing the contents of a *.dat file without extracting anything. Pr.dll only allows you to either extract, import, confirm the content type or clear the res table :(. I need to be able to view the file's contents without having to extract the files and read the res table.
poirot
Developer
Developer
Posts: 394
Joined: March 24th, 2003, 8:52 pm
Location: Australia
Contact:

Post by poirot »

You did right, http://project.princed.com.ar is just a link to our SF.net project, I use it as URL shortcut. I'll add your username to the project so you can see the CVS; use the bug reporting, patches and support features; post news, etc etc.

About the extraction, please download PR 0.9-r2 (the version released this week), there you'll find a file named resources.xml.
Well, you can't see inside a dat file because dat files doesn't have any resource information inside (like resource type or name) so the file resources.xml is a database with all this information. If you want to see what information is inside a dat file, just take a look at the resources.xml, I can add some functions to PR to parse the file so you can show the users what information is inside.
Another interesting function I can code to solve the program is a one-specific resorce extraction, so you can show a thumbail of a picture when you are showing the list read from the xml.
I've added you in a mailing list, did you get the mail? if you did, you can contact me and other coders using it :)
ugmo_joe
Efendi
Efendi
Posts: 12
Joined: February 22nd, 2004, 3:55 pm
Location: Melbourne, Australia
Contact:

Post by ugmo_joe »

Great news! Although I've never coded with an XML DOM Document in Visual Basic 6.0 before, I've found out how to use the resources.xml file you gave me. It's taken me two whole nights to figure it out, but I've done it. Now I'm just designing the GUI and assigning the appropriate functions. :D
poirot
Developer
Developer
Posts: 394
Joined: March 24th, 2003, 8:52 pm
Location: Australia
Contact:

Post by poirot »

I've added to pr.dll some functions that parses the XML file, here you have them:

int parseStructure(const char* vFile);
tTag* resourceTreeGetChild(tTag* whereAmI);
tTag* resourceTreeGetNext (tTag* whereAmI);
tTag* resourceTreeGetRoot ();
int resourceTreeGetInfo (tTag* whereAmI, char** tag, char** desc, char** path, char** file, char** itemtype, char** name, char** palette, char** type, char** value, char** version, char** number);

in VB, use int as Boolean, const char* as byval string, char** as byref string and tTag* as variant.

I have to compile the file and I'll send you.

so if you want to start you use:
if parseStructure("resources.xml") then
root=resourceTreeGetRoot
else
debug.print "error"
endif

to move to the child of root use firstChild=resourceTreeGetChild(root)
to move to the next siebling of the child of root use resourceTreeGetNext(firstChild)

and using recursivity you can show all the XML tree.

when you need to get information on a node, use resourceTreeGetInfo.

I hope it would be useful!
ugmo_joe
Efendi
Efendi
Posts: 12
Joined: February 22nd, 2004, 3:55 pm
Location: Melbourne, Australia
Contact:

Post by ugmo_joe »

Sounds great! Send it to [email]ugmo_joe@hotmail.com[/email]
poirot
Developer
Developer
Posts: 394
Joined: March 24th, 2003, 8:52 pm
Location: Australia
Contact:

Post by poirot »

Ok, gimme some more time, I've successfully compiled pr.dll v1.0 beta but I got some problems running it in VB, I'll test it a bit more and upgrade the definition module pr.bas so you can use the functions from the bas file. I need to read the manual about passing variables to a DLL from VB (it isn't so simple). I think tomorrow I'll be able to send something useful :)
ugmo_joe
Efendi
Efendi
Posts: 12
Joined: February 22nd, 2004, 3:55 pm
Location: Melbourne, Australia
Contact:

Post by ugmo_joe »

Great!

I've ran into one problem: how to extract single files without extracting them all. Because a user can make their own *.dat files, the sizes of the files inside will vary. Do you have any ideas?
poirot
Developer
Developer
Posts: 394
Joined: March 24th, 2003, 8:52 pm
Location: Australia
Contact:

Post by poirot »

First of all you've got an email :)
Answering to your problem... well... I can code very fast a one-item extraction option, but I can't code a one-item importing option veryfas as the whole file needs to be remade. For that reason we have to decide if it's very important that I code this or it's better that your program extract the file in a temporary directory and copy only the resource you need. The time performance of both options are the same, perhaps the second it's a bit slower, but I don't think it's too much. Well, if you think the first option is better I'll code the one-item importer/exporter.
ugmo_joe
Efendi
Efendi
Posts: 12
Joined: February 22nd, 2004, 3:55 pm
Location: Melbourne, Australia
Contact:

Post by ugmo_joe »

Hey poriot, sorry I haven't replied sooner. I've been swamped with homework for the past week!

I've been thinkng about those two extra functions that you say you can add in: to extract and import single files. I think that it would definitely be a good addition to the DLLs flexibility. I think it would make things a lot easier for developers such as myself to modify the *.dat files.

If I'm asking for too much then tell me. I can just as easily code the program to extract all the files to a temporary directory and move only the desired items into another folder.
ugmo_joe
Efendi
Efendi
Posts: 12
Joined: February 22nd, 2004, 3:55 pm
Location: Melbourne, Australia
Contact:

Troubles! :s

Post by ugmo_joe »

I'm having a bit of trouble with your new pr.dll.

First of all, why was the prClearRes function removed, and what exactly did it do in the first place?

Secondly, you stated in your last email that the correct paramater to pass the function to extract a single file, (ie. the vdungeon.dat palete) was vdungeon.dat@200. This was helpful, but I do not know exactly how to call the function or where to use this paramater. Could you write up and example of an import and export dll call? That would be a trememdous help. :?:
tristan1991

Re: PRM Delveopment

Post by tristan1991 »

can any1 give me a tutorial of using and make map on princed v3 alpha 7
thx

Stop necroposting! Topic locked. -mk1995
User avatar
Veke
Wise Scribe
Wise Scribe
Posts: 399
Joined: November 23rd, 2008, 7:58 pm
Location: Finland

Re: PRM Delveopment

Post by Veke »

Don't necropost = reply to a thread that's been unanswered for months or years
Locked