Modding Spells - City Enchantments without Essence

I'm trying to come up with a way to create a new city enchantment that impacts tile yields/etc on a city without it taking up an Essence slot. I could make it give an extra Essence slot, sure, but I don't want to do it that way, as it would make it impossible to cast upon cities without Essence, which is undesirable.

 

Anyone have any ideas as to how to go about this? Thanks.

 

EDIT: Also, is there a way for a spell to create a World Resource like a Crystal Crag, Wild Horses, etc?

82,460 views 20 replies
Reply #1 Top

No idea, tried to do similar stuff but couldn't get it to work. I put the stuff in improvements instead, as those can be built in any city.

To create a world resource:

    <GameModifier InternalName="Resource">
        <ModType>Map</ModType>
        <Attribute>CreateResourceHoard</Attribute>
        <Value>1</Value>
        <StrVal>internalnameofworldresourcegoeshere</StrVal>
      </GameModifier>

Reply #2 Top

Yeah, just figured that out; wasn't expecting it to be CreateResourceHoard rather than CreateWorldResource. Also, didn't realize you needed 'Value' there.

 

Ah well. Kinda sucks you can't have the spell do it, but I can probably do what I want via resources instead.

Reply #3 Top

Just an idea, and tell me if it works:

Using CityCurse as a sub category instead of enchantment. Or, in general, write it as an offensive spell that targets your own city.

 

Reply #4 Top


testing a spell, will give an update.

 

I currently have a working spell, but it uses an essence slot, so i will look at other examples for abilities. Be back in half an hour I have an idea to look at.

 

edit- will give the city curse a shot, it might work.

Reply #5 Top


Ok "city curse" affect where the spell is organized in the spell book.

I need to figure out what the mechanism is that makes it use an essence slot. I'm going to try to sidestep that issue by looking at path based abilities.

Reply #6 Top


Does anyone know where the code defining "Friendly City" is ?

 

Reply #7 Top


Ok i managed to make a spell that does not take an essence slot, but it seems to be permanent - i can't turn it off, mind you i made it so it does not stack. I'm about to make a version that has a duration effect.

Reply #8 Top


Palmsface - note to self - run multiple saved copies of work in progress you know better.... erased my non slot taking spell, trying to remake it.

Reply #9 Top

Once you figure that out, please let me know how ya did it!

Reply #10 Top

Ok i got it - dunno why it works, but it is working for me, seems a little counterintuitive - i can only

guess it is skipping some error checking in another function:

you can cast this on a city with no essence - can't end the spell, but you can put a duration on it:

<Duration> 10</Duration> or however long you want it

 

<SpellDef InternalName="Governer's Orders 1">

     <DisplayName>Governer's Order 1</DisplayName>

     <Description>Governor target's a city to give 10% unrest </Description>

     <Image>S_Inspiration_Painting.png</Image>

     <IconFG>S_BlessCity_icon.png </IconFG>

     <IconBG>S_Inspiration_Icon_BG.png</IconBG>

     <IconColor>217,206225</IconColor>

     <AutoUnlock>1 </AutoUnlock>

     <CanStack>0</CanStack>

     <SpellBookSortCategory>City</SpellBookSortCategory>

     <SpellBookSortSubCategory>Other</SpellBookSortSubCategory>

     <SpellType>Strategic</SpellType>

     <SpellClass>ImpResourceBooster</SpellClass>

     <SpellSubClass>Other</SpellSubClass>

     <SpellTargetType>FriendlyCity</SpellTargetType>

     <GameModifier>   

               <ModType>Resource</ModType>

               <Attribute>Unrest</Attribute>

               <Value>-10</Value>

     </GameModifier>

     <HitSoundFX>Spell_BlessCity_01</HitSoundFX>

     <SpellCastEffectName>Brilliance</SpellCastEffectName>

     <SpellcastEffectScale>.2</SpellcastEffectScale>

      <SpellDefEffect>

           <EffectName>S_Inspiration_Particle</EffectName>

           <LocalPosition>0,0,0</LocalPosition>

           <EffectScale>.5 </EffectScale>

           <EffectDelay>.5 </EffectDelay>

           <SnapToTerrain>1</SnapToTerrain>

     </SpellDefEffect>

 </SpellDef> 

+1 Loading…
Reply #11 Top


I'm thinking of a version that summons a building into the target city. The building would give the boost, you can destroy the building to end the spell. I just need to figure out a way to only have 1, 2 or 3 versions of the same spell running at the same time within a faction, or 1 per city.

Reply #12 Top

Well, I figured out what does it - it's the '<PerTurn>' attribute in the GameModifier section. If that isn't included, then the enchantment doesn't require an Essence. Very nice.

+1 Loading…
Reply #13 Top


interesting, yet irritating at the same time since you can't remove the spell.Might be some different values for that stat.

Reply #14 Top

Nice find guys!

Reply #15 Top

You might be able to do some cool stuff with that.  Would you be able to give a city -10% unrest for ten turns then +20% unrest for five turns?  Kind of a rush production thingy that would speed up production without costing gold up front.  Would be a cool trait for Path of the Governor/Slave Master depending on the flavor text...

Reply #16 Top

Interesting idea jugg, i'll play a bit on it tomorrow (sunday) and see what happens. I'm, going to fire up the particle maker on sunday with my daughters laptop (which sadly has a better graphics card than my quad core  mac - yes i can be cheap - who knew it would be such a terrible card lol saving slowing for a better one)  

Reply #17 Top

hey I like this idea...  wanted to do something similar, wasnt sure how to implement it, tried a few ways with yours but no luck so far..

what I want to do is use that method to make a spell (costing 500+ mana havnt decided yet, since its more of an end game thing kinda like them perm stat boosts that take a ton of mana) but this Spell adds 1 Essence slot to the city.

Any idea how to get it to work?

 

EDIT:  nm got it..  TileYieldEssence was what i was looking for.

Reply #18 Top

In case anyone missed it, there's now <RequiresEssenceSlot>0</RequiresEssenceSlot> introduced in 1.02 for spells. Supposedly it allows a spell to bypass the essence requirement when being cast on a city.

Reply #19 Top


I did notice, but i'm looking at some other game issues at the moment - will come back to this. I think the most important addition of this tag is that it gives you a mechanism to end the spell easily, just like an essence using enchantment. It deals with the duration requirement i pointed out to end a spell automatically.

Props to stardock. :beer:

Reply #20 Top

worked for what i wanted.  got a nice high end spell that costs a ton of mana but adds an Essence slot to the town ;-p