1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Excel file for editing civ4 xml files

Discussion in 'Civ4 - Utility Programs' started by talchas, Mar 23, 2006.

  1. zulu9812

    zulu9812 The Newbie Nightmare

    Joined:
    Jan 29, 2002
    Messages:
    6,389
    Location:
    Athens of the North
    It would be great to see this updated. Civ4 not having a rule editor is a big step back from CivIII, IMO, and even something like an excel file would be most useful.
     
  2. talchas

    talchas Prince

    Joined:
    Jan 3, 2006
    Messages:
    428
    You could do this in openoffice, you would just have to rewrite the macros using python or whatever it uses instead of vba.
     
  3. DavinciFan

    DavinciFan Chieftain

    Joined:
    Jun 2, 2006
    Messages:
    4
    Is it possible to use this to edit other types of XML files? If so, how? I apologize if this seems like a question with an obvious answer, but I am quite new to Civ4 modding. Thanks in advance.
     
  4. talchas

    talchas Prince

    Joined:
    Jan 3, 2006
    Messages:
    428
    Its designed to be easy to make edit other Civ4 type XML files. You would make a copy of a sheet and then edit it to fit. The column of commands (Tag, Map, SubMap...) and the column of names would be what you would want to edit.
     
  5. seady

    seady Prince

    Joined:
    Aug 30, 2006
    Messages:
    582
    Location:
    Sydney

    From the open office help file:

    "Macros in Microsoft Office and OpenOffice.org"

    Spoiler :
    Microsoft Office and OpenOffice.org cannot run the same macro code. Microsoft Office uses VBA (Visual Basic for Applications) code, and OpenOffice.org uses Basic code based on the OpenOffice.org API (Application Program Interface) environment. Although the programming language is the same, the objects and methods are different.
    If you use macros in one of the applications and want to use the same functionality in the other application, you must edit the macros. OpenOffice.org can load the macros that are contained within Microsoft Office files and you can then view and edit the macro code in the OpenOffice.org Basic IDE editor.
    You can choose to preserve or delete VBA macros
    Open a Microsoft Office document that contains VBA macro code. Change only the normal contents (text, cells, graphics), and do not edit the macros. Save the document as a Microsoft Office file type. Open the file in Microsoft Office, and the VBA macros will run as before.
    You may delete the VBA macros from the Microsoft Office file on loading or on saving.
    Choose Tools - Options - Load/Save - VBA Properties to set the VBA macro handling of OpenOffice.org.


    Darn :) It would have been nice to use as is.
     
  6. asioasioasio

    asioasioasio Fallout Scrubber

    Joined:
    Mar 4, 2006
    Messages:
    3,058
    Location:
    Poland, EU
    very good - but maybe i have some errors in my xml or oi made something wrong because importing promotions and units get's run-time error '6' overflow :(
    and about techs - it loads only myysticism wich is very weird because i don't have this tech on tech tree :( what could be wrong?

    only unitclasses works for me :(

    and i have proposition for other xml files editable - could you add civics sheet and leaders and perhaps nations
     
  7. asioasioasio

    asioasioasio Fallout Scrubber

    Joined:
    Mar 4, 2006
    Messages:
    3,058
    Location:
    Poland, EU
    if this could help with promotions after clicking debuging
    it highlits row = row + 1
    PHP:
    Loop
    col 
    startCol
    row 
    startRow
    Do Until fout.AtEndOfStream
        
        line 
    MyTrim(fout.ReadLine)
        If 
    line MyTrim(beginningThen
            col 
    col 1
            
    If col endCol Then
                endCol 
    endCol 1
                newItem
            End 
    If
            
    row startRow
            inItem 
    True
        
    ElseIf line MyTrim(endTagThen ' do nothing and wait for the start tag
            inItem = False
        ElseIf Not inMap Then
            Set theMatches = theRegExp.Execute(line)
            If theMatches.Count > 0 Then
                Set theMatch = theMatches.Item(0)
                tag = theMatch.SubMatches(0)
                value = theMatch.SubMatches(1)
                Do Until ("Tag" = Cells(row, commandColumn) Or "OptionalTag" = Cells(row, commandColumn)) And tag = Cells(row, commandColumn + 1)
                    Cells(row, col) = ""
                     row = row + 1
                Loop
    looking on this code secend row from down
     
  8. asioasioasio

    asioasioasio Fallout Scrubber

    Joined:
    Mar 4, 2006
    Messages:
    3,058
    Location:
    Poland, EU
    for thousend times thx. this is very good and flexible tool and very useful :bowdown: :bowdown: :bowdown: :bowdown: :bowdown: :bowdown: :bowdown: :bowdown:
    now i know what's the problem with this error - i've tried to load with warlords code - and when i added rows with warlords tags now it works very good

    and what about leaders and nations and civics - is it possible you'll add them? :)
     
  9. talchas

    talchas Prince

    Joined:
    Jan 3, 2006
    Messages:
    428
    You could do it yourself you know, just copy one of the existing sheets and edit... ;)
     
  10. asioasioasio

    asioasioasio Fallout Scrubber

    Joined:
    Mar 4, 2006
    Messages:
    3,058
    Location:
    Poland, EU
    hehe ok i found out it's quite easy. i'm trying to make the sheet for builduings :)
     
  11. talchas

    talchas Prince

    Joined:
    Jan 3, 2006
    Messages:
    428
    That was the idea, that way I could easily add more, and easily push the work off on other modders. :)
     
  12. Ket

    Ket Composite Of A Composite

    Joined:
    Jul 26, 2006
    Messages:
    899
    Location:
    Austin, TX
    Can you post the units sheet for warlords?
     
  13. asioasioasio

    asioasioasio Fallout Scrubber

    Joined:
    Mar 4, 2006
    Messages:
    3,058
    Location:
    Poland, EU
    If author has nothing against it i'll post it :)
     
  14. talchas

    talchas Prince

    Joined:
    Jan 3, 2006
    Messages:
    428
    Sure .
     
  15. superjib

    superjib Chieftain

    Joined:
    Apr 14, 2003
    Messages:
    62
    Location:
    Paris, FRANCE
    So asioasioasio ?
    Thanks !
     
  16. asioasioasio

    asioasioasio Fallout Scrubber

    Joined:
    Mar 4, 2006
    Messages:
    3,058
    Location:
    Poland, EU
    I'll upload it today
    still have some bugs with new sheet for builduings, maybe anyone could check and fix it. -
    The games put errors about bad Tags - with empty text (for people who edited xml files - The same bug is when you have for example this tag <prereqTech></prereqTech> instead <prereqTech>NONE</prereqTech> - the game returns error about bad tag than). It's hard to explain it for person wich use english as a second language, but i hope you'll fix it).
     
  17. asioasioasio

    asioasioasio Fallout Scrubber

    Joined:
    Mar 4, 2006
    Messages:
    3,058
    Location:
    Poland, EU
    ok hope someone could fix the builduings
    or have other useful sheets
     

    Attached Files:

  18. morgan33

    morgan33 Chieftain

    Joined:
    Jul 10, 2008
    Messages:
    1
    I am lost. i play civ4 BTS single player and would love to edit my units. now i must go to world editor and then add all promotions to the units i would like to have in the game. that takes forever. i have the exel editor with macros enabled and have tried to do it but have just gotten lost. i have seen when using the world editor that i can add scripts, but uhmm i do not know where to get them or how to make them. any help here would be... well helpful, lol
     

Share This Page