[eMOD][WIP] Custom Faction Trait - Lookouts

I tried my hand at making a custom faction trait.  I'll tell you now what it does, and then I'll tell you what I wanted it to do instead but couldn't figure out.  I used existing graphics.

 

What it does:

Lookouts - 1 point

Grants +1 sight to all armies.

Unlocks the spell Eye of the Falcon, a strategic spell that reveals a 6-square radius on the map.  You cannot use the spell on unexplored terrain, but you can use it on the edge to reveal more of the map which counts as exploring.  It's a low-mana spell, so you can use it a lot.  Do note that the program may lock up for a second or two when you cast it.  Think of it like a Comsat sweep from Starcraft.

 

What I wanted it to do:

Same as above, but...

Grants +1 sight to all cities.  Currently cities cannot see beyond their zone of control.  My idea was to allow them to see 1 square outside of their zone of control, allowing you to see incoming armies and monsters better, getting less surprise visits.  I can't figure out how to make this happen.

Eye of the Falcon was meant to be 5 mana and only reveal a 4-square radius.  For some reason I can't get the spell to do less than a 6-square radius, regardless of what I set the radius or value to.  I can get it to be much larger, but I don't want that.  I upped the mana cost to balance out the larger radius (although not too much because of the lack of city sight), but I'd rather it be a lower-impact more frequently usable spell.  You can see in the code I posted below that I left the "Value" at 1, because I found that whether it was 6 or 1 it had the same effect (upping it to 7 or more will increase the radius; "Radius" just seems to change the overlay when targeting).

 

So, if anyone can figure out how to make it do what I want it to, it would be much appreciated.  

Here is the mod:
http://darkseam.com/Lookouts_Faction_Trait.zip 

Just dump it in your \My Games\Fallen Enchantress\Mods folder.  When making a new faction, you should have a scrollbar on the Strengths window, with Lookouts at the bottom.

5,469 views 9 replies
Reply #1 Top

Here is the XML text of the mods, so you don't have to download it if you just want to examine the code.

 

AddFactionTraits_Lookouts.xml:

<?xml version="1.0" encoding="iso-8859-1"?>

<AbilityBonuses>
<AbilityBonus InternalName="Lookouts">
<AbilityBonusType>Player</AbilityBonusType>
<AbilityBonusOption InternalName="Lookouts">
<DisplayName>Lookouts</DisplayName>
<Description>Increases sight range of units by 1 and unlocks Eyes of the Falcon, a spell that reveals a target location.</Description>
<Icon>S_EyesoftheEagle_Icon.png</Icon>
<GameModifier>
<ModType>Player</ModType>
<Attribute>AbilityBonus</Attribute>
<StrVal>A_UnitStat_Sight</StrVal>
<Value>1</Value>
<Provides>+1 Sight</Provides>
</GameModifier>
<GameModifier>
<ModType>Player</ModType>
<Attribute>UnlockSpell</Attribute>
<StrVal>EyesoftheFalcon</StrVal>
<Provides>Unlocks Eyes of the Falcon, a spell which reveals a target area.</Provides>
</GameModifier>
<Cost>1</Cost>
<HideWhenUpgraded>0</HideWhenUpgraded>
<AIData AIPersonality="AI_General">
<AIPriority>5</AIPriority>
</AIData>
</AbilityBonusOption>
</AbilityBonus>
</AbilityBonuses>

 

AddSpells_EyesoftheFalcon.xml:

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- Created with the Elemental Editor -->
<!-- CoreSpells.xml -->
<!-- -->
<Spells>
<DataChecksum NoParse="1">
<Ignore>DisplayName</Ignore>
<Translate>DisplayName</Translate>
</DataChecksum>
<SpellDef InternalName="EyesoftheFalcon">
<DisplayName>Eyes of the Falcon</DisplayName>
<Description>Reveals target location.</Description>
<Image>S_EyesoftheEagle_Painting.png</Image>
<IconFG>S_EyesoftheEagle_Icon.png</IconFG>
<IconBG>S_EyesoftheEagle_Icon_BG.png</IconBG>
<IconColor>245,236,46</IconColor>
<CanStack>0</CanStack>
<SpellBookSortCategory>World</SpellBookSortCategory>
<SpellBookSortSubCategory>Other</SpellBookSortSubCategory>
<SpellType>Strategic</SpellType>
<SpellClass>Defensive</SpellClass>
<SpellSubClass>Buff</SpellSubClass>
<SpellTargetType>NeutralGround</SpellTargetType>
<Radius>6</Radius>
<SpellResourceCost>
<Resource>Mana</Resource>
<Amount>12</Amount>
</SpellResourceCost>
<GameModifier>
<ModType>Map</ModType>
<Attribute>Reveal</Attribute>
<Duration>1</Duration>
<Value>1</Value>
</GameModifier>
<AIData AIPersonality="AI_General">
<AIPriority>5</AIPriority>
</AIData>
<HitSoundFX>Spell_EyesOfTheEagle_01</HitSoundFX>
<SpellDefEffect>
<EffectName>S_EyesoftheEagle_Particle</EffectName>
<LocalPosition>0,50,0</LocalPosition>
<EffectScale>1</EffectScale>
<EffectDelay>0</EffectDelay>
<SnapToTerrain>1</SnapToTerrain>
</SpellDefEffect>
</SpellDef>
</Spells>

