cohka cohka

Modding questions/help thread

Modding questions/help thread

Figured we needed a thread for questions that didn't need to take up valuable room from talented mod'rs.

1,921,770 views 844 replies
Reply #226 Top

Quoting BernieTime, reply 224

New Question;

I was trying to set some abilities that could not function if a Shield was equipped, based on code from Arching Shield Bash;

         <Prereq>
            <Type>UnitStat</Type>
            <Attribute>UnitStat_IsShield</Attribute>
            <Value>0</Value>
        </Prereq>

In theory that should work after setting the Value to 0 (meaning No), however in practice, does not appear to work as expected.

Am I correct in assuming that setting the tag to 0 really doesn't do anything, even though you'd think it would?

Yes, it is a "this or larger" prereq.

Quoting StevenAus, reply 225

What is the difference between a hero that can only be obtained from a Quest or Event and a hero that can show up at Fame milestones?  ie. what prevents a Quest Hero from appearing at Fame milestones?

It needs these

 
        <IsChampion>1</IsChampion>
        <SpawnRating>1</SpawnRating>
        <NPCSpawnLikelihood>100</NPCSpawnLikelihood>

where spawnrating is 1, 3, 5, 7 or 9. Higher likelihood = more common.

 

Reply #227 Top

Thanks Heavenfall.  So without a Spawn Rating and a positive NPCSpawnLikelihood, it won't show up at Fame milestones.

Reply #228 Top

Removing the allegiance tag (kingdom/empire) will prevent the champion from appearing at the fame milestone.

Reply #229 Top

I forgot one, you also need <Allegiance>Empire</Allegiance> or <Allegiance>Kingdom</Allegiance>

edit: Hellions beat me to it.

Reply #230 Top

Thanks HF.

It's a shame that Abilities can't be flagged with a "no shield" tag.  I'm guessing there's probably no easy way (if at all) to set a faction to only use certain weapons in their Tech?  Would have liked to make a Faction that only uses 2-Handed Weapons.

Reply #231 Top

No easy way, no. You could require a unitstat for all 1handers, then set it to default 1, then set it to 0 for your faction. Then they wouldn't be able to use 1handers.

Reply #232 Top

Question:

I have created a new hero that is meant to be specific to the sovereign I also created (as a pair).  I managed to create a summoning spell to bring the hero into the world.  However, when my kingdom reaches the the appropriate fame level, that same hero can spawn again.  (It is tagged unique=1).

 

What can I do to prevent it from spawning through the champ system... and thus only through that spell that can only be cast once?  Is there anything I can do to the Spawnrating or NPCSpawnLikelihood?

Reply #233 Top

Quoting Dumhed, reply 232
What can I do to prevent it from spawning through the champ system... and thus only through that spell that can only be cast once? Is there anything I can do to the Spawnrating or NPCSpawnLikelihood?

Look at heavenfall's answer

Not having the tag <NPCSpawnLikelihood> or setting <NPCSpawnLikelihood>0</NPCSpawnLikelihood> will give you the desired results.

Reply #234 Top

How do you trigger a specific quest with a specific custom item?  For QuestMap it has:

<GameModifier>
<ModType>Map</ModType>
<Attribute>CreateQuestNearTile</Attribute>
<BoolVal1>1</BoolVal1>
<Value>-1</Value>

<Provides>Spawns a new quest</Provides>
</GameModifier>

Do you simply replace the -1 in "<Value>-1</Value>" with the InternalName of the quest (as well as changing the internal name of the QuestMap item)?

Reply #235 Top

21:34 <seanw3>         <GameModifier>
21:34 <seanw3>             <ModType>Map</ModType>
21:34 <seanw3>             <Attribute>CreateQuestNearTile</Attribute>
21:34 <seanw3>             <BoolVal1>1</BoolVal1>
21:34 <seanw3>             <Unitclass>Quest_TotS_001_Welcome</Unitclass>
21:34 <seanw3>             <Value>3</Value>
21:34 <seanw3>             <Provides>Spawns a new quest</Provides>
21:34 <seanw3>         </GameModifier>

UnitClass being the internalname of the quest

Reply #236 Top

Thanks for that.  This was Seanw3's post, Reply #5 in this thread: https://forums.elementalgame.com/430537

Quoting seanw3, reply 5

There is a specific gamemodifier for spawning a quest on the map. The modifier needs to look like this:

 

<GameModifier>

<ModType>Map</ModType>

<Attribute>CreateQuestNearTile</Attribute>

<Unitclass>YourQuestInternalName</Unitclass>

<BoolVal1>1</BoolVal1>

<Value>1</Value>

<Provides>Spawns a new quest</Provides>

</GameModifier>

Just put the internal name of the quest you want in where I wrote "YourQuestInternalName."

 

