When I call GetMapCount() I always get a return value of 0 even though I have already called Init(false, 0) and received a success value of 1. I assume there is some other method I need to call before GetMapCount() however, I haven't been able to find it yet in the TASClient source code.
Any help would be appreciated, thank you.
unitsync.dll: GetMapCount() returns 0 unexpectedly
Moderator: Moderators
Re: unitsync.dll: GetMapCount() returns 0 unexpectedly
trepan, thank you for your prompt reply and the link to the test code.
As I mentioned in my original post, I'd already called Init() with the proper parameters; however, GetMapCount() still returns zero.
As I mentioned in my original post, I'd already called Init() with the proper parameters; however, GetMapCount() still returns zero.
Re: unitsync.dll: GetMapCount() returns 0 unexpectedly
Sorry, I completely glazed over your Init() remark. Other than
Init(), it doesn't look like anything else should be required.
Silly question: do you have any maps?
Init(), it doesn't look like anything else should be required.
Silly question: do you have any maps?

Re: unitsync.dll: GetMapCount() returns 0 unexpectedly
Yes, tons; well over 400.trepan wrote:do you have any maps?
I looked at the C++ test code and it used InitArchiveScanner(), but even when I invoke this before GetMapCount() the latter function still returns zero. I've also tried using AddAllArchives("C:\\Program Files\\Spring\\maps\\") and both combinations of InitArchiveScanner() and AddAllArchives("C:\\Program Files\\Spring\\maps\\"), but nothing seems to work.
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: unitsync.dll: GetMapCount() returns 0 unexpectedly
Alright, I've gotten it work. For some reason it only works when the executable file is in the Spring directory, even through the DLL doing the actual work is always in the Spring directory.
Does anyone know of a way around this?

Does anyone know of a way around this?
Re: unitsync.dll: GetMapCount() returns 0 unexpectedly
change the working directory to the spring directory before init'ing unitsync
Re: unitsync.dll: GetMapCount() returns 0 unexpectedly
Thanks. How would I go about doing that?aegis wrote:change the working directory to the spring directory before init'ing unitsync
Re: unitsync.dll: GetMapCount() returns 0 unexpectedly
what language are you using?
Re: unitsync.dll: GetMapCount() returns 0 unexpectedly
C#aegis wrote:what language are you using?
Re: unitsync.dll: GetMapCount() returns 0 unexpectedly
There is set of classes in C# for unitsync handling in springie and in cadownloader and in other utils.
Springie is in spring svn, other stuff in caspring.org svn.
If you want multiplatform one, grab the one from cadownloader, that works on linux too.
Springie is in spring svn, other stuff in caspring.org svn.
If you want multiplatform one, grab the one from cadownloader, that works on linux too.