[MODULE] RifE: Underworld

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?
 
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.
 
I was expecting this to appear if this game going to become somewhat similar to Age of Wonder's or Heroes of Might and Magic. I thought It be impossible to make because there is no special code that allows us to make two different layer's of map... just everything on the surface, no underground, no space colonization and going to a different world.

Good luck on trying to make this happen, also I recommand adding in some... Obstacles... I'm talking lava, water and flooding issues, cave-in's and pit holes that can possibly affect the surface (imagine collapsing a whole city in one big hole!).

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?
 
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 :)
 
Lost in Tunnel - Automatically gained once requirements are met and lost when requirements are no longer met. Unit must be in a tunnel and no friendly unit with the Dwarven promotion in the tile. Grants invisibility: Subterranean. Unit may not move and has no visibility. 20% chance of unit being destroyed at the end of each turn. Promotion is lost once Subterranean is gained.

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.
 
Maybe some unique improvement could give access when explored (like the deep well thing)
 
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.

What about civs that go RoK?
 
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.
 
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!
 
I hope this mod is not dead. This is a is great and I hope to see it released

It's been 8 months. If it isn't dead, it's certainly in a worrying coma.
 
Top Bottom