Dungeon Adventure MOD MOD

It always annoyed me when a resource appeared on the map exactly where I wanted to build a future city. I also wondered why you can't move animal resouces like horses and cows.

Well, now you can! I worked up this code to add value to my Dungeon Adventure modmod, but it is useable for any ffH2 offshoot.

In the examples below, I have posted the coding for moveable horses. This code can be modified to work with any other resource, too.

Okay, first things first.

Below is the code for new spell called "Grab Horses." It lets a unit "pick up" a horse resource if the unit is in the same plot as a horse resource. From CIV4SpellInfos.xml:

Spoiler :
Code:
        <SpellInfo>
            <Type>SPELL_GRAB_HORSES</Type>
            <Description>TXT_KEY_SPELL_GRAB_HORSES</Description>
            <Civilopedia>TXT_KEY_SPELL_PLACEHOLDER_PEDIA</Civilopedia>
            <Strategy>NONE</Strategy>
            <Help>TXT_KEY_SPELL_GRAB_HORSES_HELP</Help>
            <PromotionPrereq1>NONE</PromotionPrereq1>
            <PromotionPrereq2>NONE</PromotionPrereq2>
            <UnitPrereq>NONE</UnitPrereq>
            <UnitClassPrereq>NONE</UnitClassPrereq>
            <UnitCombatPrereq>NONE</UnitCombatPrereq>
            <UnitInStackPrereq>NONE</UnitInStackPrereq>
            <CivilizationPrereq>NONE</CivilizationPrereq>
            <ReligionPrereq>NONE</ReligionPrereq>
            <StateReligionPrereq>NONE</StateReligionPrereq>
            <TechPrereq>NONE</TechPrereq>
            <bAllowAI>1</bAllowAI>
            <bAdjacentToWaterOnly>0</bAdjacentToWaterOnly>
            <bCausesWar>1</bCausesWar>
            <bGlobal>0</bGlobal>
            <bInBordersOnly>0</bInBordersOnly>
            <bInCityOnly>0</bInCityOnly>
            <iAIWeight>50</iAIWeight>
            <bDisplayWhenDisabled>0</bDisplayWhenDisabled>
            <bHasCasted>1</bHasCasted>
            <bIgnoreHasCasted>0</bIgnoreHasCasted>
            <bResistable>0</bResistable>
            <iRange>0</iRange>
            <iResistModify>0</iResistModify>
            <iDamage>0</iDamage>
            <iDamageLimit>0</iDamageLimit>
            <DamageType>NONE</DamageType>
            <AddPromotionType1>PROMOTION_HORSE_THIEF</AddPromotionType1>
            <AddPromotionType2>NONE</AddPromotionType2>
            <AddPromotionType3>NONE</AddPromotionType3>
            <RemovePromotionType1>NONE</RemovePromotionType1>
            <RemovePromotionType2>NONE</RemovePromotionType2>
            <RemovePromotionType3>NONE</RemovePromotionType3>
            <bBuffCasterOnly>1</bBuffCasterOnly>
            <ConvertUnitType>NONE</ConvertUnitType>
            <CreateBuildingType>NONE</CreateBuildingType>
            <CreateFeatureType>NONE</CreateFeatureType>
            <CreateImprovementType>NONE</CreateImprovementType>
            <SpreadReligion>NONE</SpreadReligion>
            <CreateUnitType>NONE</CreateUnitType>
            <iCreateUnitNum>0</iCreateUnitNum>
            <bPermanentUnitCreate>0</bPermanentUnitCreate>
            <CreateUnitPromotion>NONE</CreateUnitPromotion>
            <bImmuneTeam>0</bImmuneTeam>
            <bImmuneNeutral>0</bImmuneNeutral>
            <bImmuneEnemy>0</bImmuneEnemy>
            <bImmuneFlying>0</bImmuneFlying>
            <bImmuneNotAlive>0</bImmuneNotAlive>
            <bDispel>0</bDispel>
            <bPush>0</bPush>
            <bRemoveHasCasted>0</bRemoveHasCasted>
            <bSacrificeCaster>0</bSacrificeCaster>
            <iChangePopulation>0</iChangePopulation>
            <iCost>0</iCost>
            <iImmobileTurns>0</iImmobileTurns>
            <iMiscastChance>0</iMiscastChance>
            <PyMiscast></PyMiscast>
            <PyResult>spellGrabHorses(pCaster)</PyResult>
            <PyRequirement>reqGrabHorses(pCaster)</PyRequirement>
            <Effect>EFFECT_SPELL1</Effect>
            <Sound>AS3D_SPELL_TRAIN</Sound>
            <HotKey></HotKey>
            <bAltDown>0</bAltDown>
            <bShiftDown>0</bShiftDown>
            <bCtrlDown>0</bCtrlDown>
            <bGraphicalOnly>1</bGraphicalOnly>
            <iHotKeyPriority>0</iHotKeyPriority>
            <Button>Art/Interface/Buttons/actions/grabhorse.dds</Button>
        </SpellInfo>

