[eMod] City Spires

By on March 7, 2014 2:21:57 PM from Elemental Forums Elemental Forums

DsRaider

Join Date 11/2008
+69

So in the March status update I thought up the idea of adding guard tower units to sieges. However I was thinking about it and realized their might be a way to add them in a mod. So I did.

 

This mod removes City Archers from the game and replaces them with towers. These towers are ranged units that will defend your cities and scale much better over time. Along with some small bonuses over city archers they mainly have much higher defense and they will use the best bows available. Upon death the units in the tower will die and no other units will be able to walk on the tower tile.

Much thanks to Abob101, Primal_Savage, and Parrotmath for all their help.

Download: Here

Should be compatible with my other mods.

 

I have released this as is but plan to add a lot more in. I'm still playing around with some stuff and input is welcome.

Future Plans

-Change catapults to be anti tower. Most likely by simply making them slow but have high damage and armor penetration instead of splash.

-Add in a early game siege engine or make catapults available earlier and scale.

-Reduce the amount of Militia but allow them to upgrade their armor.

-Add a Mage Tower to conclaves.

-Add bonus Militia to Towns.

Locked Post 48 Replies
Search this post
Subscription Options


Reason for Karma (Optional)
Successfully updated karma reason!
March 7, 2014 2:42:17 PM from Elemental Forums Elemental Forums

Would it be easier to nix using a human model altogether, instead just creating an enclosed structure? Like, use tile graphics for a unit instead of a unit model. Then use the arrow animation effect for their attack. That at least bypasses the Y axis shift issue.

Reason for Karma (Optional)
Successfully updated karma reason!
March 7, 2014 2:54:35 PM from Elemental Forums Elemental Forums

Quoting davrovana,
Would it be easier to nix using a human model altogether, instead just creating an enclosed structure? Like, use tile graphics for a unit instead of a unit model. Then use the arrow animation effect for their attack. That at least bypasses the Y axis shift issue.

How would you do this though? I don't think you can just sub in a tile for a model.

Reason for Karma (Optional)
Successfully updated karma reason!
March 7, 2014 2:59:31 PM from Elemental Forums Elemental Forums

Quoting DsRaider,


How would you do this though? I don't think you can just sub in a tile for a model.

Dunno. You're more knowledgable than I on the graphics front. But you'll need a tower model from somehwere even if you can adjust y axis, right?

Is your idea that you'll mod the tactical maps to have the tower tile preplaced, then spawn defenders on that tile?

Reason for Karma (Optional)
Successfully updated karma reason!
March 7, 2014 3:18:31 PM from Elemental Forums Elemental Forums

No I would use an unit ability to add a prop to a tile, like how fortify adds a bunch of wooden spikes to a tile. This way I can create the tower using the tile editor. Your right it would be much better to just have a unit model that looks like a tower but that's probably beyond me.

Reason for Karma (Optional)
Successfully updated karma reason!
March 7, 2014 7:50:08 PM from Elemental Forums Elemental Forums

You can use the art assets as a unit model.  Find a simple tower design in the art assets and instead of combining it with other art assets just use it by itself to do what you are describing.  The problem comes from things like push and blade rush abilities.  Blade rushing through a tower seems a little silly and pushing a tower is well ..... i digress.

Reason for Karma (Optional)
Successfully updated karma reason!
March 7, 2014 10:40:03 PM from Elemental Forums Elemental Forums

Yeah it's definitely an idea worth pursuing. 

 

Quoting DsRaider,
How would you do this though? I don't think you can just sub in a tile for a model.

You couldn't sub in a tile, but you could sub in a prop.... have a look for K_Wall_Tower_Advanced_01.hkb.  It might work by just changing the model type for the unit to a prop like that.

The other thing you could probably do is make the model transparent and/or really small (just scale it down to 0.1 or whatever) then do the autocast fortifytower thing and you probably wouldn't see the tiny model under the tower prop.

 

 

Quoting halmal242,
The problem comes from things like push and blade rush abilities.  Blade rushing through a tower seems a little silly and pushing a tower is well ..... i digress.