c)The tag for chance of encounter is currently not functioning. Encouters will always happen. Loot should be fine as long as the total likelihood of loots equals 100. So for example, if you want a 50% chance that the player gets nothing, you need to have a reward with no loot that has a 50% chance to occur.

 

Note: it looks like the value of the <Value> tag doesn't matter.

Reply #237 Top

So im trying to get a random huge world without water, or as little water as possible. At the very least in the center of the map, not too worried about the outsides. So few questions:

1) Is there a "no or little water" option somewhere I could toggle?

2) Is there a way of modifying the base stamps to remove water from them, or even more simply, how can you load the stamps for editing in the workshop?

3) Does anyone know the names of some of the stamps that contain a lot of water I could simply delete/remove? 

Reply #238 Top

1) There is no option for this

2) There is no way of editing the stamps into the editor. The best you can do is place a stamp to look at what the stamp has.

3) If you search through them yourself the tile that states 'water' is the tile called submerged. Many of the stamps actually do not have submerged tiles in them, it is how the program stitches them together that provides the water.

4 --  you didn't specify, but you can create maps that have little to no water yourself. Simply load up a random map and then fill in the water spots with some stamps and you will get a lot less water. Load the map and play, it will still be "random".

Reply #239 Top

Quoting parrottmath, reply 238

1) There is no option for this

2) There is no way of editing the stamps into the editor. The best you can do is place a stamp to look at what the stamp has.

3) If you search through them yourself the tile that states 'water' is the tile called submerged. Many of the stamps actually do not have submerged tiles in them, it is how the program stitches them together that provides the water.

4 --  you didn't specify, but you can create maps that have little to no water yourself. Simply load up a random map and then fill in the water spots with some stamps and you will get a lot less water. Load the map and play, it will still be "random".

 

Thanks ill try that. I also tried putting a modified CoreMaps.xml in my mods folder to set the WaterPercentage values to 0 for all map sizes. Also modified the original file. That however seems to do nothing in terms of reducing the amount of water on the map

Reply #240 Top

What ive ended up doing is in the cartographer I loaded each stamp one by one and made note of which ones contain lots of water. I then deleted those stamps from the game folder, so now when I generate maps there is very little water to begin with and I can either leave it as is or fill in the remaining water.

Reply #241 Top

If you take a look at this mod (which is an old one for FE not LH):

https://forums.elementalgame.com/436540/page/1/#3293827

I believe it mucks around with water percentages for random maps.  This definitely used to work in FE because I used to have water percentages reduce on my random maps.

I'd be surprised if it's not possible to reduce the percentage in LH the same way.

Reply #242 Top

OK just did some quick tests... the water percentage thing works, but maybe just not 100% as to what you're hoping for.  If you try a large/huge map.... and test the difference between...

this

<WaterPercentageMin>5</WaterPercentageMin>
<WaterPercentageMax>5</WaterPercentageMax>

and this

<WaterPercentageMin>45</WaterPercentageMin>
<WaterPercentageMax>45</WaterPercentageMax>

You'll definitely see a major difference in the amount of water.

 

Note that even if you set the water percentage to zero.... I think you'll still get a bit of water, presumably because there's some on the tiles or something.... but it will cut it down to a fairly small amount.  That may or may not be good enough for you depending on what you're after.

 

Reply #243 Top

Yeah did some tests myself making a new mapscript, it seems to be some hardcoded minimum water percentage we can't easily tweak. Here is an easy to mod file if you want to experiment some more with the numbers: (I tried setting the fixed amount of stamps high, 0.1 percentages etc., didn't work)

https://dl.dropboxusercontent.com/u/95181126/Nowatermap.xml

(just right click save and put in mods directory, it shouldn't mess with other stuff at all)

 

 

@abob I updated that mod, and made several new settings as well as cleaning out a lot of "junk" that messed with the core game. This mod should work with both LH and FE now. The huge and irregular map type is an almost exact copy of that old mods settings. 

https://forums.elementalgame.com/446059/page/1

 

Reply #244 Top

I have a little question somewhat related to the water issue. I am trying to get a particular stamp to appear always for the sake of one game. I am trying to make a kind of "random campaign" with the Angels and a few human kingdoms vs. Insane Undead, and I wanted the angels to start in the Ilu'Tsavar or whatever its name is. 

So, my problem is.... The god-dammed tile never appears! So the question is: is there a way to make a tile appear in every randomly-generated map?

 

For the moment, I have tried going to Core Stamps and changing the value of the tile I'm interested in to:

<StampType InternalName="S_Iri_Talavar_01">
<DisplayName>S_Iri_Talavar_01</DisplayName>
<Frequency>100</Frequency>

 

But it does not seem to help much. Should I use even higher numbers? Should I stop trying that particular line of code because it is not going to work ever? Should I just make a map myself in the cartographer's table?

 

Many thanks!

Reply #245 Top

Afaik the frequency for map stamps are set values, you can't just input any number. I'd go for the cartographer if I were you. Keep in mind you can place stamps in the cartographer with the stamp tool.

Reply #246 Top

Well, that solves everything! Did not knew I could stamp things in cartographer... Must admit I don't use it much (found it a bit unintuitive...particularly when trying to paint rivers). :P Thank you, Heavenfall. 

Reply #247 Top

I'm having some issues implementing my new spells, first the spells does not show up in techs when I have added the "Prereq tech" thingie (they work well, they just don't show up :( ) I could make items to look like spells I guess? Or is it something stupid I forgot? ;)