Note that there are custom requirement and spell python entries for this spell. Also, the button art for the action interface is one I made up. It is just the horse resource button with a green "+" superimposed.

Here is the "drop horses" spell:

Spoiler :
Code:
        <SpellInfo>
            <Type>SPELL_DROP_HORSES</Type>
            <Description>TXT_KEY_SPELL_DROP_HORSES</Description>
            <Civilopedia>TXT_KEY_SPELL_PLACEHOLDER_PEDIA</Civilopedia>
            <Strategy>NONE</Strategy>
            <Help>TXT_KEY_SPELL_DROP_HORSES_HELP</Help>
            <PromotionPrereq1>PROMOTION_HORSE_THIEF</PromotionPrereq1>
            <PromotionPrereq2>NONE</PromotionPrereq2>
            <UnitPrereq>NONE</UnitPrereq>
            <UnitClassPrereq>NONE</UnitClassPrereq>
            <UnitCombatPrereq>NONE</UnitCombatPrereq>
            <UnitInStackPrereq>NONE</UnitInStackPrereq>
            <CivilizationPrereq>NONE</CivilizationPrereq>
            <ReligionPrereq>NONE</ReligionPrereq>
            <StateReligionPrereq>NONE</StateReligionPrereq>
            <TechPrereq>NONE</TechPrereq>
            <bAllowAI>1</bAllowAI>
            <bAdjacentToWaterOnly>0</bAdjacentToWaterOnly>
            <bCausesWar>0</bCausesWar>
            <bGlobal>0</bGlobal>
            <bInBordersOnly>0</bInBordersOnly>
            <bInCityOnly>0</bInCityOnly>
            <iAIWeight>50</iAIWeight>
            <bDisplayWhenDisabled>1</bDisplayWhenDisabled>
            <bHasCasted>1</bHasCasted>
            <bIgnoreHasCasted>0</bIgnoreHasCasted>
            <bResistable>0</bResistable>
            <iRange>0</iRange>
            <iResistModify>0</iResistModify>
            <iDamage>0</iDamage>
            <iDamageLimit>0</iDamageLimit>
            <DamageType>NONE</DamageType>
            <AddPromotionType1>NONE</AddPromotionType1>
            <AddPromotionType2>NONE</AddPromotionType2>
            <AddPromotionType3>NONE</AddPromotionType3>
            <RemovePromotionType1>PROMOTION_HORSE_THIEF</RemovePromotionType1>
            <RemovePromotionType2>NONE</RemovePromotionType2>
            <RemovePromotionType3>NONE</RemovePromotionType3>
            <bBuffCasterOnly>1</bBuffCasterOnly>
            <ConvertUnitType>NONE</ConvertUnitType>
            <CreateBuildingType>NONE</CreateBuildingType>
            <CreateFeatureType>NONE</CreateFeatureType>
            <CreateImprovementType>NONE</CreateImprovementType>
            <SpreadReligion>NONE</SpreadReligion>
            <CreateUnitType>NONE</CreateUnitType>
            <iCreateUnitNum>0</iCreateUnitNum>
            <bPermanentUnitCreate>0</bPermanentUnitCreate>
            <CreateUnitPromotion>NONE</CreateUnitPromotion>
            <bImmuneTeam>0</bImmuneTeam>
            <bImmuneNeutral>0</bImmuneNeutral>
            <bImmuneEnemy>0</bImmuneEnemy>
            <bImmuneFlying>0</bImmuneFlying>
            <bImmuneNotAlive>0</bImmuneNotAlive>
            <bDispel>0</bDispel>
            <bPush>0</bPush>
            <bRemoveHasCasted>0</bRemoveHasCasted>
            <bSacrificeCaster>0</bSacrificeCaster>
            <iChangePopulation>0</iChangePopulation>
            <iCost>0</iCost>
            <iImmobileTurns>0</iImmobileTurns>
            <iMiscastChance>0</iMiscastChance>
            <PyMiscast></PyMiscast>
            <PyResult>spellDropHorses(pCaster)</PyResult>
            <PyRequirement>reqDropHorses(pCaster)</PyRequirement>
            <Effect>EFFECT_SPELL1</Effect>
            <Sound>AS3D_SPELL_TRAIN</Sound>
            <HotKey></HotKey>
            <bAltDown>0</bAltDown>
            <bShiftDown>0</bShiftDown>
            <bCtrlDown>0</bCtrlDown>
            <bGraphicalOnly>1</bGraphicalOnly>
            <iHotKeyPriority>0</iHotKeyPriority>
            <Button>Art/Interface/Buttons/actions/drophorse.dds</Button>
        </SpellInfo>