I think you could fix most of these things.  A lot of abilities you can make a unit immune to by giving them a unitstat and modding the ability so it doesn't work if the target has a unitstat.

Reason for Karma (Optional)
Successfully updated karma reason!
March 7, 2014 10:55:04 PM from Elemental Forums Elemental Forums

Yeah just did a quick test and looks like subbing in a prop for the model will work fine so that'd be the easiest way to go.

 

Reason for Karma (Optional)
Successfully updated karma reason!
March 8, 2014 12:13:27 AM from Elemental Forums Elemental Forums

Thanks Halmal242 and abob101, that's some good advice.

Both directly using a prop as a model and using an ability to create a tile have advantages. Directly using the model means the tower would disappear on death, while creating a tile would allow me to combine props and make it look much better. Creating a tile also would allow my tower to shoot multiple arrows and function as a group of units instead of just one, but again would leave the tower tile after the unit dies. I'm not sure which way I want to go.

Reason for Karma (Optional)
Successfully updated karma reason!
March 8, 2014 3:07:12 AM from Elemental Forums Elemental Forums

Yeah the tile would be better if you can get that to work, like you said you can make it look better.  You could design a fire tower that shoots fireballs and all sorts of cool stuff.

I wonder if a tile prop would work (and disappear when the caster dies) if you changed the duration tag from <DurationOnTile> to just <Duration> or something like that.

Edit -> hmm yeah just had a couple of quick attempts, couldn't get a tile to disappear when the caster died.  Maybe not possible.  

 

Reason for Karma (Optional)
Successfully updated karma reason!
March 8, 2014 3:28:36 AM from Elemental Forums Elemental Forums

I guess you could always go with your original idea... but have the unit at ground level.  Just give them a brick wall type thing around them.  Wouldn't really have the tower type feel more of a heavy fortification.

Reason for Karma (Optional)
Successfully updated karma reason!
March 8, 2014 10:01:09 AM from Elemental Forums Elemental Forums

Since the tower unit is not to be moved you could try and set up a constant effect that is cast at the beginning of the turn that does something upon the death of the tower. You could at that point decorate the tile with destruction or try and remove the tile altogether.

Reason for Karma (Optional)
Successfully updated karma reason!
March 8, 2014 10:55:14 AM from Elemental Forums Elemental Forums

Quoting parrottmath,
Since the tower unit is not to be moved you could try and set up a constant effect that is cast at the beginning of the turn that does something upon the death of the tower.

How would you go about doing that? I didn't think you could trigger something upon the death of a unit.

Reason for Karma (Optional)
Successfully updated karma reason!
March 8, 2014 11:01:49 AM from Elemental Forums Elemental Forums

Take the idea from Infernal Covenant, there is a tag

<GameModifier>
    <ModType>Unit</ModType>
    <Attribute>SummonUnit</Attribute>
    <StrVal>Death Demon</StrVal>
    <UnitClass>DeathDemon</UnitClass>
    <ApplyIfSpellTargetKilled>1</ApplyIfSpellTargetKilled>
    <Duration>-1</Duration>
    <Calculate InternalName="Calc" ValueOwner="TargetUnit">
        <Expression><![CDATA[[Unit_GetLevel] + 7]]></Expression>
    </Calculate>
    <Calculate InternalName="Value">
        <Expression><![CDATA[[Calc]]]></Expression>
    </Calculate>
</GameModifier>

That modifier applies the spell if the particular unit is killed and thus you do a lot of things when a creature dies. I tried using this to do a shape shift for a creature and it worked but failed to give the XP to the unit that was killed and hence it was a bust altogether.

Reason for Karma (Optional)
Successfully updated karma reason!
March 8, 2014 11:29:07 AM from Elemental Forums Elemental Forums

For that to work doesn't the spell have to do the killing? I have never got it to work any other way.

Reason for Karma (Optional)
Successfully updated karma reason!
March 8, 2014 11:50:56 AM from Elemental Forums Elemental Forums

I suppose you might be correct. I wonder if you could set up a damage capture spell that will catch the damage of the enemy and apply it to the unit instead.