Destiny's Insight flat out refuses to be copied and tampered with, I've tried several new internal names, and it doesn't show up for some reason. Any ideas why? 

Lastly I can't get this spell to kill the champion as it is supposed to. Everything else works.... -_- It's almost exactly copied from Steal Spirit. 

<SpellDef InternalName="Steal Essence">
<DisplayName>Steal Essence</DisplayName>
<Description>Steal essence from an allied champion to strengthen your soul. Target is killed, however and the sovereign gains 2 levels.</Description>
<Image>S_StealSpirit_Painting.png</Image>
<IconFG>S_StealSpirit_Icon.png</IconFG>
<AutoUnlock>1</AutoUnlock>
<SpellBookSortCategory>Unit</SpellBookSortCategory>
<SpellBookSortSubCategory>Other</SpellBookSortSubCategory>
<SpellType>Strategic</SpellType>
<SpellClass>Defensive</SpellClass>
<SpellSubClass>Other</SpellSubClass>
<SpellTargetType>FriendlyChampion</SpellTargetType>
<CasterMustBeSov>1</CasterMustBeSov>
<SpellResourceCost>
<Resource>Mana</Resource>
<Amount>200</Amount>
</SpellResourceCost>
<GameModifier>
<ModType>Unit</ModType>
<Attribute>PermanentDeath</Attribute>
</GameModifier>
<GameModifier>
<ModType>Unit</ModType>
<Attribute>TargetUnitLevelUp</Attribute>
<ApplyToCaster>1</ApplyToCaster>
</GameModifier>
<GameModifier>
<ModType>Unit</ModType>
<Attribute>TargetUnitLevelUp</Attribute>
<ApplyToCaster>1</ApplyToCaster>
</GameModifier>
<AIData AIPersonality="AI_General">
<AIPriority>0</AIPriority>
</AIData>
<Prereq>
<Type>Tech</Type>
<Attribute>Third_Book_Of_The_Magi</Attribute>
</Prereq>
<HitSoundFX>Spell_StealSpirit_01</HitSoundFX>
<SpellDefEffect>
<EffectName>S_StealSpirit_Particle</EffectName>
<LocalPosition>0,0,0</LocalPosition>
<EffectScale>1</EffectScale>
<SnapToTerrain>1</SnapToTerrain>
</SpellDefEffect>
</SpellDef>

Reply #248 Top

To have spells show up in the tech tree you need to alter the tech itself.

Secondly, Destiny's insight can be copied over and changed just fine for me, there is always things that you must do to ensure a spell will automatically show up. For example, AutoUnlock is an important part of this

Thirdly, Your spell only tells the target champion may have permanent death for the turn. You do need to actually perform the killing move. Might I suggest

<GameModifier>
    <ModType>Unit</ModType>
    <Attribute>CurHealth</Attribute>
    <Calculate InternalName="Calc" ValueOwner="TargetUnit">
         <Expression><![CDATA[[Unit_GetHPCurrent] * -1]]></Expression>
    </Calculate>
    <Calculate InternalName="Value">
         <Expression><![CDATA[[Calc]]]></Expression>
    </Calculate>
</GameModifier>

   

Reply #249 Top

That did the trick on both ends, thanks. I guess Steal Spirit has the kill move in the ability then? No wonder it didn't work for me. 

Reply #250 Top

Anyone got a suggestion on how to make a building unbuildable but still show up in the tech tree? Conclave/Fortress req did the trick, but polluted the tooltip so it was a no go :(

(trying to make a replacement for spells in the tech tree)

<RequiresResource>1</RequiresResource>  Seems to work as I want but my capital went all Deorcnysse in one game with insane levels and no levelup buildings. Can cheating mess up that?

edit: lol, just found <HideInBuildList>1</HideInBuildList>  X(  ......

Any way to make mana cost show up in the tooltip? I tried <ProductionRequirement> with mana, but it didn't work. Since buildings only cost labor I have no template to copy from :( Somewhat minor, but If I can make this happen we can add spells to the tech tree without messing with the tech files.