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,924,166 views 844 replies
Reply #426 Top

New question: Is it possible to mod gender differences?

For example: all male trainable units, champions and sovereigns may have +1 Attack and 3 hit points, all female trainable units, champions and sovereigns may have +1 Dodge and +3 Spell resistance. As for now I didn't find any possibilities. Is this possible or not?

Reply #427 Top

Quoting webusver, reply 426

New question: Is it possible to mod gender differences?

For example: all male trainable units, champions and sovereigns may have +1 Attack and 3 hit points, all female trainable units, champions and sovereigns may have +1 Dodge and +3 Spell resistance. As for now I didn't find any possibilities. Is this possible or not?
End of webusver's quote

The units and sovereigns have "generic template" definitions, one for male and one for female.  I believe you could just change the base definitions for the male and female "generics" (you'd need to do it separately for regular units and sovs.)

An example of the generic template units (in CoreUnits.xml) are:

<UnitType InternalName="Generic_Altarian_Female"> --> Generic female Altar unit

<UnitType InternalName="Generic_Sovereign_Altarian_Male"> --> Generic male Altar sovereign unit

What I'm not sure about (haven't tried) is whether if you take an existing unit and modify the gender in the unit designer, whether it will switch to the other template (and corresponding gender specific abilities) or whether it will just change the gender attribute.

 

Reply #428 Top

You could maybe mod it into the Blood abilities, try seeing if you can use <Gender>Male</Gender> etc. as a prereq in a gamemodifier. Then you could make two different gamemodifiers with prereqs for male/female in all the blood abilities, and it would work like you want. 

Edit: Don't think that will work inside the gamemodifier. Try making 2 spells instead that autocast at battle with different gender prereqs if you can make it work using the noble legacy code. 

<Attribute>BattleAutoCastSpell</Attribute>
<StrVal>NobleLegacy</StrVal>

(keep in mind this is just brainstorming, I have no idea if this will actually work)

Reply #429 Top

Crastiloowa, sjaminei, Thank you. I could not find a way to modify unit types of males or females but I found tha way to make abilities dependant on gender. So "blank" males and females are equal but while choosing traits they become different. Each ability has something like <unitsupportedtype>MancerFemale</unitsupportedtype> (something like this). It becomes interesting that in particular situations males are better, for some - females.

Reply #430 Top

Being lazy here because I haven't looked into it, but does anyone happen to know if it's possible to have modifiers apply depending on terrain, for example +3 attack when the battle is in a forest tile?  +5 Initiative in hills, +3 defense when attacking/defending a city... that sort of thing?

Thanks.

Reply #431 Top

There is a hold over tag from Elemental, I can't remember the tag sorry, that boosts a defined stat for defending a city.  In EWoM it was a hp boost depending on city level.

Reply #433 Top

I don't think that is the code I was talking about, it literally has city in the tag line.  I had to send in my computer for RMA and am in the process of reinstalling games.  I saved my core files but games that could be redownloaded were sacrificed.  Otherwise I would have just looked it up.  I should have the time today while at school to abuse the blazing download speeds here.

Reply #434 Top