I suppose you could give the unit a resistance of 90% and then add the 90% damage to your unit model. Hence, you get a spell that will most likely cause the killing blow in most of the cases. So, if a unit does 10 points of damage, 1 point is gotten through by the unit and 9 points are given by your spell. It wouldn't work perfectly in all cases, but most of the time it should. Then you can apply the other piece.

Reason for Karma (Optional)
Successfully updated karma reason!
March 8, 2014 12:34:26 PM from Elemental Forums Elemental Forums

Not sure if this is the case if the spell is placed normally but when created through autocast Worldprops seem to always be permanent. The Duration and DurationOnTile appear to do nothing.

Quoting parrottmath,
I suppose you could give the unit a resistance of 90% and then add the 90% damage to your unit model. Hence, you get a spell that will most likely cause the killing blow in most of the cases. So, if a unit does 10 points of damage, 1 point is gotten through by the unit and 9 points are given by your spell. It wouldn't work perfectly in all cases, but most of the time it should. Then you can apply the other piece.

What would trigger the damage the spell does? I don't this is possible either. Darn it doesn't seem like it's possible to remove the tile upon the death of the caster.

I guess you could still use a prop as a unitmodel and have it shoot a single arrow, but that's not nearly as cool as having a better looking tower that leaves ruins upon it's destruction.

Reason for Karma (Optional)
Successfully updated karma reason!
March 8, 2014 3:05:44 PM from Elemental Forums Elemental Forums

I was thinking of using the UnitStat_ReflectDamage but target the caster instead. Not sure if that would work given the hard-coded nature of things. I've no clue if this would work (probably won't). But I do like the idea of casting something upon that units death, or near death.

Of course here is another idea that could work. Upon death the unit disappears, you can cast a spell at the beginning that sets up tile destruction that is masked by the unit otherwise. When the unit is destroyed you will see the tile underneath and see the new destroyed tile.

Reason for Karma (Optional)
Successfully updated karma reason!
March 9, 2014 3:42:18 PM from Elemental Forums Elemental Forums

Quoting parrottmath,
I was thinking of using the UnitStat_ReflectDamage but target the caster instead. Not sure if that would work given the hard-coded nature of things. I've no clue if this would work (probably won't). But I do like the idea of casting something upon that units death, or near death.

Unfortunately adding <ApplytoCaster> doesn't work on ReflectDamage, so I couldn't get that to work either. Ya you could do a lot with spells that trigger on death. Like units that explode, leave remains, change form, or you know help modders make guardtowers... I find it weird we can't even change the Y-Position of units, that's usually pretty basic. With that I could make really cool looking tower tiles that any unit could hang out in and fire out of, thus destroying them wouldn't be necessary.

Reason for Karma (Optional)
Successfully updated karma reason!
March 9, 2014 3:55:45 PM from Elemental Forums Elemental Forums

I believe if you want to change the y-axis on these things you need to play with the animation files directly, and define unique animation that puts the unit that high up. Think it might be something they use when they created the mounts, but I'm just making a guess.

Reason for Karma (Optional)
Successfully updated karma reason!
March 10, 2014 9:27:30 AM from Elemental Forums Elemental Forums

Ah.... yeah there's a thought pm, didn't think of that....

(goes off to try something)

 

@DsRaider - try this mate:

