Wormholes Modmod

Discussion in 'Civ4 - Star Trek Mod' started by TC01, Jul 16, 2009.

  1. TC01

    TC01 Deity

    Joined:
    Jun 28, 2009
    Messages:
    2,216
    Location:
    Irregularly Online
    Wormholes Modmod v1.52 for Star Trek v3.25 (Now included in 4.0!)

    This is a now defunct modmod for Star Trek that adds a Wormholes system (read on to find out more about it). It is defunct because deanej has merged it with the main Star Trek mod and is now standard as of 4.0.

    Therefore, the download has been removed, so as not to confuse people. If you want the source code... (the original source code), please either post that in this thread or PM me.

    Otherwise, this thread can be used for discussion about Wormholes, as set up in 4.0.

    Original Description:

    This is a modmod/modcomp for Star Trek 3.25 that adds Wormholes to the game, allowing instantaneous travel from one random point on the map to another random point on the map, now upgraded to v1.52 (as of 6/1/10), and now included in Star Trek Expanded by apenpaap (as of STE v1.2).

    v1.4 adds two new custom map options to the mapscript. All "wormholes appear on specific sizes" are now no longer accurate, since you can alter the order of wormholes appearing on different sizes. Blue - Red - Purple is standard, but you can set it to any combination of those three. It also lets you turn off labelling wormholes, and adds the Barzan Wormhole (purple wormhole) graphics to ST Galaxy, as well as streamlining the way wormholes work in ST Galaxy.

    Barring any undiscovered bugs, or feature requests I like, or ideas I think of in the future, this is a "done" mod. Future versions of Wormholes will probably only be for compatibility with newer versions of Star Trek.

    Features:

    -Wormholes! In addition to merely adding the feature, I've added a Concept page in the pedia and a tutorial popup to the FF Tutorial.
    -Wormholes Mapscript: StarTrekFlat with slightly reduced hostile features and with two Bajoran Wormhole features on the map.
    -On Standard, Large, and Huge maps I've added the Jalbador Wormhole (Red Wormhole) feature as well.
    -Modification to the ST Deep Space Nine scenario allowing ships to use the Bajoran Wormhole.
    -WormholesSpiralGalaxy script: Modification of the Spiral Galaxy mapscript that drops wormholes like the Wormholes script
    -A Final Frontier compatible version (that does not require the Star Trek mod, only the Final Frontier mod from unmodded BTS)
    -The Barzan Wormhole, a pale purple wormhole, found only on Huge maps.
    -A map option allowing you to turn on and off the wormhole labelling
    -A map option allowing you to change the order wormholes appear (which appears on Tiny/Small, which appears on Standard, which appears on Huge)
    -ST Galaxy uses this modcomp's code for wormholes, and uses the Barzan wormhole graphics for it's other wormhole.[/COLOR]

    Links:
    Final Frontier version

    Download removed due to mod integration in Star Trek 4.0 (was at 174 downloads).

    Changelog:

    Code:
    v1.52 Changelog:
    -Made compatible with Star Trek 3.25
    -The Dominion now uses the wormhole after the War begins
    
    v1.51 Changelog:
    -Made compatible with Star Trek 3.23
    
    v1.5 Changelog:
    -Now compatible with Star Trek 3.0
    -Fixed a minor bug when Wormholes had the same X or Y coordinates
    
    v1.4 Changelog:
    -Made labeling of wormholes a custom map option
    -Added a map option allowing you to alter the order of wormholes
    -Fixed Wormholes.py wormhole placement bug
    -Altered the way wormholes work in ST Galaxy, added Barzan (purple) art to it
    
    v1.3 Changelog:
    -Streamlined installation process
    -Released via download database instead of attachment
    -Added Barzan Wormhole- pale purple- to Huge Maps
    -Made AI change in DS9 scenario as well
    -Made compatible with Cloaking Devices (see directions)
    
    v1.2 Changelog:
    -Updated to Star Trek 2.37
    -Added WormholesSpiralGalaxy mapscript, places wormholes on spiral galaxy
    -Made AI consider wormhole position before deciding where to build a starbase
    -Version compatible with vanilla Final Frontier, see above link
    
    v1.1 Changelog:
    -Updated to Star Trek 2.30
    -Removed Wormholes from Duel maps
    How to install (as found in the readme):

    1. Unzip the files to a temporary directory (such as Temp/Wormholes... this is defaulted.)

    2. You may wish to back-up the following files: CvFinalFrontierEvents.py and CvAI.py in your Star Trek/Assets/Python directory, in your ST Deep Space Nine/Assets/Python directory, and in your ST Galaxy/Assets/Python directory. Both files in all directories will be overwritten. In addition, the .ini files of Star Trek and ST Galaxy will be overwritten to enable modular loading.

    3. Copy the Mods folder inside of the temporary directory into your Beyond the Sword directory. Say yes to overwrite files.

    4. To test, run the main Star Trek mod. Go into the civilopedia. If "Bajoran Wormhole" appears, you've done it correctly. Then do the same in the DS9 scenario, except you will have to go into the game and actually move a unit into the wormhole to make sure it works. You can use WB for this.

    Credits:
    TC01 for making the module/modcomp.
    God-Emperor for helping fix the WormholesSpiralGalaxy script and with art issues.
    The_J and Deliverator for helping me make the Barzan Wormhole graphics
    JEELEN for suggesting the labelling map option
    renegadechicken for suggesting the order of wormholes option
    deanej for creating the Star Trek Mod and the StarTrekFlat/FinalFrontierFlat mapscript.
    cephalo for making the SpiralGalaxy mapscript.

    Jon Shafer for creating Final Frontier.
    Firaxis/2K Games (maker of civ 4)
    Paramount/Viacom (maker of Star Trek)
     
  2. apenpaap

    apenpaap Tsar of all the Internets

    Joined:
    Apr 7, 2008
    Messages:
    1,468
    Location:
    Amsterdam
    It looks like a pretty cool modmod, but you forgot to put the wormholes.py mapscript in.
     
  3. TC01

    TC01 Deity

    Joined:
    Jun 28, 2009
    Messages:
    2,216
    Location:
    Irregularly Online
    My apologies. Unfortunately I'm not at my home computer right now, so I won't be able to fix it immediately.

    It should be fixed by tonight,
     
  4. TC01

    TC01 Deity

    Joined:
    Jun 28, 2009
    Messages:
    2,216
    Location:
    Irregularly Online
    Okay, I've reattached a new version to the first post. For those who already downloaded it, you'll have to redownload it to get the mapscript.

    Sorry about that...
     
  5. apenpaap

    apenpaap Tsar of all the Internets

    Joined:
    Apr 7, 2008
    Messages:
    1,468
    Location:
    Amsterdam
    None of the systems have planets, and when I move my probe, it gets moved around all the map, picking up about every goody hut in the game. I think you may have made a little error.
     
  6. TC01

    TC01 Deity

    Joined:
    Jun 28, 2009
    Messages:
    2,216
    Location:
    Irregularly Online
    I can see that.

    I'm doing bug-testing right now- there's something wrong with the files included in the zip, because the ones that I was using before worked perfectly... but when I use the zipped ones, they work fine.

    Sorry about this, I should have it cleared up soon.
     
  7. TC01

    TC01 Deity

    Joined:
    Jun 28, 2009
    Messages:
    2,216
    Location:
    Irregularly Online
    Well, I've found the problem. Unfortunately, I have no idea what was causing it.

    It was a bit of code I wrote to label wormholes as "Bajoran Wormhole" or "Red Wormhole". Why this would cause this type of drastic malfunction I'm not sure, but I'll find out. After removing it, the game worked fine. With it included, the game gave me three python exceptions and then did exactly as apenpaap described.

    For now, I've reuploaded the file.

    Hopefully, there's not another bug in it...
     
  8. apenpaap

    apenpaap Tsar of all the Internets

    Joined:
    Apr 7, 2008
    Messages:
    1,468
    Location:
    Amsterdam
    OK, the Solar Systems have planets now, so it's an improvement. The probe still goes crazy, though. Another thing, which may be related, is that the red wormhole doesn't show up, even at the larger maps. Maybe the red wormhole is broken, and the game thinks it must place it all over the map or something like that. Maybe you should try removing it to see if it helps.
     
  9. TC01

    TC01 Deity

    Joined:
    Jun 28, 2009
    Messages:
    2,216
    Location:
    Irregularly Online
    I see the problem. The XML files I put into the download were a back-up version of code before I added the Red Wormhole. That should also fix the other problem, the one with the plot labeling code. It was trying to label every single plot and failing.

    Really sorry about this, thanks for your patience... I'll upload the (hopefully) fixed version afterwards.

    EDIT: As of the time of this edit, I've uploaded the fixed version. I tested it fully. Wormholes appear and are labeled, the probe does not go crazy.
     
  10. apenpaap

    apenpaap Tsar of all the Internets

    Joined:
    Apr 7, 2008
    Messages:
    1,468
    Location:
    Amsterdam
    It works now. It looks very good, especially on a Huge map.
     
  11. Imrahiel

    Imrahiel Chieftain

    Joined:
    Aug 7, 2008
    Messages:
    98
    Great News:crazyeye:.:goodjob::goodjob::goodjob:
     
  12. apenpaap

    apenpaap Tsar of all the Internets

    Joined:
    Apr 7, 2008
    Messages:
    1,468
    Location:
    Amsterdam
    May I use this Module for the next version of my Star Trek Expanded modmod? I will credit you of course.
     
  13. TC01

    TC01 Deity

    Joined:
    Jun 28, 2009
    Messages:
    2,216
    Location:
    Irregularly Online
    Sure, go ahead.

    The 2.30 patch breaks this, but I have a file saved somewhere with changes I did via python- or you could just use a comparison program of some sorts. Everything else, XML-wise, is modular.

    I just downloaded 2.30 now. I'll upload a new version for 2.30 as soon as I finish updating it.
     
  14. TC01

    TC01 Deity

    Joined:
    Jun 28, 2009
    Messages:
    2,216
    Location:
    Irregularly Online
    I've updated Wormholes to v1.1, which adds compatibility for Star Trek 2.30, and also removes wormholes from Duel sized maps. On duel maps, I was either only getting one wormhole, or two very close together, so I decided to just get rid of them.

    The mapsize still exists, but the wormhole won't appear on it.
     
  15. TC01

    TC01 Deity

    Joined:
    Jun 28, 2009
    Messages:
    2,216
    Location:
    Irregularly Online
    For the next version (which I'm waiting until the 2.35 patch to release), I want to add a third wormhole- the Barzan Wormhole (appeared in a TNG episode and a VOY episode). I'd like it to appear as a light purple sort of color (as seen here at Memory Alpha, but maybe a little darker than that). Unfortunately, I have no graphical experience whatsoever, and the time it would take to install the necessary programs, get them running (I've never used them before) and figure out how to do it, even with a tutorial, would seem to be very disproportionate to the amount of work I want to do.

    Can someone with graphical experience please do this for me? This wormhole's being added anyway, but I'd prefer to have a different color to better distinguish them (Bajoran and Barzan sound relatively similar, similar enough they might confuse someone).

    I was trying to add a barrier between the two wormholes, but I'm having a lot of difficulty getting two wormholes to appear on each side, even on a huge map... so instead I'm working on adding a wormhole to the spiral galaxy mapscript. Which may or may not be in the next release.
     
  16. TC01

    TC01 Deity

    Joined:
    Jun 28, 2009
    Messages:
    2,216
    Location:
    Irregularly Online
    I've released an update, updating this modmod to v1.2. New stuff:

    1. Updated to Star Trek 2.37
    2. Added WormholesSpiralGalaxy mapscript, places wormholes on spiral galaxy
    3. Made AI consider wormhole position before deciding where to build a starbase
    4. Version compatible with vanilla Final Frontier (to be released in Modcomp forum soon)

    #4 is not yet finalized, I'm still adding code to the Final Frontier files, but expect a release either today, or (if I don't have the time) tomorrow.
     
  17. apenpaap

    apenpaap Tsar of all the Internets

    Joined:
    Apr 7, 2008
    Messages:
    1,468
    Location:
    Amsterdam
    Though the Jaralbrador wormhole works, the Bajoran wormhole doesn't. No silly thing with probes being moved all over the map and stuff, and it does show up, but it simply doesn't work.
     
  18. TC01

    TC01 Deity

    Joined:
    Jun 28, 2009
    Messages:
    2,216
    Location:
    Irregularly Online
    You mean you move onto it but nothing happens? And the Jalbrador wormhole you can move through? And the wormholes have labels?

    A quick test reveals that, for me, it works... on both mapscripts, Huge size.

    Compare the code below:

    Spoiler My version :
    Code:
    		if pPlot.getFeatureType() == gc.getInfoTypeForString('FEATURE_WORMHOLE'):
    			iX = pPlot.getX()
    			iY = pPlot.getY()
    			for i in range (CyMap().numPlots()):
    				pWormhole = CyMap().plotByIndex(i)
    				if pWormhole.getFeatureType() == gc.getInfoTypeForString('FEATURE_WORMHOLE'):
    					if (pWormhole.getX() != iX and pWormhole.getY() != iY):
    						iiX = pWormhole.getX()
    						iiY = pWormhole.getY()
    						pUnit.setXY(iiX, iiY, False, True, True)
    		if pPlot.getFeatureType() == gc.getInfoTypeForString('FEATURE_RED_WORMHOLE'):
    			eX = pPlot.getX()
    			eY = pPlot.getY()
    			for i in range (CyMap().numPlots()):
    				pRedWormhole = CyMap().plotByIndex(i)
    				if pRedWormhole.getFeatureType() == gc.getInfoTypeForString('FEATURE_RED_WORMHOLE'):
    					if (pRedWormhole.getX() != eX and pRedWormhole.getY() != eY):
    						eeX = pRedWormhole.getX()
    						eeY = pRedWormhole.getY()
    						pUnit.setXY(eeX, eeY, False, True, True)


    Spoiler From the released file :
    Code:
    		if pPlot.getFeatureType() == gc.getInfoTypeForString('FEATURE_WORMHOLE'):
    			iX = pPlot.getX()
    			iY = pPlot.getY()
    			for i in range (CyMap().numPlots()):
    				pWormhole = CyMap().plotByIndex(i)
    				if pWormhole.getFeatureType() == gc.getInfoTypeForString('FEATURE_WORMHOLE'):
    					if (pWormhole.getX() != iX and pWormhole.getY() != iY):
    						iiX = pWormhole.getX()
    						iiY = pWormhole.getY()
    						pUnit.setXY(iiX, iiY, False, True, True)
    		if pPlot.getFeatureType() == gc.getInfoTypeForString('FEATURE_RED_WORMHOLE'):
    			eX = pPlot.getX()
    			eY = pPlot.getY()
    			for i in range (CyMap().numPlots()):
    				pRedWormhole = CyMap().plotByIndex(i)
    				if pRedWormhole.getFeatureType() == gc.getInfoTypeForString('FEATURE_RED_WORMHOLE'):
    					if (pRedWormhole.getX() != eX and pRedWormhole.getY() != eY):
    						eeX = pRedWormhole.getX()
    						eeY = pRedWormhole.getY()
    						pUnit.setXY(eeX, eeY, False, True, True)


    If they look the same (and they do for me), then open up your Event Manager and search for "#Wormholes code -- TC01" or go-to line 1427 (assuming this isn't ST Expanded and you haven't made a change. Then look at that, and then post that.

    Anyone else having the same error?
     
  19. apenpaap

    apenpaap Tsar of all the Internets

    Joined:
    Apr 7, 2008
    Messages:
    1,468
    Location:
    Amsterdam
    Hmmm. Tested it again, and now it works.
     
  20. TC01

    TC01 Deity

    Joined:
    Jun 28, 2009
    Messages:
    2,216
    Location:
    Irregularly Online
    Are you sure both wormholes were on the map?

    I'm thinking that maybe if there was only one, it wouldn't work (which would mean I would need to change the random generation stuff to shrink the distance between Wormholes).

    Which size mapscript were you on? This is the reason I cut Duel, because I was either getting the two wormholes only a few plots away (when I disabled my check) or one wormhole (when it was enabled).
     

Share This Page