Assigning Strategic Spell for unit?

Hey guys!

Soooooo, here's what I've done so far.

1) Create new resource (building supplies).  Check.

2) Add resource production to unit via ability (builder).  Check.

3) Get said resource to accumulate globally, and show up next to the mana icon.  Check.

4) Create new Build Arcane Monolith type spell that uses said resource instead of mana, with a range of 1.  Check.

5) Test Build Arcane Monolith spell via Sov casting.  Sov can create Arcane Monolith in adjacent square using building supplies instead of mana.  Check.

6) Assign this spell to a (normal) unit... AAAAAARRRGH!

 

I've tried doing this a number of ways.  I see that Air Elementals have a

        <SelectedAbilityBonusOption>Spell_GustOfWind</SelectedAbilityBonusOption>

in their description.  I tried changing spell name and manually inserting this into the unit code.  Icon show up, no casting option (clicking just goes to the unit description window).

 

I've tried creating an ability that grants the spell to the unit with the ability.  This just makes it available for the Sov, if I code it just right... but the unit isn't able to cast it (not listed as unit that has ability under spell casting).

 

BTW, I've tried a direct Build option for this.  Unless it says UnlockAction/BuildImprovement/Monument I just get a greyed out box where build is supposed to be.  Tried UnlockAction/BuildWildImprovement, and the Build box doesn't even show up.

 

I've tried creating an item (accessory) tied to the unit ability.  No help.

 

What really annoys me is that UnlockAction/BuildRoad doesn't consume the unit, but as far as I can tell the code for this operation is out of our reach.  Otherwise, I'd code an .xml action based on the roadbuilding routine and all would be right in the world!

 

I SUPPOSE I could make this a Champion ability, but my goal here is to round out my builder type unit, by having them move to the build location and construct a monument (and perhaps perform upgrades later via similar spells).  Everything else is in place EXCEPT the ability of the unit to cast the necessary 'spell'.

Thinking waaaaay outside the box, I could have the unit summon another unit who's sole purpose is to convert itself into a monument... but that's just silly!  Might as well just have the city build an outpost settler at that point, which converts itself into an outpost, which is what I'm trying to NOT do.

 

Anyone have any suggestions on how to get a unit to show/own/cast a strategic spell?

2,702 views 3 replies
Reply #1 Top

Try giving the unit <HasEssence>true</HasEssence>

Reply #2 Top

Checked, yes the unit already has <HasEssence>true</HasEssence>  , no doubt related to the Blood_Amarian/Soul Spark ability.

 

Tried changing the spellbooks from world/map to unit/other, no dice

 

Tried adding <IsSpecialAbility>, just makes spell dissapear completely.  I'd be good with that, as long as there was a button somewhere I could click that would cast spell when resource requirement was met.  No dice.

 

Idiot checking here: Unit has:
        <SelectedAbilityBonusOption>Spell_BuildersMonolith</SelectedAbilityBonusOption>

Spelldef is:

<SpellDef InternalName="BuildersMonolith">
        <DisplayName>Builder's Monolith</DisplayName>
        <Description>Creates an Builder's Monolith on the map which extends your Zone of Control.</Description>
        <Image>S_ArcaneMonolith_Painting.png</Image>
        <IconFG>S_ArcaneMonolith_Icon.png</IconFG>
        <AutoUnlock>1</AutoUnlock>
        <CanStack>0</CanStack>
        <SpellBookSortCategory>World</SpellBookSortCategory>
        <SpellBookSortSubCategory>Map</SpellBookSortSubCategory>
        <SpellType>Strategic</SpellType>
        <SpellClass>Terraform</SpellClass>
        <SpellSubClass>BuildOutpost</SpellSubClass>
        <SpellTargetType>NeutralGround</SpellTargetType>
        <Range>1</Range>
        <!--<IsCastable>0</IsCastable>-->
        <!--<IsSpecialAbility>1</IsSpecialAbility>-->

(etc etc etc)

Which is the most direct way to make the spell call that I can think of.  Since the 'abilitybonusoption' call works for Air Elementals, I figure it should work here... but alas.

And I know that the spell works, at least with the Sov.  I am currently autounlocking the spell (removing this hides the spell completely from both the sov and the unit as far as I can tell).

 

I hate to run into a brick wall like this.  I SUPPPOSE I could live with Champs having this spell/ability instead of units, using the resources the unit provides (so as to not tie up the build cue), but that wasn't my goal...

-_-

hep.... hellllp...

Reply #3 Top

OK, quick update...

As some of you probably expected, I ended up adding a new trait to the general trait tree, that gives the build monument ability (range 1, unlike Arcane Monolith) for Champions and Sovs.  This grants the spell that gives the Build(ers) Monument ability, which uses building supplies instead of mana.

Said building supplies are produced by a unit that has the special ability to do this (it also reduces production time).

I tried to create a spell that could upgrade the monument, but it doesn't work.  Doing a forum search, I'm sure Parrotmath is amused that I also tried (unsuccessfully), as he ran into the same issue.  At least I'm not building extra monuments, just making colorful swirls on blank squares and wasting supplies...

Soooo, I'll probably make a spell that converts building supplies into production.  I was also thinking of a spell that harvests/builds on resources, but reading Parrotmath's comments, that probably won't work out.  This ability would be ideal for that (move next to resource, cast spell, harvest), hence not tying up the build cue, perhaps with a casting time similar (think the 10 turn delay for spell of making, but more like 2-4 turns).  Can you tell I really liked the E:WOM approach to this yet?

If I could 'detect' when a monument upgrade is in the build cue, then I could do the 'instantly complete' thing similar to the spell that does this for units.  I already have a 'speed production' spell that adds production points to anything in the cue, which uses mana, which I could adapt.  This does bring up a similar idea, which is whether a gamemodifier on a monument could increase city production in some way, rather than globally.  Say, +1 Materials for parent city, or +1 to production per materials or some such.  I also like the 'mini city' idea, but others have went down that path and kinda gave up on it.  Once you build the city, well you have all the city advantages and headaches, so you might as well take it above level 1...

Which brings up the question, why bother to do this anyways?  I'll be pondering the advantages and disadvantages to such a system for the next little bit.  Right now, unless I can find more reasons to introduce the resource, having a 'single purpose' resource is kinda silly...

The main advantage (for me) is that this allows more opportunities to focus on unit production, rather than waiting on upgrades.  Essentially,  the 'walk and chew gum at the same time' comment I've made before.  My goal here is minor tweaks to speed up pacing a bit so the game isn't dragging as much, and give the player more tools/options to keep them interested.  Note the Immersion mod that does exactly this r.e. pacing.  I'm trying to take baby steps in that direction, for those who more or less are fairly happy with the current pacing.

Thoughts?  Suggestions? Comments from the Peanut Gallery?!?

:grin: