1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. I will no longer be hosting XLNation as of March 1, 2017. Skullz613 will be taking the reigns of the site in early 2017 and XLNation will be moving to a new web hosting service. During that transition there will be an interruption in service of up to two weeks. Skullz613 is now a full administrator of XLNation. Be kind to him.

Is this the right place to ask questions about modding Cities XXL?

Discussion in 'Modding Help Quarter' started by NetPCDoc, Mar 13, 2015.

  1. NetPCDoc

    NetPCDoc Unskilled Worker

    Joined:
    Feb 20, 2015
    Messages:
    14
    Likes Received:
    0
    Exploring the old Planet???.xml files ...

    Is there already a function available to put these into a table inside the game?
    ... and ...
    when it comes to files in .pak files - where the FileSystem:FileExistEx functions do find the actual files (ex. data/planet/laury/laury.xml) - are there any functions for dealing with paths / folders in the .pak files (such as FileSystem:IsDirectory and FileSystem:IsDirectoryEx which seem to work on unpacked / unzipped files) - as the FileSystem:FolderListEx function doesn't seem to find any of the .pak-ed folders?!

    Maybe more questions? as I think of them?
     
  2. nicko2u

    nicko2u Governor

    Joined:
    Aug 22, 2014
    Messages:
    742
    Likes Received:
    1,053
    it's the right place but is it the right question lol. no idea is my first reply. All I know is your limited big time just unpaking content as a modder. As we all do.
     
  3. Kankrelune

    Kankrelune Skilled Worker

    Joined:
    Nov 28, 2014
    Messages:
    32
    Likes Received:
    26
    What do you mean by old planet xml files, why do you want copy this files during the game execution ?

    From what I know in addition to the LUA (LuaPlus ?) api functions you have a class named InterfaceFileMgr in :

    data\design\script\filemgmt\interfacefilemgr.lua (and /unprotectedscript/)

    Some frequently used path : http://www.generation-city.com/citiesxl/pakunpak/aide/english/09.html

    You're sure of the targeted folder path ?

    Have fun...
     
  4. NetPCDoc

    NetPCDoc Unskilled Worker

    Joined:
    Feb 20, 2015
    Messages:
    14
    Likes Received:
    0
    "The old planet files" ... from back when there was more than just a single OFFLINE SOLO planet ("Laury") to play with in Cities ...
    I'm attempting a mod to pull these back into the game? give players a choice of planets to have a city on?

    Yes, I've already discovered the InterfaceFileMgr functions - which don't help with the old Planet files ... which are in XML code and not the games more up-to-date(? or otherwise altered) .cxl and/or lua-table formats!?

    The FileSystem:FileExistEx, FileSystem:FileListEx and FileSystem:FileExist, FileSystem:FileList - for files at "tonumber(netapi.E_INSTALL)" file functions will work (when called from a function inside the game code) with the .pak file contents; at the locations - relative to "data/" - that the pakunpak utility unpacks them to? But the FileSystem:IsDirectoryEx and FileSystem:FolderListEx path functions won't work with path arguments such as "data/planet" (even though the file functions do find such files as "data\planet\laury\laury.xml", "data\planet\planet001\planet001.xml", etc.)?

    So, YES, I have succeeded in reading the 'old planet files' and concat-ing their contents into a Very Large/Long string (taking approx. 11 minutes for reading 14 files) ... but said string doesn't have the correct tags to survive the ".cxl" parsing functions - used to place ".cxl" content into in-game tables. As these files are in XML code - it seemed logical to me that there should be an available function to parse the XML contents of these files into 'lua-type-tables'(?) that Cities XXL uses? Asking here before attempting to re-invent what should be an already existing 'wheel' (a.k.a. function)!

    And I would like to incorporate a FolderList into the retrieval process ... so that I don't have to 'hard code' past the 'planet' point in a path spec such as "data/planet/*.*/*.xml"? (Such a FolderList works just fine with any player profiles that might be on the "live/" path - via the netapi.LOCAL_APPDATA numeric argument.)
     
  5. NetPCDoc

    NetPCDoc Unskilled Worker

    Joined:
    Feb 20, 2015
    Messages:
    14
    Likes Received:
    0
    Still working on accessing the old Planet (planet###.xml) files from inside the game-code ...

    FYI - for those that didn't already know - the game does have support for a few alternate save locations ...
    (a small side step - for me)
    netapi.E_INSTALL - the default load point for all the game code
    netapi.E_LOCAL_APPDATA - the default save point for all checkpoints (aka city saves)
    netapi.E_COMMON_APPDATA - the shared (between users on the same win-platform) version of E_LOCAL...
    netapi.E_MYPICTURES - %USERPROFILE%\pictures\...
    netapi.E_PERSONAL - %USERPROFILE%\documents\...
    (the above - I have been able to independantly verify this - can be accessed by the game ~NetPCDoc)

    I have also run across references to netapi.E_PROGRAM_FILES - but this doesn't seem to work for me? any ideas on what the problem may be? (under windows vista ultimate - 64-bit OS)?

    Does anyone know if there are there any mods in progress (or already released) that involve functions that write to the filesystem ... seems there is a lot of game code - that for whatever reason - tries to read/write the local filesystem from "inline" (rather than going through the 'central' filemgmt (aka InterfaceFileMgr) functions??? Is there a place to post "best practices" where one might encourage others to help correct this: when anyone mods any function (outside of the interfacefilemgr.lua file) that is directly accessing the local filesystem - please attempt to re-direct these accesses via the functions in the interfacefilemgr.lua file? I do have a few additional details/suggestions on this - should anyone be interested?

    I really hate the thought of a mod of mine becoming a dependancy - because of how many functions it has to "correct" - to a more 'best practice' formula ... does anyone have any suggestions on how to get at least some of these "corrections" into the "patch" pipeline (to be included in one or more future patches - such as can be automatically downloaded from steam)?
     
  6. nicko2u

    nicko2u Governor

    Joined:
    Aug 22, 2014
    Messages:
    742
    Likes Received:
    1,053
    not sure what your really trying to achieve? maybe explain it in basic terms so we all can understand?

    what planet files?, what are planet files? planet files where unique.
    sounds like the old failed version server online. share global areas failed.

    maybe you have a different approach? or mod idea?
    I'm sure we all love to see any improvement so do tell. or contact focus with your idea!
     
  7. NetPCDoc

    NetPCDoc Unskilled Worker

    Joined:
    Feb 20, 2015
    Messages:
    14
    Likes Received:
    0
    There are about 15 basic Planet(?) files - each with a single continent - having muliple regions which have multiple city-slots??? Obviously, I haven't yet gotten around to actually counting the number of regions and/or city slots ... all of these most probably from the old failed online server version of the game?

    Not being so ambitious as to attempt a peer-to-peer network implementation ... I'm limiting myself to the offline (and/or solo) playing environment. My concept evolved out of the way I have my drive spaces allocated ... lacking enough space at %USERPROFILE%/AppData/Local ... and wanting to relocate the game (city? checkpoint?) save files to another location ... where I have an overabundance of space?

    So ... started with re-viving (re-writing?) the profileinterface.lua functions to support local drive info (pointers?) on the Options Panel (player1.cxl file?), re-integrating the "playerprofile" folder and "profilelist.dat" file to contain the info on where the save files are to be found ... while allowing the player (user?) to have various alias MayorNames (nicknames?) to use so every city does not have to have the exact same MayorName??? Just about have what I want in profileinterface.lua, now taking on the interfacefilemgr.lua ... and all the 'in-line' file accesses (that don't use the centralized interfacefilemgr functions to access the file system) ... while investigating the 'Old Planet' files???

    I forget who first said it ... 'there are those that think' --- "variety is the spice of life" ... so why not offer a choice of Planets to have one's cities on? Not being tuned in at the time ... I believe originally ... that each planet was suppose to be hosted on a different server? Being a bit of a Sci-Fi fan ... why worry about x.y.z spacing (aka servers) for mulitple planets ... why not just use 'time gates' (to borrow a concept from Andre Norton) to pass to alternate dimensions thus having multiple planets with the same x.y.z co-ordinates (or in more real life terms - on the same host computer)? Not too sure of just how this might affect/effect inter-planetary trade ... intra-planetary trade, of course, would follow the current offline/solo formulas!!!

    So ... current multi-planet concept ... use the 'Old Planet' files to provide templetes that a Player may customize into one or more Planets on which to play City XXL cities on? with a folder structure of --[[profile]]/[planet]/solo ... where 'profile' is an alias for Mayor - and contains pointers to where a re-located "[planet]/solo" 'space' may be found; 'planet' is merely a way to seperate customized planet layouts; and 'solo' maps to the current "offline/solo" pattern ... as the current 'offline' in "offline/solo" appears to be a replacement of the old 'profile' from online play days, this doesn't seem to be too far fetched to me???

    @nicko2u - have I given enough of an explanation for others, such as yourself, to understand how well all this seems to intergrate into a single (although maybe somewhat complex) mod ... or maybe even the complexity of a real-for-true "dlc"?

    Once this is up and going ... tested and proved worthy ... someone might use it as a starting point for reviving online play?
     

Share This Page