Hello, there. I happen to be new to modding xml, basically 0 xml knowledge aside from copying and tweaking existing ones I ran into a bit of a dead end. I was trying to make a custom race ability with these features:
(I was thinking it would be more fun to make uber races with unique abilities instead of the regular ones but with gifted AI)
This is what's under the custom ability xml (in order):
Feature 1 works (Adds 1 defending legion to every planet successfully colonized/invaded)
<Triggers>
<OnEvent>OnConquerPlanet</OnEvent>
<Scope>Global</Scope>
<Target>
<TargetType>Colony</TargetType>
</Target>
<Lifetime>Instant</Lifetime>
<Modifier>
<EffectType>Garrisons</EffectType>
<BonusType>Flat</BonusType>
<Value>1</Value>
</Modifier>
</Triggers>
<OnEvent>OnColonizePlanet</OnEvent>
Feature 2 doesn't work (Adds 1 defending legion to home planet at the start of the game)
<OnEvent>OnStartTurn</OnEvent>
<CriteriaTurnNum>1</CriteriaTurnNum>
Feature 3 acts weird (Boosts resistance by 500%, in other words, making their resistance 6x stronger):
<Mod>
<EffectType>ResistanceBonus</EffectType>
<Value>5.0</Value>
</Mod>
Feature 4 works (Boosts soldiering by 25%)
<EffectType>Soldiering</EffectType>
<TargetType>Faction</TargetType>
<Value>0.25</Value>
Feature 5 doesn't work (Every colony passively generates 0.02 legion per turn). In this case, I have yet to find an existing xml that does this for me to copy and tweak, so it made me think that it might need an actual work from scratch maybe? I have tried looking into Unrelenting ability xml (it gives +1 influence per colony per turn) to no results because apparently its xml is not as broken down as most of the other abilities. Nevertheless, I came up with something (that I was definitely sure wouldn't work, but purely just for the sake of doing something about it)
<PerformAction>
<Action>AwardSpecificResource</Action>
<ValueParam>1</ValueParam>
<StringParam>LegionsAvailable</StringParam>
</PerformAction>
Is there a way to make each feature works well, in this case?Thank you, in advance.
i am looking into and reading this. it will take me a bit. you were very through and that will help tremdously. only thing i did not see that could help is usually when you try to load a mod it spits out an error message with a whole bunch of details. if it is the only mod your loading that limits errors to only one file issue and helps us start going case by case faster.
feature 2:
possible issue: Garrission turns up no results when i search game abilitiesdef. this means 100% it is either a typo or may not be a proper value here
second potential issue:
you seem to be missing <PerformAction> tag, when i compare it to a random <OnEvent>OnStartTurn</OnEvent> without this, nothing should actually happen most of the time.
<RaceTrait>
<InternalName>KnowledgeableAbility</InternalName>
<DisplayName>KnowledgeableAbility_Name</DisplayName>
<DisplayNameShort>KnowledgeableAbility_ShortName</DisplayNameShort>
<Description>KnowledgeableAbility_Dec</Description>
<IsAbility>1</IsAbility>
<Action>ShowStartingPositions</Action>
</RaceTrait>
feature 3: at glance you might of meant to use multiplier instead of flat. nothing stands out as wrong. and when compared to a similar ability it has all the same stuff. otherwise i don't know about hardcaps or technical limits.
feature 5: as you describe i don't think it is doable. I have some ideas about using whole numbers, or making timed events. it all boils down to basically either looking at the general citizen ability and starting from that, or trying to find an existing event that spawns a legion and getting it to repeat on a timer. it might let you generate partial amounts of legions if it treats it the same as any other resource in that regard, so I could be wrong about it being doable. i have no idea how that resource works, beyond generals work and i think i remember some events giving out legions.
Early on, the game had given me those error reports, mostly from typos and nonexistent values. So then I made corrections to the xml, prior to posting it here. After that the game no longer detected any error in the final xml, though, sadly, the issues still persist.
I was confused as well about the Garrison thing. But then I read somewhere that it was a new mechanic introduced in Crusade, and then overriden in Retribution, and it turned out there is Garrison value in ImprovementDefs.xml not in the base game, but the one in DLC > EXP4_Retribution > Game directory. After that, I sort of copy-tweaked the things from that xml. Some ended up working, but unfortunately some other still don't.
This might be the case, although the feature where the game gave me 1 defending legion to colonized/invaded planets happened to work without the <PerformAction>. In that case, what element do you think might be suitable for the <Action> after the <PerformAction> that would connect with the +1 garrison thing?
It seems I might have to find another way to strengthen the planets against invasion, maybe I should try +500% planetary defense instead. The Planetary Defense happens to actually show an additional 500% in the total sum up if I give the +500% to the Planetary Defense instead of the Resistance. Though, I have yet to know how much does Planetary Defense actually contribute to defending against invasions.
The General citizen might help a lot. Do you know in which xml could I find citizens abilities and abilities of their promotions?
Also, how do we make an effect repeat on a timer? I think it would work perfectly for some of the other custom abilities.
Thanks for the inputs
this is good actually. it means no wrong tags and incorrect variables if all the base mod stuff is right. it just helps to know about any that do exist and that there are none.
feature 2: i copied my spelling from what you posted and your reply uses different spelling. *edit* no i didn't replying and trying to quote causes me to have black boxes and white text instead of what i normally get. so i typed it out, and made my own typo. sorry if i caused any confusion.
from what i can see looking at the file you listed, garrison is a term used and related to taking a legion from your resource pool and placing it on a planet, and what your trying to do might not be happening because you didn't have any of the resource your trying to use. if you have the resource it should work, but it isn't something your likely to have early game. searching for legion in Notepad ++ (if your not using this it might help too) pulled up
<Improvement>
<InternalName>MonumentResistance</InternalName>
<DisplayName>MonumentResistance_Name</DisplayName>
<ShortDescription>MonumentResistance_ShortDec</ShortDescription>
<Description>MonumentResistance_Dec</Description>
<Icon>MonumentoftheFinalWar.png</Icon>
<BuildIcon>MonumentoftheFinalWar_Build.png</BuildIcon>
<ListIcon>MonumentoftheFinalWar_Icon.png</ListIcon>
<ImprovementType>Military</ImprovementType>
<PlacementType>ApprovalUnique</PlacementType>
<IsIndestructible>true</IsIndestructible>
<IsPlayerWonder>true</IsPlayerWonder>
<Stats>
<EffectType>ManufacturingCost</EffectType>
<Scope>Queue</Scope>
<TargetType>Improvement</TargetType>
<Value>400</Value>
</Stats>
<OnEvent>OnConstructImprovment</OnEvent>
<EffectType>CultureMerciless</EffectType>
<Value>100</Value>
<ValueParam>5</ValueParam>
<LevelEffectStats>
<EffectType>GoodsAndServices</EffectType>
</LevelEffectStats>
<NeighborBonuses>
<GiveBonusToNeighborType>AllImprovements</GiveBonusToNeighborType>
<NeighborBonusValue>1</NeighborBonusValue>
</NeighborBonuses>
<Prerequ>
<Techs>
<Option>DefenseSystemTech</Option>
</Techs>
<Option>ExterminatorsAbility</Option>
</Prerequ>
</Improvement>
all that really matters here is the
but having the whole thing lets you check if it is in the right order easier. you do this before you garrison and i think you should be good. sounds like you only want to use <ValueParam>1</ValueParam> and not 5 tho. it might not be possible to do both at once either. idk *shrugs*
as to the bit about not needing certain tags. well some stuff sets a value, but doesn't have an effect. and some stuff causes an effect. it is confusing and i can't really explain it well or any type of rules about it but that is what i have figured out so far.
if the game has multiple sources for a file it is possible it pulled from a different folder than what your mod info needs. but since some of what you did works. i don't see how this could be an issue here.
pictures of your mod file structure help me get more specific. you know what your doing here, and have shown it so I am pretty confident you can figure this out from here, but if I am wrong happy to help.
a common issue is also that description text is a different file so stuff can happen properly but not be displayed correctly.
if we can't figure something out you could also make it be it's own mod and come back to it when someone else can. issue 5 would make sense here. i have ideas, but i need time to research and figure stuff out. i have no idea on file names or where to find info, just that I can and will
in crusade game folder file UnitLeaderDefs.xml lead me to tag <InternalName>MilitaryLeader</InternalName>.
UnitLeaderStatDefs.xml had
<UnitLeaderStats>
<UnitLeaderType>ResistanceBonus</UnitLeaderType>
<Stat>
<BonusType>Multiplier</BonusType>
<Value>0.06</Value>
</Stat>
</UnitLeaderStats>
which is the general resistance bonus (i think). not really what I want here, but because it was about resistance and your doing resistance stuff it might help there. Nothing else about generals that i could see.
checking UnitPromtionsDefs.xml i found
<OnEvent>OnUnitGenerated</OnEvent>
<DescriptionText>Promotion_Supreme_General_ActionTriggerDec_0</DescriptionText>
this is the one I was looking for.
those are the files and i didn't see any new ones in retribution. all your descriptions are in EXP2_Crusade\English\Text and have similar names.
tbh i don't know if having an effect repeat on a timer is possible.
what i do know is:
you can make stuff happen on specific turns. you can set durations. starbase modules give resources per turn. trade resources give resources per turn. it should be possible to make similar events happen every so many turns that work like being on timer, but actually have a separate event for each.
also while thinking about where i was going to dig into some other stuff. i figured out that what your doing with issue 5, and stuff about legions from issue 2 are relevant. issue is using garrison instead of legion or whatever the specifc tag was. since what you want is to add to your resource pool, you shouldn't need anything about garrison
I'm so sorry for the late reply, Been a bit busy.
Great
Ah I see. It's fine.
I tried this, but somehow the legions I gave doesn't get taken away by the ability when a new planet was colonized/conquered. After some more trial and errors, it seems like there really is a cap for the Resistance value. I wish I know of a way to confirm this, as in directly finding an xml or similar things that specifically caps the value. I decided to make do with giving them 10 legions instead of 1, and ability to Train Legion without requiring any special resources (vanilla Train Legion requires 5 Durantium and takes 250 manufacturing) at half the manufacturing cost to try to make them more competitive against other Uber Races . Sadly, it turned out that Race still lost to other Uber Races more often than not because they somehow surrendered fairly quickly . Now I gotta find a way to make that specific race unable to surrender.
Nice. This might mean that any single ResistanceBonus is capped at 100%, so maybe I need 5 separate triggers that each gives 100%. I should try this again, though, judging from how things went thus far, I really hope this one would do the trick. If it doesn't, oh well, no biggie .
Honestly, though, this sounds kinda cool. I'll look forward to your upcoming mod.
Glad to hear. I appreciate the help .
I have no plans for any mods myself. to be honest i usually just take the awesome work other people published and make it work how i want if i can. I might publish something to do with admin centres and starports + space elevators changing those, or making versions for races that don't have them. I really wanted to include some stuff with Colony Capitals here, but if I make them delete able so they can be moved the ai deletes them, and doesn't build it. I don't know how to fix this and my post about it has gotten no responses so I put it on hold for now. I played around with Civilizations captials, but same problem, only worse because if that is your only planet and you delete it, it loses the population cap and it is simply game over for that faction. i was gonna work around that one by allowing the player to build a colony capital (or maybe some other building) in addition to it. If I had seen any events that spawn a building I might try that approach but in this game i haven't seen anything.
If I can help someone else enjoy the game, I do what I can. And i like doing this, especially when the person I am trying to help makes it as easy to do as you have.
If i try to do something and have 0 ideas i try to make a post and ask, then move on. So if someone else tries there is at least a post with no answers.
There are many great features available to you once you register, including:
Sign in or Create Account