File conversion to Text and back

Is there a way to convert a CC3 map (fcw file) into a text file (and vis-versa)? Said text file would contain the info that can be gained from the LIST command applied to all entities, plus flags to indicate which ones are hidden (by sheet or layer), info on sheet effects which are set but not applied, and indications of layers which are frozen. Given the vector nature of CC3 graphics, such a thing should be relatively easy (at least in my mind).

I ask because such a converted file would be far easier for me to script with than the CC3 XP framework is, mostly because I don't know or use C++ or C#. My preferred scripting language is Python and I'd love to be able to write scripts that manipulate or create CC3 maps in it.

I also imagine that this would be useful to others who prefer other languages to C++ or C# since pretty much every language out there can read in and write out a simple text file.

Comments

  • When you do List, click on the icon in the upper left corner of the list screen, there's an option there to save the list as a txt file.
  • Posted By: amdobrittWhen you do List, click on the icon in the upper left corner of the list screen, there's an option there to save the list as a txt file.
    Nice tip - thanks. I still learn something new about Campaign Cartographer all the time, even after ten years of using the software!
  • Okay, that gets it out, though it doesn't handle the extras I mentioned above. Now, how about getting it back in?
  • Posted By: Black PlaugeOkay, that gets it out, though it doesn't handle the extras I mentioned above. Now, how about getting it back in?
    As to that, I have no idea whatsoever.

    Question: Why would want to have the map remake itself in another programming language? If you want others to be able to view the fcw file and they don't have the program, there's always the free Viewer that's available.
  • Mostly so that I can manipulate it. For example, I've run online tournaments using the same basic map as a base, but with certain features randomly placed, within some set of restrictions (see http://online-roleplaying.com/forums/showthread.php?t=8883 and http://online-roleplaying.com/forums/showthread.php?t=8851 for examples). Making the base map was fairly easy in CC3. The random manipulations, however, were a bit harder. What I ended up doing was writing a python script that told me where to place the random elements (incorporating all the various restrictions I was placing on their positions) and then placing them by hand. Had I been able to convert the from fcw to txt and back, I could have exported the base map to text, had the python script add the random elements to the text file automatically, and then converted back to a CC3 map.

    As another example, I have a map where I'm attempting to convert the bottom and top of the rectilinear view into polar representations. While I can envision the math necessary to recalculate the position of each point, I'm not familiar enough with C++ or C# to translate this into code. I could, however, do it in Python.

    Basically, I'm lazy and don't want to learn a new programming language just for CC3, so I'm trying to see if the tools exist that allow me to leverage my current skill set into doing what I want to do.
  • With the ability to read object descriptions, I can see lots of opportunities for generators: Have a library of houses and a random generator that tells CC3 how to assemble a random town. Random dungeons. Heck, with a bit of work, random faces with CA.
  • MonsenMonsen Administrator 🖼️ 46 images Cartographer
    While I don't know how to import a text file as a CC3 database, one way of doing it would be to have your script parse the output from the list command, and then create a CC3 macro file from it (incorporating the changes yo want to make). Learning to make macros are a lot simpler than learning XP programming. The resulting macro file could then be run from inside CC3 to draw the entire map, including your scripted changes.
  • While that initially seems a bit backwards (as you're writing commands to produce something based on the results of those commands), that sounds like it would work. It still would require me to learn CC3 macros, so I'm still hoping for an easier way, but since the macros are based on the text equivalent commands for tasks, it might be doable. I'll have to look into that option.
Sign In or Register to comment.