KarlBar99 KarlBar99

General Modding Questions Thread (All Welcome)

General Modding Questions Thread (All Welcome)

Whilst i'm creating this for my own little pet project to ask dumb basic questions in, anyone who has a question and wants it answered should feel free to drop by, the lack of anything like this that i've been able to find, (maybe i'm blind :p), is a bit sad for everyone else who has questions.

 

 

Ok my first really basic question. is there any way to modify an existing entry in an XML file without overwriting the entire file? The readme talks about adding new stuff and Total Conversions fine, but my modified tech tree is going to need to add tech option entries to some existing improvements. Having to completely overwrite the existing improvements file is not ideal, and their may be other examples i need to edit.

 

Does anyone know is ComponentClasDefs.xml is working as far as adding and using entries. I know occasionally some files won't be enabled in some games and this strikes me as the type of file that's most likely to have issues.

80,519 views 118 replies
Reply #26 Top

And this is for your Arcaan's yes? Let me dig through some files i remember looking at, see if i can see how this is working out.

 

Also what do the constructors they do build look like?

Reply #27 Top

same as the standart ones, they are called Lite Constructor Modules and are cheaper/ have less maintance

Reply #28 Top

Hmm, assuming the answer to my second question above is what i think it is, (i.e. they build various type's, not just the default constructor blueprint), and assuming i understand how the AI prioratises this sort of stuff;

 

Change the following code from:

<Stats>
<EffectType>Value</EffectType>
<Target>
<TargetType>Ship</TargetType>
</Target>
<BonusType>Flat</BonusType>
<Value>10</Value>
</Stats>

To:

<Stats>
<EffectType>Value</EffectType>
<Target>
<TargetType>Ship</TargetType>
</Target>
<BonusType>Flat</BonusType>
<Value>11</Value>
</Stats>

 

Just a best guess based on how i think this kind of thing is handled behind the scenes.

Reply #29 Top

So far I've modded in several factions both major and minor with only a few issues, typically me misspelling or forgetting to put something.  However, I can't find the issue with my most recent two mods, the Confederacy of Independent Systems and the l'Cie Sanctum.  Every time I try to use them as the player race or and AI race the game shuts down as the map tries to load.  The problem seems to be the home system, because if I copy either race in the ingame editor and change the home system they work fine.  But when I compare the StarDefs, PlanetDefs, and StarSystemDefs to my other mods and the originals btu I cant find the issue.

 

Here the Confederany:

 StarDefs

<?xml version="1.0" encoding="utf-8" standalone="yes" ?>

<StarList

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:noNamespaceSchemaLocation="../Schema/StarDefs.xsd">

 

<!--Fixted Sytem Stars-->

 

<Star>

<InternalName>MusafarStar</InternalName>

<DisplayName>Mustafar</DisplayName>

<ObjectType>Star</ObjectType>

<Type>YellowStar</Type>

<ArtDefine>SunArt</ArtDefine>

<SFXDefine>STAR_AMBIENT</SFXDefine>

</Star>

 

</StarList>

PlanetDefs

<?xml version="1.0" encoding="utf-8" standalone="yes" ?>

<PlanetList

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:noNamespaceSchemaLocation="../Schema/PlanetDefs.xsd">

 

                <Planet>

                                <InternalName>PlanetGeonosis</InternalName>

                                <DisplayName>GeonosisName</DisplayName>

                                <PlanetType>Habitable</PlanetType>

                                <PlanetClass>15</PlanetClass>                

                                <ArtDefine>DrengiArt</ArtDefine>

        </Planet>

 

</PlanetList>

StarSystemDefs

<?xml version="1.0" encoding="utf-8" standalone="yes" ?>

<StarSystemList

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xsi:noNamespaceSchemaLocation="../Schema/StarSystemDefs.xsd">

<!-- Created with the Gal Civ 3 Editor -->

<!-- StarSystemDefs.xml -->

 

  <!-- System Group -->

 

  <StarSystemGroup>

    <InternalName>DroidStart</InternalName>

 

    <StarSystem>

      <InternalName>MustafarSystem</InternalName>

      <DisplayName>MustafarSystem_Name</DisplayName>

      <Description>MustafarSystem_Dec</Description>

      <OrbitLane>

        <LaneType>Star</LaneType>

        <Body>

          <BodyType>UnaryStar</BodyType>

          <BodyDef>MustafarStar</BodyDef>

        </Body>

      </OrbitLane>

      <OrbitLane>

        <LaneType>NoRandom</LaneType>

      </OrbitLane>

      <OrbitLane>

        <LaneType>HabitableZone</LaneType>

        <Body>

          <BodyType>Planet</BodyType>

          <BodyDef>PlanetGeonosis</BodyDef>

          <IsHomeworld>true</IsHomeworld>

          <Position>5</Position>

        </Body>

      </OrbitLane>

      <OrbitLane>

        <LaneType>NoRandom</LaneType>

      </OrbitLane>

    </StarSystem>

 

 </StarSystemGroup>

 

</StarSystemList>

Reply #30 Top

<OrbitLane>

<LaneType>NoRandom</LaneType>

</OrbitLane>

 

That piece of code is redundant as their are no entries associated, can't see why that would be an issue but only thing that jumped out on a cursory glance.

Reply #31 Top

Your first instance of:-

<OrbitLane>

<LaneType>NoRandom</LaneType>

</OrbitLane>

Should be :-

<OrbitLane>
<LaneType>DeadZone</LaneType>
</OrbitLane>

As far as I can tell(not done much modding yet) you need all 4 lane types in the StarSystemDefs.xml or it will cause the game to hang, even if there are no planets in the lanes.

Reply #32 Top

All of my working mods have NoRandom as the first LaneType and don't have any problems.

Edit1: I'll try it just in case.

Edit2: Nope, still doesn't work.

Reply #33 Top

Ok what I am seeing is wrong here is you have <InternalName>MusafarStar</InternalName> set in stardefs

and <BodyDef>MustafarStar</BodyDef> set in starsystemdefs

spellings are different so the game cannot find the body def you are defining so it crashes.

Reply #34 Top

Oh god, completely missed that, so obvious too. Perfect example of seeing what we expect to see.

 

Question of my own that you might be able to help with Deathwynd. Tried to add a custom trait via modding, used your diversity trait mod as an example, but it dosen;t seem to be working, the option to select the trait doesn't appear. Relevant sections of code:

 

This is a new file named; DreadLordsRaceTraitsDef:

<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<RaceTraitList
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../Schema/RaceTraitDefs.xsd">
<!-- Created with the Gal Civ 3 Editor -->
<!-- RaceTraitDefs.xml -->

<RaceTrait>
<InternalName>Constructor1</InternalName>
<DisplayName>Constructor1_Name</DisplayName>
<Description>Constructor1_Desc</Description>
<Mod>
<EffectType>ModuleConstructionPointsCap</EffectType>
<Scope>Global</Scope>
<Target>
<TargetType>Ship</TargetType>
</Target>
<BonusType>Multiplier</BonusType>
<Value>1</Value>
</Mod>
</RaceTrait>

<RaceTrait>
<InternalName>Constructor2</InternalName>
<DisplayName>Constructor2_Name</DisplayName>
<Description>Constructor2_Desc</Description>
<Mod>
<EffectType>ModuleConstructionPointsCap</EffectType>
<Scope>Global</Scope>
<Target>
<TargetType>Ship</TargetType>
</Target>
<BonusType>Multiplier</BonusType>
<Value>2</Value>
</Mod>
</RaceTrait>
</RaceTraitList>

 

And this the the extra data added to the end of an overwrite of RaceTraitSliderGroupDefs:

 

<RaceTraitSliderGroup>
<InternalName>ConstructorGroup</InternalName>
<DisplayName>ConstructorGroup_Name</DisplayName>
<Description>ConstructorGroup_Desc</Description>
<RaceTraitOption>
<Empty>true</Empty>
</RaceTraitOption>
<RaceTraitOption>
<Empty>true</Empty>
</RaceTraitOption>
<RaceTraitOption>
<RaceTrait>Constructor1</RaceTrait>
<Cost>1</Cost>
</RaceTraitOption>
<RaceTraitOption>
<RaceTrait>Constructor2</RaceTrait>
<Cost>2</Cost>
</RaceTraitOption>
</RaceTraitSliderGroup>

 

Any idea why it's not working?

 

 

 

 

Reply #35 Top

Ok everything not only looks right but it IS right.

I copied your code dropped it in some test files and it shows up in game  just fine.

Here's the thing sometimes you can get corruption or invisible formatting errors which can render a file non functional.

I've actually had a file that would not work right no matter what despite the code working fine when copied into a new file.

I finally ended up recreating the file from scratch but something else I've done is I have long run Notepad++ for my editing and I went out and got the XML tools plugin which does syntax checking and can do auto validation which means when you try to save the file it willw arn you of missing brackets or unclosed tags etc.  Helps immensely.

So I would copy your text from here, pull a brand new copy of RaceTraitSliderDefs.xml from the game files and create a new DreadLordsRaceTraitsDef.xml and paste your data from here into them and I betcha they will work.

Reply #36 Top

Cheers Deathwynd. Question, where's the XML plugin for notepad++, i've long use the same program myself but don't think i have that plugin unless it's a base install one and i just haven't realised i have it or turned it on. Will give it a go in the morning, (well afternoon will be when i wake up local time but w/e).

Reply #38 Top

Thanks. Also figured out the issue. Lack of sleep last night made me put the modified racetraitsslidergroupdef file in the wrong folder, (English/Text to be precise).

 

Yeah have a good laugh.

Reply #39 Top

That happens all the time. My first thought when something does not work is; "What stupid shit could I possible have done now" Usually spelling error somewhere :(

Reply #40 Top

My first thought when something does not work is; "What stupid shit could I possible have done now" Usually spelling error somewhere

 

Same TBH, but i was just too tired last night to see it.

Reply #41 Top

I'd like to add new ship blueprints, mainly to automatize upgrades of ships the way I usually would design them manually. Is there any information or examples available about this? I.e. what are the minimum things I need to add and modify to get it work? I have modified existing blueprints to see how the component stuff works but that's easier as all the cross-references and linked definitions are already there and you only need to modify the ship contents.

However, I'd like to leave the original ship blueprints as they are and just add my own new ones. I quickly noticed that there's all kinds of references to definitions in other files and I'm unsure of what's really necessary and what's optional or stuff that could be "shared" with existing objects...

I found the "create your own faction" mod help which contained info about ships and their designs, too, but I'm not doing anything that major or fancy. I'd be quite happy to use the same graphical designs as the standard ships and the models would functionally be similar to them, too.

An example of how to add one new ship blueprint and what other definitions or modifications you must do to make it appear and work in the game, would be ideal. Any help or pointers to help is appreciated, though.

Reply #42 Top

TBH the project you are describing is MUCH larger than what you may think, you would need to go through and create new blueprints for each race and each class and type of ship and then add those to the FactionShipStyleSetDefs.xml

It sounds as though you are wanting to tweak the blueprints so they produce ship closer to the way you want to see them.

On the one hand this can be done relatively easily by modifying the existing blueprints so they produce ships more in line with what you would want.  However this has pitfalls and ramifications you don't foresee and cannot without a ton of time learning the blueprint designs and trial and error. First problem is if you change the blueprints for your own preference, and its fairly easy to do once you understand the blueprints file, it will muck up what designs the AI uses.  If you create your own versions from scratch its going to be a ton of work and for frankly little return if its not for a mod.

Your best bet is just create your own designs, as you play through each race and hit milestones in tech that make you want to design a new ship, design it and then save it as a template.  Then when you redesign that ship while playing it won't monkey with the initial version you made and when you play through again that template will be sitting there waiting for you to be ready for it.

The Blueprint system tries to be semi intelligent and produce workable ships both you and the AI can be at least moderately successful with, they won't be perfect but their mostly at least function for their role.

If you decide you really do want to tackle this then go read. this and create a basic mod using ShipBlueprintDefs.xml and FactionShipStyleSetDefs.xml open the blueprint files and read over all of them to get a feel for how the game uses the blueprints and then come back here and ask questions as needed.

Reply #43 Top

Question, assuming it's possible what code would i need to enter to specify a specific ship hull type, (i.e. Tiny, Small Medium e.t.c.).

 

Is it possible to either create new fighter types or specify a specific tech tree to use different blueprints for a specific type?

 

I suspect the answer in both cases is "not possible" but would like to be sure.

Reply #44 Top

1. If you are talking blueprints then its     <ShipHullType>Tiny</ShipHullType>

2. as far as I know the fighter types are locked up in the XSD'd which atm are unmoddable, they just crash the game.

The blueprints for the existing fighters are moddable but afaik there is no way to add additional ones or specify alternate BP's

Reply #45 Top

2. Cheers that what i thought.

1. No what i mean is if ai specify a modifier, (Say +moves or whatever), is there code that would let me target a specific hull type instead of just all ships.

 

Basically the number one issue i'm getting with my Dread Lords race for Tiny/Small hull types is that the modules are just too dammed heavy, i could do with either specifying a larger hull size for fighters or specifying a small hull size specific capacity boost as part of some tech. You have to get all the mass reducers and even then the tiny Hull size ifs virtually useless.

Reply #46 Top

I'll take a look it might be possible but not certain I think ship is as granular as you can make it.  You can do a mod directly to the shiphullstatdefs but don't think you can apply it from the component side.

Reply #47 Top

Just got home from work and with the StarDefs fixed the mod works.  Is it bad that I wish the problem was a bit more serious than a simple misspell.  makes me feel like an idiot, especially since I've misspelled something on every mod I've made the first time.  Anyway, thanks for the help.

 

Reply #48 Top

One of the best ways to avoid that is to use notepadd++, have all files being edited open and use copy past to copy such items across. Doesn't prevent them, but it cuts down a lot. Spelling Errors are just part and parcel of the whole modding thing, no ones perfect, hell look at how many bugs there are in game atm that are due to the Dev's doing it...

 

If that many slipped by their Q&A you can guarantee that there where a lot more before Q&A got done.

Reply #49 Top

Quoting KarlBar99, reply 43

Is it possible to either create new fighter types or specify a specific tech tree to use different blueprints for a specific type?

Quoting Deathwynd, reply 44

2. as far as I know the fighter types are locked up in the XSD'd which atm are unmoddable, they just crash the game.

While Deathwynd is to my knowledge correct, there are four fighter types defined in the game: Assault, Interceptor, Guardian, and Escort. Escort and Assault fighters are defined to be the same fighter type in FactionShipStyleSetDefs.XML (both are defined with (Race)AssaultFighter as the fighter class for each faction), so if you wanted to do so, you could use Escort fighters as a "new" fighter type. Be advised that the final carrier module technically provides escort fighters rather than the assault fighters it deploys in the game, so if you were looking to leave existing ship components alone, you'd need to change that ship component to provide AssaultFightersCap rather than EscortFightersCap. In order to make use of Escort Fighters as your "new" fighter type, you'd need to edit FactionShipStyleSetDefs so that InitialEscortFighter pointed to some class that isn't (Race)AssaultFighter for each faction, you'd need to edit ShipClassDefs.XML or create a new file to define each of your new Escort Fighter classes, and you'd need to edit ShipBlueprintDefs or create a new file to define the new fighter blueprint(s) referenced by the class definitions.

Reply #50 Top

TBH the project you are describing is MUCH larger than what you may think

Thank you for the explanation. Too bad. The idea was indeed to try to avoid messing up with the AI design choices while still automating my own. It *sounded* so simple :). Well, have to make do with the manual designs then, and plan them so that I can easily use them from one game to the other. Some naming convention, perhaps, to keep track of the upgrades.

But thanks!