Pretty similar. It reverses the actions of the "grab horses" spell. The custom button for this spell is the horses resource button with a red "-" superimposed.

And here are the relevant CvSpellInterface.py entires for both spells:

Spoiler :
Code:
def reqGrabHorses(caster):
	pPlot = caster.plot()
	if caster.isHasPromotion(gc.getInfoTypeForString('PROMOTION_HORSE_THIEF')):
		return False
	if pPlot.getBonusType(-1) != gc.getInfoTypeForString('BONUS_HORSE'):
		return False
	return True

def spellGrabHorses(caster):
	pPlot = caster.plot()
	pPlot.setBonusType(-1)
	pPlot.setImprovementType(-1)
	if pPlot.isOwned():
		startWar(caster.getOwner(), pPlot.getOwner())

def reqDropHorses(caster):
	pPlot = caster.plot()
#	if pPlot.getOwner() != caster.getOwner():
#		return False
	if pPlot.isWater():
		return false
	if pPlot.isCity():
		return False
	if pPlot.getBonusType(-1) != -1:
		return False
	return True

def spellDropHorses(caster):
	pPlot = caster.plot()
	iBonus = gc.getInfoTypeForString('BONUS_HORSE')
	pPlot.setBonusType(iBonus)

The "req" entries for "grab" make sure that you can't grab horses if you already have some, or if the plot in question doesn't have horses in it. The req entries for "drop" make sure you can't drop the horse resource on a plot that is water, a city, or already has a resource of some kind. The commented out part, if reactivated, would only let you drop the horses in a plot that you owned.

Grabbing horses removes the resource from the tile (and destroys any improvements -- this can be commented out, though), and then gives the unit a special promotion called PROMOTION_HORSE_THIEF. Dropping the horses removes the promotion and plops a horse resource down on the current plot.

Also, grabbing horses from a plot that someone else owns starts a war.

And here is the example of the promotion from the CIV4PromotionInfos.xml file:

