A few specific Modding Questions for Stardock

 UPDATE: With core system mechanics currently in the "overhaul" phase, I completely understand any reservation from SD to spend a lot of time preparing detailed responses to my questions. I've updated this post to include shorter, more directed questions under the original questions. I'd honestly be happy if someone even just answered one of them. If you're reading this and know the answer to even a single item/subitem, would you mind typing a quick reply with the question/answer? Thanks!

Hey guys - I know you're busy on the patch, but I was hoping that you could find the time to provide the answers to a few questions. For the most part, I try to figure this stuff out myself by scouring through the core XML files, but when it comes to parameter names that aren't currently used, we're just stabbing in the dark. I'd even appreciate a partial response if some of the items are "under development."

Ideally, I'd love to see a full schema for the XML elements - but I realize that you probably don't want to provide that while you're still in full scale patch mode. My questions are just the "highlight reel" of what I'm most limited by right now in my own modding efforts.

1. <Calculate />
* I have a tutorial on what we know about this HERE.
    - What are the valid values for "ValueOwner"?
    - What properties are available for each "ValueOwner" - could you essentially provide a list of the public properties for different ValueOwner classes (or tell us where we can look to figure it out)
    - Are there other "Calculate" type elements like If, Max, Min, IsEqual, Pow, or the like?
    - Is there any type of conditional branching support?
    - How can I use the player's current (Gildar/Metal/Wargs/other resource) with Calculate?
ANSWER (by Frogboy): In v1.1 spells are going to support using global resources and mana will become a global resource. He further clarified that this would include player-defined global resources as well.

    - How can I use a custom global resource with Calculate?
    - (Heavenfall) Is it possible to allow us to create more than one prop per spell in tactical battles from CreateWorldProp?

2. <GameModifier />
   - What are the correct combinations for ModType x Attribute x (StrVal, Value, Duration, TerrainType, etc)?
   - Is there a way to apply effects to units that start/end their turn in or move into a map location?

3. Is there a way to "attatch" a visual effect to a Unit and not to a tile when casting a spell?
  - Can you make this effect only last until the spell duration is over?
  - Can you make it until an indefinite spell is cancelled?

4. <SpellDef />
* I have a tutorial with comments on creating a spell HERE.
   - What are the properties that can be set?
   - Is there a way to apply a (not linked to their hands) spell effect to the spell caster when the spell hits the target?
   - Can we make a spell cost the caster hit points or other stats besides Essence?
   - Can we make a spell cost Gildar or other global resources?

5. Is it possible to give the user the option of multiple improvement types on a single resource tile? (Like build either Building X or Building Y on selected Old Growth Forest tile?)
ANSWERED (by Frogboy): Yes. Take a look at CoreWorldResources.xml and you will see that they define a type in there. Then look for say Imperial Farm in the EmpireUnlimitedImprovements.xml.  In it, it looks for <SupportedResourceType>. You can have multiple improvements that make use of that resource.

6. (Heavenfall) Is it possible to let the game search through sub-folders in the mod folders when searching for xml files? Or is there any other way to put our mods in folders (beyond the basic ones) to prevent our files all ending up in the same place?
    For example, sinusgamma's new city tileset and raceconfig for a nordic kingdom has over 100 files in it. On its own, this is not a huge problem. But if I want to add 10 more races, and then delete one race, it gets very difficult.


Thanks in advance,
Gnilbert

23,393 views 46 replies
Reply #1 Top

I'll add the only question I can think of right now;

Is it possible to allow us to create more than one prop in tactical battles per spell from CreateWorldProp? I think a lot of cool things could be done then, like ice melting, prisons cracking, fires slowly going out.

Reply #2 Top

I'd like to know the answers to these questions too.  

Reply #3 Top

I would as well.  Specifically, I'm looking for hidden values for this node:
<AIRelationsWeight InternalName="X">

From the file:  CoreAIDefs.xml

I'm hoping for something to create additional diplomatic modifiers (e.g., "MuchStrongerMagicThanYou").

Thanks!

Reply #4 Top

I'd like to know if calculated variables can be interchanged with integers anywhere. For example, when creating a creature during a quest for the player to fight, there's a specified field for the creature's level:

     <UnitInstance>
      <UnitType>Darkling</UnitType>
      <Level>1</Level>
     </UnitInstance>

Is it possible to calculate a dynamic level based on something else in game? For example, Champion level + 2, or Champion INT + 2?

This would allow for actual quest scaling to the level of the Sovereign/Champion doing it, regardless of the player's quest level.

Reply #5 Top