<GameItemType InternalName="Test_Airwalker">
  <DisplayName>Test_Airwalker</DisplayName>
  <Description>Horses grant your units more speed in combat and in travel and make them immune to being knocked prone.</Description>
  <Type>Mount</Type>
  <CanBeEquipped>1</CanBeEquipped>
  <AdditionalTrainingTurns>20</AdditionalTrainingTurns>
  <ShopValue>120</ShopValue>
  <GameModifier>
    <ModType>Unit</ModType>
    <Attribute>AdjustUnitStat</Attribute>
    <StrVal>UnitStat_Defense_Pierce</StrVal>
    <Value>5</Value>
    <Provides>+5 Defense, harder to hit</Provides>
  </GameModifier>
  <CutSceneDataPack>HorseMountCutScenePack</CutSceneDataPack>
  <IsAvailableForSovereignCustomization>0</IsAvailableForSovereignCustomization>
  <AIData AIPersonality="AI_General">
    <AIPrefType>AIPrefType_MOUNT</AIPrefType>
  </AIData>
  <ArtDef>Test_Airwalker_ArtDef</ArtDef>
  <GameItemTypeArtDef InternalName="Test_Airwalker_ArtDef">
  <GameItemTypeModelPack InternalName="Test_Airwalker_Default">
    <IconFile>HorseEquipIcon.png</IconFile>
    <TintR>0</TintR>
    <TintG>0</TintG>
    <TintB>0</TintB>
    <EquipSFX>Equip_WoodenItem_01</EquipSFX>
    <MountedAnimationPack>SoldierAnimationPack</MountedAnimationPack>
    <GameItemTypeModel>
      <!--<ModelFile>gfx/hkb/Monsters/M_Horse_Mesh_02.hkb</ModelFile>-->
      <Scale>1</Scale>
      <SkeletonFile>Gfx\HKB\Monsters\M_Horse_Skeleton_01.hkb</SkeletonFile>
      <Texture_Skin>M_Horse_Texture_02.png</Texture_Skin>
      <AnimationPack>MountedHorseAnimationPack</AnimationPack>
      <Attachment>Unit_Mount_Lcf</Attachment>
      <Color_Skin>70,50,35,255</Color_Skin>
      <ShadowImage>/gfx/decals/Shadow_Horse_01.png</ShadowImage>
    </GameItemTypeModel>
  </GameItemTypeModelPack>
  </GameItemTypeArtDef>
</GameItemType>

 

Give it to a unit.... should lift them horse height of the ground.  Change the item <Scale> to make them higher.

Fairly sure that's exactly what you want.

Edit -> With that example, the guys feet will slide around slightly now and then.  To improve it I think you'd want to replace the "MountedHorseAnimationPack" above with a custom one and remove the horse animation that causes the problem.  Should be fixable though.

This could be cool if it works.

Another Edit -> Just did some more testing, could be a few things to iron out but I think it works.  *Might* need to add a modelfile back in.. I think there might be some weird things happening without one... needs more testing.

Reason for Karma (Optional)
Successfully updated karma reason!
March 10, 2014 9:12:00 PM from Elemental Forums Elemental Forums

Thanks Abob101. Check out the results so far.

 I'm working on trying to prevent units from walking on the tile when the archers have been killed now. I might be able to do this by changing the terrain type underneath.

Reason for Karma (Optional)
Successfully updated karma reason!
March 10, 2014 9:18:13 PM from Elemental Forums Elemental Forums

That is nice. Are you setting up the watch tower to be immune to melee damage?

Reason for Karma (Optional)
Successfully updated karma reason!
March 10, 2014 11:29:03 PM from Elemental Forums Elemental Forums

Quoting parrottmath,
Are you setting up the watch tower to be immune to melee damage?

No probably just a bonus to defense, ranged dodge, and a attack bonus to help counter the fact that they will probably stay a group of 3.

Hmmm I thought we could change terrain types but I don't see any examples in the xml.

Reason for Karma (Optional)
Successfully updated karma reason!
March 11, 2014 1:09:59 AM from Elemental Forums Elemental Forums

Ahh that's coming along nicely, cool tower.  It looks neat  

 

Quoting DsRaider,
Hmmm I thought we could change terrain types but I don't see any examples in the xml.

Try this:

<GameModifier>
  <ModType>Map</ModType>
  <Attribute>PlaceTerrain</Attribute>
  <TerrainType>CaveWall</TerrainType>
</GameModifier>

 

Fairly sure that should work.  At work can't test at the minute.

 

Reason for Karma (Optional)
Successfully updated karma reason!
March 11, 2014 9:49:55 AM from Elemental Forums Elemental Forums

See "firestorm" for an example. But abob101 has the example written for you.

Reason for Karma (Optional)
Successfully updated karma reason!
Stardock Forums v1.0.0.0    #101114  walnut1   Server Load Time: 00:00:00.0000750   Page Render Time: