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

How to install Eclipse with XMLSpy and Python Plug-ins

Discussion in 'Civ4 - Modding Tutorials & Reference' started by J_Period, Feb 19, 2006.

  1. J_Period

    J_Period gone :(

    Joined:
    Feb 8, 2006
    Messages:
    385
    Location:
    Denver, CO, USA
    Basically Eclipse is a java development program that many many companies use to wirte their software. It's so popular in fact that many people write plug-ins that allow you to modify and write code in other languages (including, hooray, XML and Python, imagine that!)

    Both are available for free, though the installation of Eclipse is a bit tricky.
    Some basic instructions:
    ***Oh yeah, all my directions assume you're using Windows. Since Civ4 is only available on windows right now, I think that's a fair assumption. Also, you have to open both them in IE :p instead of firefox. It's a small price to pay...***
    1) Install Java (needed to run and use Eclipse, since it is primarily a Java development tool) Instructions
    Only go through step 16 if you want, no real need to test it. You can test it when you install Eclipse. If Eclipse runs, then you installed it correctly. If it doesn't. You messed up.
    2) Install Eclipse
    Instructions
    ***please note that the instructions in #1 and #2 are not written by me, they are written by my teacher. He gets all credit (and all blame :D )***
    3) Install XMLspy home edition Link
    4) Install the XMLspy Eclipse plugin (same link as #3)
    ***For steps 3 and 4, I assume you are smart enough to find the auto installers on the page I gave you***
    5) Install the PyDev plugin- this is a little more tricky, but not too much. We can do this two ways: the easy way or the hard way [thunk] The eeeeasy way. (sorry back to the future reference)
    Open eclipse, go to the help menu, select Software Updates -> find and install. Select "new features to install" select new remote site, and copy the following into the url: "http://pydev.sf.net/updates/" (minus the quotes) name it pydev or somethins similar. Press okey, make sure it's checked, and hit finish. Eclipse should to the rest.
    ***For problems with step 5, you can check pyDevs homepage***

    For any problems, you can post here or PM me or whatever.

    Yeah it's a pain in the ass at first, but it will improve your programming 100%
    compared to programming on wordpad or whatever. Color-coding, auto-format, etc... It's soo pretty ;)
    Plus if you plan on doing any programming (esp of java) for a career, it's a good idea to be familliar with Eclipse, lotsa companies use it.

    Also, the advantage to having both plugins on one program is that you can open up XML AND python files at the same time, and switch tabs between the two (like in firefox). It makes life simple, simple, simple.

    Hope this helps
    j
     
  2. talchas

    talchas Prince

    Joined:
    Jan 3, 2006
    Messages:
    428
    Who says it's a small price to pay? IE is evil :lol: Oddly enough however, the first one worked ok in firefox but the second didn't.

    Nice slides, although in the installing java one, 11 and on is also irrelevant (eclipse can detect your java install by itself I think).

    I've been too lazy to actually bother downloading pydev under windows (I do have it under linux), as I expect you can't get it to recognize the Civ4 python functions (do correct me if I'm wrong, I hope I am) and without that, its just a slow loading version of scite for me as I haven't done enough xml work to need more than the coloring.
     
  3. Belizan

    Belizan Emperor

    Joined:
    Jan 11, 2006
    Messages:
    1,060
    Well, I have it mostly setup. It seems like it should be able to do code completion on Civ types from reading the compiled python files in Assets/Python/System, but it isn't working out for me. Not sure if I've configured everything properly. Also going to have to experiment to see if I can get it to use the mod's Python directory as its working directly without intervention so there isn't a prep step between coding and in-game testing.

    Any suggestions for these, J.?
     
  4. talchas

    talchas Prince

    Joined:
    Jan 3, 2006
    Messages:
    428
    The civ types aren't in Assets/Python/System - they are in Assets/CvGameCoreDLL and I don't think you can load them from python.
     
  5. Belizan

    Belizan Emperor

    Joined:
    Jan 11, 2006
    Messages:
    1,060
    What are all those .pyc files in System then?
     
  6. Belizan

    Belizan Emperor

    Joined:
    Jan 11, 2006
    Messages:
    1,060
    Wait.. did you say CvGameCoreDLL.dll?!?

    You mean I can use a dll brower on this thing?
     
  7. talchas

    talchas Prince

    Joined:
    Jan 3, 2006
    Messages:
    428
    Yep, and I uploaded a list of what seemed to be all the functions that might possibly be exported to python to here. (from Dependency Walker)
     
  8. talchas

    talchas Prince

    Joined:
    Jan 3, 2006
    Messages:
    428
    They are python modules you can use in your py files, but they are more general APIs.
     
  9. rube203

    rube203 Chieftain

    Joined:
    Jan 10, 2004
    Messages:
    53
    Thanks, was exactly was I was browsing for.
     
  10. torin23

    torin23 ViSa Team Member

    Joined:
    Oct 3, 2006
    Messages:
    51
    Location:
    Seattle, WA, USA
    One thing to note about XMLSpy. It seems that there is no XMLSpy 2007 Home edition and so that free option seems to be gone. I think that Microsoft has an "XML Notepad 2006" available but I'm not familiar with it past the name.
     
  11. jray

    jray King

    Joined:
    Jan 31, 2006
    Messages:
    925
    Location:
    North Carolina (USA)
    In addition, the XMLSpy 2006 Eclipse plug-in is very unstable in recent versions of Eclipse (3.2 and above). But that's okay... it doesn't really integrate with Eclipse anyway. Using it standalone seems just as good. And you can still Google the 2006 Home Edition installation file. Get it while you still can!

    At least PyDev (and its commercial add-on, PyDev Extensions) are still going strong!
     
  12. Gaurav

    Gaurav Prince

    Joined:
    May 14, 2006
    Messages:
    404
    After installing the 2006 Home Edition installation file, I am told I need to activate it. Clicking on "Request a Permanent Key" leads to a page where I can only download the trial version of 2007.
     

Share This Page