Spoiler :
Code:
        <PromotionInfo>
            <Type>PROMOTION_HORSE_THIEF</Type>
            <Description>TXT_KEY_PROMOTION_HORSE_THIEF</Description>
            <Help></Help>
            <Sound>AS2D_IF_LEVELUP</Sound>
            <LayerAnimationPath>NONE</LayerAnimationPath>
            <PromotionPrereq>NONE</PromotionPrereq>
            <PromotionPrereqOr1>NONE</PromotionPrereqOr1>
            <PromotionPrereqOr2>NONE</PromotionPrereqOr2>
            <TechPrereq>NONE</TechPrereq>
            <StateReligionPrereq>NONE</StateReligionPrereq>
            <bLeader>0</bLeader>
            <bBlitz>0</bBlitz>
            <bAmphib>0</bAmphib>
            <bRiver>0</bRiver>
            <bEnemyRoute>0</bEnemyRoute>
            <bAlwaysHeal>0</bAlwaysHeal>
            <bHillsDoubleMove>0</bHillsDoubleMove>
            <bImmuneToFirstStrikes>0</bImmuneToFirstStrikes>
            <iVisibilityChange>0</iVisibilityChange>
            <iMovesChange>1</iMovesChange>
            <iMoveDiscountChange>0</iMoveDiscountChange>
            <iAirRangeChange>0</iAirRangeChange>
            <iInterceptChange>0</iInterceptChange>
            <iEvasionChange>0</iEvasionChange>
            <iWithdrawalChange>0</iWithdrawalChange>
            <iCargoChange>0</iCargoChange>
            <iCollateralDamageChange>0</iCollateralDamageChange>
            <iBombardRateChange>0</iBombardRateChange>
            <iFirstStrikesChange>0</iFirstStrikesChange>
            <iChanceFirstStrikesChange>0</iChanceFirstStrikesChange>
            <iEnemyHealChange>0</iEnemyHealChange>
            <iNeutralHealChange>0</iNeutralHealChange>
            <iFriendlyHealChange>0</iFriendlyHealChange>
            <iSameTileHealChange>0</iSameTileHealChange>
            <iAdjacentTileHealChange>0</iAdjacentTileHealChange>
            <iCombatPercent>0</iCombatPercent>
            <iCityAttack>0</iCityAttack>
            <iCityDefense>0</iCityDefense>
            <iHillsAttack>0</iHillsAttack>
            <iHillsDefense>0</iHillsDefense>
            <iKamikazePercent>0</iKamikazePercent>
            <iRevoltProtection>0</iRevoltProtection>
            <iCollateralDamageProtection>0</iCollateralDamageProtection>
            <iPillageChange>0</iPillageChange>
            <iUpgradeDiscount>0</iUpgradeDiscount>
            <iExperiencePercent>0</iExperiencePercent>
            <TerrainAttacks>
            </TerrainAttacks>
            <TerrainDefenses>
            </TerrainDefenses>
            <FeatureAttacks>
            </FeatureAttacks>
            <FeatureDefenses>
            </FeatureDefenses>
            <UnitCombatMods>
            </UnitCombatMods>
            <DomainMods>
            </DomainMods>
            <TerrainDoubleMoves>
            </TerrainDoubleMoves>
            <FeatureDoubleMoves>
            </FeatureDoubleMoves>
            <UnitCombats>
            </UnitCombats>
            <HotKey></HotKey>
            <bAltDown>0</bAltDown>
            <bShiftDown>0</bShiftDown>
            <bCtrlDown>0</bCtrlDown>
            <bGraphicalOnly>0</bGraphicalOnly>
            <iHotKeyPriority>0</iHotKeyPriority>
            <Button>Art/Interface/Buttons/WorldBuilder/Horse.dds</Button>
            <bBoarding>0</bBoarding>
            <bOnlyDefensive>0</bOnlyDefensive>
            <bDispellable>0</bDispellable>
            <bDoubleFortifyBonus>0</bDoubleFortifyBonus>
            <bEquipment>0</bEquipment>
            <bFear>0</bFear>
            <bFlying>0</bFlying>
            <bHiddenNationality>0</bHiddenNationality>
            <bIgnoreBuildingDefense>0</bIgnoreBuildingDefense>
            <bImmortal>0</bImmortal>
            <bImmuneToCapture>0</bImmuneToCapture>
            <bImmuneToFear>0</bImmuneToFear>
            <bImmuneToMagic>0</bImmuneToMagic>
            <bInvisible>0</bInvisible>
            <bMutation>0</bMutation>
            <bNotAlive>0</bNotAlive>
            <bPrereqAlive>0</bPrereqAlive>
            <bRace>0</bRace>
            <bRemovedByCasting>0</bRemovedByCasting>
            <bRemovedByCombat>0</bRemovedByCombat>
            <bRemovedWhenHealed>0</bRemovedWhenHealed>
            <bTargetWeakestUnit>0</bTargetWeakestUnit>
            <bTargetWeakestUnitCounter>0</bTargetWeakestUnitCounter>
            <bTwincast>0</bTwincast>
            <bValidate>0</bValidate>
            <bWaterWalking>0</bWaterWalking>
            <iAIWeight>0</iAIWeight>
            <iBetrayalChance>0</iBetrayalChance>
            <iBetterDefenderThanPercent>0</iBetterDefenderThanPercent>
            <iCasterResistModify>0</iCasterResistModify>
            <iCombatCapturePercent>0</iCombatCapturePercent>
            <iCombatHealPercent>0</iCombatHealPercent>
            <iCombatPercentDefense>0</iCombatPercentDefense>
            <iCombatPercentGlobalCounter>0</iCombatPercentGlobalCounter>
            <iCombatPercentInBorders>0</iCombatPercentInBorders>
            <iExpireChance>0</iExpireChance>
            <iExtraCombatStr>0</iExtraCombatStr>
            <iExtraCombatDefense>0</iExtraCombatDefense>
            <iFreeXPPerTurn>0</iFreeXPPerTurn>
            <iFreeXPFromCombat>0</iFreeXPFromCombat>
            <iModifyGlobalCounter>0</iModifyGlobalCounter>
            <iResistMagic>0</iResistMagic>
            <iSpellCasterXP>0</iSpellCasterXP>
            <iSpellDamageModify>0</iSpellDamageModify>
            <CaptureUnitCombat>NONE</CaptureUnitCombat>
            <PromotionCombatApply>NONE</PromotionCombatApply>
            <PromotionImmune1>NONE</PromotionImmune1>
            <PromotionImmune2>NONE</PromotionImmune2>
            <PromotionImmune3>NONE</PromotionImmune3>
            <PromotionRandomApply>NONE</PromotionRandomApply>
            <PromotionSummonPerk>NONE</PromotionSummonPerk>
            <BonusPrereq>NONE</BonusPrereq>
            <PromotionPrereqOr3>NONE</PromotionPrereqOr3>
            <PromotionPrereqOr4>NONE</PromotionPrereqOr4>
            <PromotionPrereqAnd>NONE</PromotionPrereqAnd>
            <PromotionNextLevel>NONE</PromotionNextLevel>
            <PyPerTurn></PyPerTurn>
            <iGroupSize>0</iGroupSize>
            <UnitArtStyleType>NONE</UnitArtStyleType>
            <PromotionCombatType>NONE</PromotionCombatType>
            <iPromotionCombatMod>0</iPromotionCombatMod>
            <DamageTypeCombats>
            </DamageTypeCombats>
            <BonusAffinities>
            </BonusAffinities>
            <DamageTypeResists>
            </DamageTypeResists>
        </PromotionInfo>