I put the tutorial links for what we already know, and I'm bumping this in hopes it catches the eye of anyone who might be able to give us some more details.

Gnilbert

Reply #6 Top

I've updated the original post with more specific questions and a note that says "We understand you're busy, so feel free to answer only one of the questions in yellow."

Gnilbert

Reply #7 Top

I have a question/request I would like to add.

"Is it possible to let the game search through sub-folders in the mod folders when searching for xml files? Or is there any other way to put our mods in folders (beyond the basic ones) to prevent our files all ending up in the same place?

For example, sinusgamma's new city tileset and raceconfig for a nordic kingdom has over 100 files in it. On its own, this is not a huge problem. But if I want to add 10 more races, and then delete one race, it gets very difficult.

Reply #8 Top

Updated. :grin:

Reply #9 Top

Quoting Heavenfall, reply 7
I have a question/request I would like to add.

"Is it possible to let the game search through sub-folders in the mod folders when searching for xml files? Or is there any other way to put our mods in folders (beyond the basic ones) to prevent our files all ending up in the same place?

For example, sinusgamma's new city tileset and raceconfig for a nordic kingdom has over 100 files in it. On its own, this is not a huge problem. But if I want to add 10 more races, and then delete one race, it gets very difficult.
End of Heavenfall's quote

It could be similar to WoW's addons.  Each addon was it's own folder(s) so it was easy to manage addons.  The authors would just zip up the folder and distribute it.  When you wanted to remove an addon, you just removed the folder.

Take it another step and maybe there could be an interface which lists all the folders and the user could select which folder they want active for the game.  Probably more work, but it would be helpful to be able to enable/disable mods.  WoW's addon system also required a file that identified the addon - I forget what it was called.  So the game didn't necessarily have to parse through the entire contents, just parse through all the folders looking for that "config" file.

Reply #10 Top

Note that FirstStrike  is broken currently, as well as Cooldown.

 

Also, a SpawnMonster cheat would be really helpful...


Is anyone else getting somewhat bizarre return values for simple AdjustUnitStat changes?

 

<SpellDef InternalName="Disrupt">
        <DisplayName>Disrupt</DisplayName>
        <Description>Damages the target and weakens them.</Description>
        <Image>WaterCrystal_Medallion.png</Image>
        <IconFG>Crushing_Blow.png</IconFG>
        <IconColor>32,45,243</IconColor>
        <Range>1</Range>
        <SoundFX>Hit_Hammer1</SoundFX>
        <ManaCost>0</ManaCost>
        <cooldown>-1</cooldown>
        <SpellLevel>1</SpellLevel>
        <SpellType>Tactical</SpellType>
        <SpellClass>Offensive</SpellClass>
        <SpellTargetType>EnemyUnit</SpellTargetType>
        <IsSpecialAbility>1</IsSpecialAbility>
        <GameModifier>
            <ModType>Unit</ModType>
            <Attribute>AdjustUnitStat</Attribute>
            <StrVal>UnitStat_Defense</StrVal>
            <Value>-5</Value>
            <Duration>3</Duration>
        </GameModifier>
        <GameModifier>
            <ModType>Unit</ModType>
            <Attribute>AdjustUnitStat</Attribute>
            <StrVal>UnitStat_Attack</StrVal>
            <Value>-5</Value>
            <Duration>2</Duration>
        </GameModifier>
        <GameModifier>
          <ModType>Unit</ModType>
          <Attribute>DefendableDamage</Attribute>
          <Calculate InternalName="AttackerAttack" ValueOwner="CastingUnit">
            <Expression><![CDATA[[UnitStat_Attack]]]></Expression>
          </Calculate>
          <Calculate InternalName="Value">
            <Expression><![CDATA[[AttackerAttack]]]></Expression>
          </Calculate>
        </GameModifier>
    </SpellDef>

 

You'd THINK that this simple code would take two stat values, subtract five from them, and then deal normal damage  In reality, it returns a whole slew of bizarre values and does normal damage.  There's also a lot of ambiguity about the difference between AdjustUnitStat, IncreaseDecreaseUnitStat, and SetUnitStat.  They don't work in the way that most would find intuitive.

Reply #11 Top

I would KILL for some documentation, or at least a data dump of all the tags.  Can't be that hard to do, and for a game that is supposed to be modding friendly, its a crime that it is so poorly documented.

 

Also, Gnilbert, or a mod, can you move this thread to Support?  It'd probably get more attention/stay near the top there longer.

Reply #12 Top

One other thing, try throwing a <PerTurn>1</PerTurn> in there just below value. You are further clarifying the action that is being taken. I am not sure how that would work with <Duration> but maybe it will.