City stuff would be better than nothing but was really hoping to find something that works in hills, forest etc.  I've just been searching the files now but can't find anything that seems like it only works in certain terrain :-(

Reply #435 Top

Spells do. No idea how to translate strategic spells into passive tactical ones though.

Reply #436 Top

The ideal thing would be if there was a way to set a unitstat when units are on a specific terrain... so if they are in a forest they have Unitstat_BG_InForest = 1.  That would be awesome, but not achievable me thinks.

Reply #437 Top

There is a way to accomplish this, but you are not going to like the solution.

There is a way to attach a game modifier to each tile from the map editor. Thus, you can load every tactical map and do exactly what you want by adding your own modifiers to these specific tiles. (Not sure of a way to automate the process without actually writing a simple program to do it for you)

Reply #438 Top

Quoting parrottmath, reply 437
There is a way to accomplish this, but you are not going to like the solution.
End of parrottmath's quote

Well that made me smile if nothing else.. :grin:

 

So... i'm still (somewhat) interested though.  I've never looked at maps at all.  Haven't even tried the map editor.

So you're saying it's possible to add a game modifier that would set a unitstat when a unit is standing on a tile in tactical combat?

Are there any files you can point me at that do this as an example?

 

 

Edit -> Actually while we're on the subject, do you know how the game chooses which tactical map to use for a battle...?   

 

 

Thanks.

 

 

Reply #439 Top

Take a look at the TerrainTypes.xml

<TerrainType InternalName="Land">
    <DisplayName>Plains</DisplayName>
    <MaxHeight>55</MaxHeight>
    <MinHeight>45</MinHeight>
    <MovementCost>8</MovementCost>
    <TerrainMovementNote>1x Movement</TerrainMovementNote>
    <Category>Land</Category>
    <IsTerrainFeature>0</IsTerrainFeature>
    <IsBaseTerrain>1</IsBaseTerrain>
    <PassableByLandUnits>1</PassableByLandUnits>
    <PassableByWaterUnits>0</PassableByWaterUnits>
    <PassableByAirUnits>1</PassableByAirUnits>
    <SuitableForStartingLocation>1</SuitableForStartingLocation>
    <Indestructable>0</Indestructable>
    <MinTilesPerSplat>0</MinTilesPerSplat>
    <MaxTilesPerSplat>0</MaxTilesPerSplat>
    <MinBrushRadius>3</MinBrushRadius>
    <MaxBrushRadius>6</MaxBrushRadius>
    <PlacementOrder>0</PlacementOrder>
    <SupportsSubTerrain>false</SupportsSubTerrain>
    <IsBorderTerrain>0</IsBorderTerrain>
    <CannotBorder>Category:Water</CannotBorder>  
    <MapGenPlaceChance>100</MapGenPlaceChance>
    <GameModifier InternalName="CityTileYield_Fertile">
        <ModType>Resource</ModType>
        <Attribute>TileYieldGrain</Attribute>
        <Value>1.5</Value> 
        <PerTurn>1</PerTurn>
    </GameModifier>
    <TerrainTypeEnvData>
        <Environment>Barren</Environment>
        <Texture>gfx/terrain/barren_ground_rough.dds</Texture>
        <TextureWeight>1.0000</TextureWeight>

        <TerrainPropData>P_Berren_Land_01,10</TerrainPropData>
        <TerrainPropData>P_Berren_Land_02,10</TerrainPropData>
        <TerrainPropData>P_Berren_Land_03,10</TerrainPropData>
        <TerrainPropData>P_Berren_Land_04,10</TerrainPropData>
        <TerrainPropData>P_Berren_Land_05,10</TerrainPropData>
        <TerrainPropData>P_Berren_Land_06,10</TerrainPropData>
        <TerrainPropData>P_Berren_Land_07,10</TerrainPropData>
        <TerrainPropData>P_Berren_Land_08,10</TerrainPropData>
        <TacticalMap>T_Barren_Land_01</TacticalMap>
        <TacticalMap>T_Barren_Land_02</TacticalMap>
        <TacticalMap>T_Barren_Land_03</TacticalMap>
        <TacticalMap>T_Barren_Land_04</TacticalMap>
        <DistanceFogColor>94,89,76</DistanceFogColor>

        <ClothMapColor>205,185,130</ClothMapColor>

    </TerrainTypeEnvData>

I have bolded where the tactical maps are places and in this case it chooses 1 of these four at random when on this environment. Also, notice that this has a game modifier within the actual terrain data. Now I DO NOT KNOW if you can apply a terrain game modifier like bonus to init directly in this terrain data (mind you it is a core file change as I do not think terraintypes get overwritten (not sure about this either)).

The map editor has a subsection which allows you to place game modifiers on the map itself, or event triggers. I haven't experimented at the moment with these triggers or game modifiers on Tactical maps, but I suspect it should work. Have fun creating.

Reply #440 Top

Ok, I found what I was talking about and it is apparently not what I thought it was.  

Code: xml
  1. -&lt;GameModifier&gt;
  2. &lt;ModType&gt;City&lt;/ModType&gt;
  3. &lt;Attribute&gt;AdjustDefendingUnit&lt;/Attribute&gt;
  4. &lt;Value&gt;5&lt;/Value&gt;
  5. &lt;Operator&gt;+&lt;/Operator&gt;
  6. &lt;StrVal&gt;UnitStat_HitPoints&lt;/StrVal&gt;
  7. &lt;PerTurn&gt;1&lt;/PerTurn&gt;
  8. &lt;/GameModifier&gt;

This is listed within the cityhubs within elemental such that when you are defending a city you get a bonus to hit points.  So I imagine you can modify any stat you want for city defense using this base code as long as you attach it to whichever cityhub you want to.  Parrotmath already did his magic with everything else, hope this helps.

Reply #441 Top

Thanks parrottmath will check it out.

Reply #443 Top

Not sure if that is possible. Although you can force a spell not to cast unless you have a building. Just don't think you can target a specific city only when a specific building is inside though.

Unless you want to go about the you can cast it but it's useless method. Give the city a resource / trait that is 1 when it has it 0 otherwise and set up the benefit or consequence and multiply it by this trait value, if it is a value type trait. Otherwise I cannot think of it at the moment. 

Reply #447 Top

You can use that Calculation in the AI data, but not sure if you can use the city population tag. I think it is possible.

Reply #449 Top

OwnerCity is the Owner of the city (your city would be you) and TargetCity is the city itself.

The spell casting is a Yes / No not a less likely from my experience. If it is not working then there is an issue with the variables.