Swinkscalibur
Prince
Do you think something like this will work?
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?
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?