Really all it does is act as an indicator that the unit is "carrying" horses and allow the unit to cast the "drop horses" spell. Just for fun, I also made this promotion give the unit +1 movement.

******************

That's it. It really is that simple. Using this model, it is possible to make any resource portable.

The only downside currently is that if a carrying unit is killed, the resource does not get dropped like equipment. Instead, it is just lost forever. I am still playing around with expanding this concept to allow a free flow between special equipment-like units, a traditional resource, and the indicator promotions. That way, for example,a unit carrying horses could either place them as a resource, or "set them free" to create a horse unit of some kind.

I really like this idea, especially for animal resources. Potentially, a player would have to go out an "catch" a wild horses unit before ever being able to get a horses resource. Same could work for elephants to ivory!

Anyway, that was the concept I had working right before the pre-Alpha release of DA got irreparably buggy under Vista. The free conversion between resource, promotion, and unit really opens up new possibilities!

Well, that's it for this one. Hope you like it!
 
:eek: :D

Wow. Thank you for posting that! That is really motivating!

[feels guilty for getting distracted by Spore...]

In the podcast, it was mentioned that the plan is to have the "final" release of FfH2 around December. Is that still the target?

I ask because one of my challenges is trying to keep up with a platform that gets refined so often. It would be nice to build the mod mod off of a version that won't morph too much afterwards. At least knowing for sure that there will be no DLL changes or Schema changes would be a huge help.