After looking over the code more I think you may be targeting the enemyunit and then adjusting thier stats, instead of what your trying to do. What about geting the same values in expressions using calculate instead and then adding them to get a value for the spell damage.

 

P.s. this is totally highjacking this thread. lol sorry. Hairrorist You can PM me if you are not catching what I am trying to say. I can explain it in further detail then.

 Edit: After much testing it looks as if the <Operator> command does nothing. The two instances I had actual got it work produced the results that should have happened anyway, but for some reason were not. You think you learn something, only to learn you really didnt learn anything, excpet you found something that dosent work...some will be good days, some will not.:annoyed:

Reply #13 Top

Quoting Heavenfall, reply 7
I have a question/request I would like to add.

"Is it possible to let the game search through sub-folders in the mod folders when searching for xml files? Or is there any other way to put our mods in folders (beyond the basic ones) to prevent our files all ending up in the same place?

For example, sinusgamma's new city tileset and raceconfig for a nordic kingdom has over 100 files in it. On its own, this is not a huge problem. But if I want to add 10 more races, and then delete one race, it gets very difficult.
End of Heavenfall's quote

I was thinkging about this. I know I made some custom(ok badly made hack and paste) images and had put them into the Documents/Mygames/Elemental/Units/Icons folder and they worked for my buildings. I never defined where they were, just used the default name of the file and the game finds it. I am wondering if you couldnt just name your own folders and the code would just automaticaly search through anything in the Elemental/Units folder. I think this is how it works with the graphics in the GFX files. If you follow where the code is pointed for the graphic assets it isnt always the full path. Yet the code still finds what its looking for. Perhaps the same thing could apply here.

One a side note I dont know how that works with the /mod folder.

Just something to think about.

Reply #14 Top

I know how it SHOULD work, that's not what I'm asking. I'm asking if we can have it the way it should work, instead of what we have now.

I'm not asking for much. Just search the subfolders.

Reply #15 Top

That's another cardinal sin in a game billed as mod-friendly.

Reply #16 Top

Quoting hairrorist, reply 15
That's another cardinal sin in a game billed as mod-friendly.
End of hairrorist's quote

There are so many sins about the promises made upon the release of this game that I think this one is just a footnote.

We wouldn't be so desperate to mod the game if it weren't so bad overall.

Reply #18 Top

Another question!

Some ResourceTypes have tags like EnvironmentType, EnvironmentSpreadIntensity and EnvironmentSpreadRadius which I think should alter the terrain around the resource. Can you explain how we should properly use these tags to see the effect in game?

Reply #19 Top

5. Is it possible to give the user the option of multiple improvement types on a single resource tile? (Like build either Building X or Building Y on selected Old Growth Forest tile?)

Yes.

Take a look at CoreWorldResources.xml and you will see that they define a type in there.

Then look for say Imperial Farm in the EmpireUnlimitedImprovements.xml.  In it, it looks for <SupportedResourceType>. You can have multiple improvements that make use of that resource.

Reply #20 Top

Q: Is there a way to apply effects to units that start/end their turn in or move into a map location?

I don't know what you mean by effects. Visual effects or like buffs?

 

Reply #21 Top

Would anyone object if I made this thread a sticky? I.e. would you guys be willing to maintain this so I can direct developers to answer any questions I don't know off the top of my head?

Reply #22 Top

Regarding spells:

In v1.1 spells are going to support using global resources and mana will become a global resource.

Reply #23 Top

Quoting Frogboy, reply 20
Q: Is there a way to apply effects to units that start/end their turn in or move into a map location?

I don't know what you mean by effects. Visual effects or like buffs?

 
End of Frogboy's quote


WOOT! Thank you in advance!

Both actually:  "Wall of fire" spell. When a unit moves into or ends its turn in the affected map location, it takes damage and a "hit by fire" particle effect plays (in addition to the particle effect already in play at the location).

Gnilbert

Reply #24 Top

Quoting Frogboy, reply 21
Would anyone object if I made this thread a sticky? I.e. would you guys be willing to maintain this so I can direct developers to answer any questions I don't know off the top of my head?
End of Frogboy's quote


Stickiness would be wonderful. I'll happily pop all the answers up into the original post.

Gnilbert

Reply #25 Top

Quoting Frogboy, reply 22
Regarding spells:

In v1.1 spells are going to support using global resources and mana will become a global resource.
End of Frogboy's quote

wait you mean that its possible to need spell components?  for example, to cast arcane armor it may need say 3 iron?  because that would be badass and unique.  a great way to curb very high level spells!