Board index Programs with AI or Rules Enforcement Magic: The Gathering - Duels of the Planeswalkers Utilities
DotP2013 (and 2012) Card Lister
Moderator: CCGHQ Admins
DotP2013 (and 2012) Card Lister
by thefiremind » 15 Dec 2012, 14:17
I made a small utility that generates a list of English card names starting from the CARDS directory of your custom WAD. It's made for DotP2013 but it should work also for DotP2012 if needed.
Just drag and drop the CARDS directory onto the executable, and wait for it to finish. You'll find a list.txt file (together with the CARDS directory you dragged) that you'll be able to post here if you want to let people know about which cards your mod contains.
This is the C++ source:
Just drag and drop the CARDS directory onto the executable, and wait for it to finish. You'll find a list.txt file (together with the CARDS directory you dragged) that you'll be able to post here if you want to let people know about which cards your mod contains.
This is the C++ source:
- Code: Select all
#include <stdio.h>
#include <dirent.h>
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main(int argc, char* argv[])
{
string line;
string filename;
const string to_search = "<LOCALISED_TEXT LanguageCode=\"en-US\"><![CDATA[";
size_t found, start, end;
DIR *d;
struct dirent *dir;
if (argc > 1)
{
d = opendir(argv[1]);
if (d)
{
ofstream dest(".\\list.txt");
while ((dir = readdir(d)) != NULL)
{
filename = argv[1];
filename += "\\";
filename += dir->d_name;
cout << filename << endl;
ifstream source(filename.c_str());
if (source.is_open() && dest.is_open())
{
found = -1;
while (source.good() && found == -1)
{
getline(source, line);
found = line.find(to_search);
if (found != -1)
{
start = found+to_search.length();
end = line.find("]", start);
dest << line.substr(start, end-start) << endl;
}
}
source.close();
}
}
dest.close();
delete dir;
delete d;
}
}
else
cout << "You need to specify a directory as argument." << endl;
return 0;
}
- Attachments
-
- DotPCardList.zip
- (99.6 KiB) Downloaded 626 times
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 721 times
1 post
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 2 guests