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

[MODULE] RifE: Underworld

Discussion in 'Rise from Erebus Modmod' started by Swinkscalibur, Sep 9, 2010.

  1. Swinkscalibur

    Swinkscalibur Prince

    Joined:
    Apr 15, 2009
    Messages:
    332
    Location:
    Oshawa, ON, CA
    Do you think something like this will work?

    Code:
    from CvPythonExtensions import *
    import SdToolKitAdvanced
    
    gc = CyGlobalContext()
    getInfoType = gc.getInfoTypeForString
    objectInit = SdToolKitAdvanced.sdObjectInit
    objectExists = SdToolKitAdvanced.sdObjectExists
    objectSetVal = SdToolKitAdvanced.sdObjetSetVal
    objectGetVal = SdToolKitAdvanced.sdObjectGetVal
    
    UNITTYPE = "UnitType"
    UNITNAME = "UnitName"
    UNITART = "UnitArt"
    ModID = "Underground"
    UnitTypeStats = {UNITTYPE:0, UNITNAME:"", UNITART: 0}
    
    def spellToUnderground(caster):
    	pPlayer = gc.getPlayer(caster.getOwner())
    	iUnit = getInfoType('UNIT_UNDERGROUND')
    	newUnit = pPlayer.initUnit(iUnit, caster.getX(), caster.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_NORTH)
    	objectInit(ModID, newUnit, UnitTypeStats)
    	objectSetVal(ModID, newUnit, UNITTYPE, caster.getUnitType())
    	objectSetVal(ModID, newUnit, UNITNAME, caster.getName())
    	objectSetVal(ModID, newUnit, UNITART, caster.getUnitArtStyleType())
    	newUnit.convert(caster)
    	newUnit.setName(objectGetVal(ModID, newUnit, UNITNAME))
    	newUnit.setUnitArtStyleType(objectGetVal(ModID, newUnit, UNITART))
    	
    def spellFromUnderground(caster):
    	pPlayer = gc.getPlayer(caster.getOwner())
    	iUnit = objectGetVal(ModID, caster, UNITTYPE)
    	newUnit = pPlayer.initUnit(iUnit, caster.getX(), caster.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_NORTH)
    	newUnit.convert(caster)
    
    ps. - anw: what does that module do anyway, getting the value of the counter adds to the counter? Is it just meant to show what the sdTookKit can do?
     
  2. Swinkscalibur

    Swinkscalibur Prince

    Joined:
    Apr 15, 2009
    Messages:
    332
    Location:
    Oshawa, ON, CA
    Just an update. This module is finished except for testing and debugging. I will post it after I do a first pass at bug checking.

    Check back regularly for an update to the first post, some time tonight.
     
  3. Sjru

    Sjru Dragon

    Joined:
    Mar 4, 2010
    Messages:
    620
    Gender:
    Male
    Location:
    Argentina
    So, your night takes 2 days?:lol:

    Do you think this mod could work without the required .dll code changes you stated?
     
  4. El Yahpo

    El Yahpo Chieftain

    Joined:
    Jul 23, 2010
    Messages:
    41
    Location:
    Earth
    You sound like the locust from gears of war, but I agree, that would be awesome.
    Also, say you have a line of tunnels under some plains with a large enemy force advance through it. Maybe tremor would collapse the tunnels under neath and damage units on the surface and kill units in the tunnels?
     
  5. PPQ_Purple

    PPQ_Purple Techpriest Engineer

    Joined:
    Oct 11, 2008
    Messages:
    3,715
    I think that tremor should also permanently disable any further tunnel spawning on the tile.


    PS. Does anyone even realize the strategic potential for this in MP?

    Say for example someone is sending this huge army at you, hiding it under the ground. And you collapse the tunnels on him. But why would you do that?

    Instead, collapse the tunnels around his army. Suddenly, he has this huge army trapped and useless.

    Fun :)
     
  6. Oranos

    Oranos Warlord

    Joined:
    Sep 18, 2009
    Messages:
    114
    They could always leave the tunnel and just attack normally. Plus you would have to know that they are there. Aren't units in tunnels supposed to gain an invisibility of sorts, and not even units in the tunnels with them can see them? But I completely agree this will add a whole new level (literally) of strategy for the tunnelers.
     
  7. A Moon

    A Moon The "A" is silent

    Joined:
    Dec 31, 2009
    Messages:
    682
    Location:
    Me.
    What about civs with an automatic racial promotion, such as the lizardmen? I don't think they can get dwarves, so this is a bit of a penalty for them.
     
  8. Oranos

    Oranos Warlord

    Joined:
    Sep 18, 2009
    Messages:
    114
    Not every civ will be able to access the tunnels. The Dwarves will automatically have access to tunnels, as will the Archos. The Mechanos will gain access at Engineering. Otherwise I don't think anyone else is really intended to use the tunnels.
     
  9. sylvain5477

    sylvain5477 Cerebrus father

    Joined:
    Dec 30, 2007
    Messages:
    752
    Maybe some unique improvement could give access when explored (like the deep well thing)
     
  10. A Moon

    A Moon The "A" is silent

    Joined:
    Dec 31, 2009
    Messages:
    682
    Location:
    Me.
    What about civs that go RoK?
     
  11. Swinkscalibur

    Swinkscalibur Prince

    Joined:
    Apr 15, 2009
    Messages:
    332
    Location:
    Oshawa, ON, CA
    Actually I have updated the first post. Any unit can achieve the ability to enter tunnels, but they have to spend a promotion on it and it requires both engineering and a minimum level of 4. There is another issue though that was completely un-expected. Apparently there is something in the .dll that restricts features from being able to spread to peaks. So even though the xml and python should work perfectly, there are big issues with the mod, in that one of the central points (tunnels and improvements in peaks) of the mod, doesn't work. I am still hoping something can be done without my working on the .dll and making this non-modular. Then again, if I had some assurance that if I made the necessary .dll changes myself, that they would be absorbed into the mod I would still do it. Its about time I made the leap into the .dll anyway.
     
  12. Swinkscalibur

    Swinkscalibur Prince

    Joined:
    Apr 15, 2009
    Messages:
    332
    Location:
    Oshawa, ON, CA
    Just an update. This module is by no means dead. I am going to do the .dll work myself. I may even venture into the realm of adding the code to make invisible features that can co-exist on tiles. But it will take some time, as I am back in school and working toward a PhD. (lots of work) Plus I need to teach myself how to modify the .dll at all, as this will be my first time. Yippee!
     
  13. lloyd33

    lloyd33 Chieftain

    Joined:
    Nov 9, 2008
    Messages:
    35
    I hope this mod is not dead. This is a is great and I hope to see it released
     
  14. A Moon

    A Moon The "A" is silent

    Joined:
    Dec 31, 2009
    Messages:
    682
    Location:
    Me.
    It's been 8 months. If it isn't dead, it's certainly in a worrying coma.
     

Share This Page