In the meantime, I hope to keep dropping DA mod Giblets out there for people to enjoy and use in their own mods. Looks like the claim flags and 360 camera were well received.

That is the target. But I wouldn't plan on waiting until then.

To be honest if I were a modmodder I wouldn't worry about updating to every minor version. Instead I would update to major versions, especially with a mod that changes the game as significantly as yours.

And I would never update to brand new major versions. Let it settle down until its been more than a week between patches before considering. So go to 0.32i, then dont consider jumping again until we have a solid version of 0.33 that isn't having major issues.

Thats my take at least. Stay on focus on moving your project forward and don't waste a ton of time trying to keep up with us (though its nice to watch the changelog and now what will be available to you when you do move forward).
 
I got an interesting question posed to me today by a fellow Civfanatic:

Ingvar said:
I was reading your Modmod thread, and it looked like you might be able to help me. It looks like I am trying to figure out how to make units automatically upgrade based on the number of turns they exist.

Have you come across any python variable that would allow to find out how many turns did a unit exist?

Thanks!


In addition to responding to Ingvar directly, I am posting my answer in this thread because:

a) I actually knew the answer, and this is a rare opportunity for me to look competent,

b) Ingvar has a cool idea that, if implemented correctly, could open up some neat new features for the FfH2 community, and

c) Information just wanna be fwee!

My answer was ------


Here is what I would suggest:

Go look at the CvEventManager.py file. Scroll down until you get to the "def onBeginGameTurn" code block. This code block is used to check the game turn for events like creating Orthus and the Rat Catcher's Guild.

The important bit within that block is the:

Code:
iGameTurn = argsList[0]

that makes the new variable "iGameturn" equal to the currrent game turn.

Next, for any unit, you can call a python function that returns the game turn in which the unit was created. My "claim flag" code makes use of this. For example, if you have already defined "pUnit" as a part of a logical loop in your new python function, you could set up this:

Code:
iUnitCreated = pUnit.getGameTurnCreated()

Then, to see how old a unit is, just do this:

Code:
iUnitAge = (iGameTurn - iUnitCreated)

Then set up your conditional upgrade checks. For example:

Code:
if iUnitAge >= 10:
	{insert upgrade instruction code here}

Hope that helps!
 
Just wanted to drop a quick note to everyone explaining the inactivity in this forum.

Suffice it to say that Real Life is interfering with my modding. This should get better eventually, but it will be a while.

This mod mod is NOT cancelled -- it will just lie fallow for a time. Once things get more squared away in RL, I hope to resume working on this project.

In the meantime, please check out the Mod Giblets that were released earlier. Some of them are fun to play around with if you do modding of your own.

Thanks!
 
Okay, so I'm not actually back to real coding yet, but I have been doing some notional coding "in my head" lately. I got the following idea from a DA mod giblet thread:

Egg-layers.

The orginal concept in DA had invisible units that ran around the dungeon, occasionally spawning new low-level critters to help keep the dungeon populated. The Adventurers would not interact with these units at all - they served only as mobile spawners.

I plan to change these units to egg-layers instead. These units would be visible, but have a high withdrawal percent (sort of like Loki). These critters would run around and lay "eggs," which would hatch into new monsters after a certain number of turns.

A promotion of the egg-layer would determine the type of egg laid which, in turn, would determine what type of critter would hatch from the egg and how long it would take.

Adventurers would have a big incentive to find and destroy eggs before they hatch.

They would also be a certain sense of satisfaction derived from tracking down and destroying an egg-layer.

Love this idea. Very easy to code, as it is a minor variation on my existing spawner unit scheme.
 
that is a great idea, but dont leave it at eggs. why not have them create wasp nests, wolf lairs and goblin camps too? with different creating units of course.

great idea,... but please, no giant wasps or insects :) they are soo stereotype and super mario already smashed the hell out of them.
 