Reply #2 Top

Are you sure that

            <GameModifier>
                <ModType>Player</ModType>
                <Attribute>AbilityBonus</Attribute>
                <StrVal>A_UnitStat_Sight</StrVal>
                <Value>1</Value>
                <Provides>+1 Sight</Provides>
            </GameModifier>

works? I tried using it for a faction a few months ago but it didn't give extra sight. I had to put it in each unittype instead for the race.

Reply #3 Top

I thought it was working, but now that I've properly tested it (I was just focused on getting the spell right), I see that it doesn't.  Hrmm...

Reply #4 Top

I would try having the starting ability  unlock a building that gives a +1 sight trait to all units trained in a city with this building.   Make the building really cheap. (You'd probably have to have it unlock a tech which unlocks the building)

 

Also, what stat were you trying to adjust for the city sight radius?

 

Lastly,  It might be possible to have it summon a unit with some negative regeneration, 1 hp, and no attack.   A little eyeball growing out of the ground maybe?   With a 4 square sight radius.

 


 

Reply #5 Top

As far as I can tell, there is no stat for city sight radius.

I thought of the unit idea, but I couldn't figure out how to make it so you can move through it.  My idea was to have the city train a unit with a sight bonus that can't move, is invulnerable, and you can move through it.  You'd train it like a normal unit, it would pop out, and wherever it popped out, there it would sit forever.  It's not a perfect solution, but it's something.  

 

For the unit sight, I've been trying to come up with workarounds, but the only really viable one I can think of is a 0-mana unit enchantment with no upkeep.  It would have the same effect, but it would be kind of annoying having to manually enable the extra sight for every army.  I'll probably do this until I can figure out how to make it work otherwise.  I really don't want to make it a race (which would work, but only for units of that race, so many hired champions wouldn't get it).

Reply #6 Top

I still think your best solution to adding sight to every unit, is to unlock a tech that unlocks a free or nearly free building, and have all units trained in the cities with that building be given a new trait that increases sight by +1

 

Reply #7 Top

The problem with the building idea is the same as the spell idea, but worse.  You'd have to build one in every city because in order to have one that applies to everyone, you'd be using the same code that doesn't work for the faction trait, so it won't work.  You can use different code to do it on an individual city-by-city basis, but then you're building a whole bunch of buildings, and the bonus only applies to trained units.  I'd rather just make it a free-cast spell.  It would be about as much work, but you could apply it to any unit.

I am thinking of using an altered version of your unit idea for the city sight, though.  I'm thinking a 1HP guy with 0 attack, 0 defense, 1 movement rate, 1 production cost, 0 wages, named a Lookout.  You could just produce a bunch of them and then scatter them about, having them keep an eye out for things until they're killed.  Since they cost practically nothing to make, you're not too concerned if they die.  Of course, I'd still have to figure out how to have them set so you could walk through them, like you can with caravans.

I'll put up a modified version of my mod tonight when I'm at work.  For now, it's time for sleep (I work nights).

Reply #8 Top

So you want champions you hire and monsters that join you to gain the same benefit?   The lack of Global spells is in my opinion, the greatest missing component of elemental.

You could eliminate the need to construct the building by adding the "auto train trait" to the core building (the hub for your cities), and have it add sight = SightBonusResource, and then pick your method of adding +1 to that new resource for having the racial ability.  Now all units you train in any of your cities will gain +1 sight, without you having to build or cast anything.   To fix the champions, you could add your 0 mana spell usable on champions only.  At least that way you won't have to cast it on *everything*

be careful with your 0 maintinance cost unit.   Building those in a fortress with unit stat buffs, and enchanted up with + stats / essence spells could be game breakingly powerful.

Reply #9 Top

Hmmm, I'll have to look into that.  I hadn't considered doing both the spell and the trained unit.  As you suggest, that would eliminate some of the casting (and also enchants listed in the Govern window).  I'll see if I can figure out how to do that.

I think you can set units so that they can't be enchanted.  I haven't tried it yet, but I saw a variable that looks like that's what it does.  I'll have to test it out and see if that's actually what it's for.  I hadn't considered fortress buffs, though.  I wonder if there's a way to prevent a unit being affected by them.  I might be able to factor that problem out entirely by making them non-combattable, if that's possible.