Damnit seZ... now I want a Goomba Model in FfH.

:) spawning from the mushroom resource?
I don´t think they can survive in erebus, if they don´t even stand a chance against an italian plumper :P

@Psychic_Llamas: yea, normal wasps are fine. one could use the effect of the "sect of flies" unit with the swirling flies as the wasp swarm model.
 
EDIT:

Nevermind the message below -- I found something that I can use. I just reskinned and resized a cage. Works and looks okay!

-----------------------------------------------------------------------

This request goes out to seZereth, xienwolf, Psychic_Llamas or anyone else with NIF creation tools:

Friends, I need a cube.

Sounds dumb, I know, but I need one.

This cube will be a dungeon terrain feature. It must fill the entire plot it is in. It also needs to be just big enough so that if two of them are placed right next to each other, they will touch or overlap just enough to create a seamless join.

Ideally, the accompanying DDS texture file would be marked to show the "edges" of the cube. So -- one solid color (pink, whatever), with drawn lines to show where the edges end up being mapped onto the NIF.

If anyone could produce this, and post a link to it in this thread, I would be very thankful.
 
EDIT:

Nevermind the message below -- I found something that I can use. I just reskinned and resized a cage. Works and looks okay!

-----------------------------------------------------------------------

This request goes out to seZereth, xienwolf, Psychic_Llamas or anyone else with NIF creation tools:

Friends, I need a cube.

Sounds dumb, I know, but I need one.

This cube will be a dungeon terrain feature. It must fill the entire plot it is in. It also needs to be just big enough so that if two of them are placed right next to each other, they will touch or overlap just enough to create a seamless join.

Ideally, the accompanying DDS texture file would be marked to show the "edges" of the cube. So -- one solid color (pink, whatever), with drawn lines to show where the edges end up being mapped onto the NIF.

If anyone could produce this, and post a link to it in this thread, I would be very thankful.

wow. whats your plan for this?
 
My guess was stairs actually. Hrm... I wonder if you could make use of the Elevation mechanics to pull off stairs and "higher floors" by stacking a few cubes. Obviously nothing would be on the space beneath your floor, but a different height can still have an impact on feel for the player :)
 
But before that, a comment on xienwolf's post: I'd love to know how elevation mechanics work. Right now, the threshold plate on my doors sticks above ground level, but the units just sink into it.

Anyway -- here is a puzzler:

I am trying to do a python check in onCombatResult to look to see if all of the units of a given player are gone. That is, no units alive on the board. I want to trigger a victory pop up, sort of like what happens in Age of Ice when Mulcarns or Kylorin is killed. This isn't quite the same as a conquest victory with the "must hunt down all units" option ticked. In that option, still having an enemy city on the board will prevent victory.

So that's it. How does one effectively do a check right after a combat result to see of the loser has just lost his last unit?

Thanks!
 
Well, if you query PyPlayer(gc.getPlayer(iPlayerNum)).getUnitList() then you have a list of all the units that the player owns. So I guess you'd just check to see if that list is size 0, and that means they have no units.

Pretty sure that the variable which tracks the total number of units a player owns is also exposed to python. Check the Maintenance screen tooltip section of the code for that particular function name I'd imagine. I do know there is such a variable, as the game tracks win/loss based on getNumCities && getNumUnits when you have Complete Kills option selected, and you are simply seeking to not include the number of cities in the check.
 
so for example --

if PyPlayer(gc.getPlayer(1)).getUnitList() == 0:
[do action stuff]
[other action stuff]

Would this check to see if the list for player 1 (actually the second player since the first player is "0") is empty and then execute the actions?

Am I parsing the conditional statement correctly, or does the "==" need to be an "=" or something else? Do you still use "0" for an empty set or is there another symbol?

I've noticed that Age of Ice uses some getUnitClassCount statements that have "> 0" as the condition. (These are in the onCombatResult code and check to see if Mulcarn or Kylorin were killed). I would have figured it should be written "=> 0" for python, but I think that there is a nuance to coding that I am missing here. Is it different for strings versus integers?
 
Back
Top Bottom