Modding Tool [1.1.0 Released!]

Please post here for questions and discussion about scenario, art and sound modding and the game editor for Distant Worlds.

Moderators: Icemania, elliotg

User avatar
Darkspire
Posts: 1986
Joined: Thu Jun 12, 2003 8:07 pm
Location: My Own Private Hell

RE: Modding Tool

Post by Darkspire »

This error(?) came up and I can not find any value matching in the pirate subfolder or the policy files, the pirate policy files do not have a planet destroyers line in them, nor "", the race policy files all have N as the value for BuildPlanetDestroyers.

Invalid build planet destroyers (pirate race)? value "" found in Policies record 0) Ackdarian, value changed to "N"

Darkspire
Sabranan
Posts: 474
Joined: Wed Feb 24, 2016 4:05 pm

RE: Modding Tool

Post by Sabranan »

That kind of warning comes up if a file is missing a variable entirely, as well as if the variable is there but the value isn't. It just means if you haven't put something in it'll populate it with a default value for you.

I think I'm right in saying that aside from the dialogues and design templates, the tool will auto-populate any missing variables in the rest of the files.
Rochndil
Posts: 9
Joined: Fri Jun 30, 2017 3:41 pm

RE: Modding Tool

Post by Rochndil »

Good afternoon!

I'm VERY new to DW: U, though quite technically capable and familiar with modding in general. I tried to use your tool to add a race to the Unleashed Extended II mod ( Link redacted because I can't post such; it's not hard to find. ), but on its first analysis/housekeeping pass, something it updates breaks the mod such that you cannot start a game with it (even before starting to add my race). If you like, I can produce logs and the exaxct error message (which was extremely long and completely inscrutable to me). Other than that, I think you've crafted a really slick piece of software. My only complaint is that the race edit screen is not small-screen-size friendly.

Rochndil, making his first post here...
Sabranan
Posts: 474
Joined: Wed Feb 24, 2016 4:05 pm

RE: Modding Tool

Post by Sabranan »

Hi Rochndil,

I've just downloaded the UE II mod and run it through the tool. Although there are some issues (mostly just typos) with it, I can't see anything game breaking in the log and if I output everything to disk without manually changing anything the resulting theme loads in game, at least for me.

So for diagnosis, I'd say first up use the "Send Log File on Close?" box on the main menu after outputting all the files to disk and it'll send me a logfile with your input/output logs so I can see what's going on. If you stick your forum username in the box that comes up when you close the tool that'll let me know it's from you.

By all means stick your DW error log here, it can't hurt. You might be able to attach it as a txt file to the post, I'm not sure if there's a restriction on that or not for new users. If it doesn't let you it's fine to just copy/paste it into the post itself.
User avatar
Retreat1970
Posts: 1125
Joined: Wed Nov 06, 2013 11:09 am
Location: Wisconsin

RE: Modding Tool

Post by Retreat1970 »

51st shipset?
Rochndil
Posts: 9
Joined: Fri Jun 30, 2017 3:41 pm

RE: Modding Tool

Post by Rochndil »

And hello again!

I've recreated the error twice.

I started by downloading a fresh copy of Unleashed Extended II (from this forum), just to be sure it wasn't a corruption issue. I copied the contents to the Customization directory (and got rid of the extra sub-directory. I then launched the game and switched my theme to UE-II, and successfully started a game (introductory game because it's just one click). Success!

Returned to main menu, and switched theme to something else. Then, I ran your tool, let it do its basic housekeeping pass on that mod. Log should have been sent to your server (seemed successful on this end). Saved ALL changes with backups disabled. Exited tool to send logs. Re-selected UE-II theme. Selection process good (but it always was). Then, tried again to start an introductory game, and about 30 seconds in, BAM! Error time! I don't think I can attach the screen cap, and the text wasn't selectable, so I'll have to transcribe it manually. If I futz it up, that's on me. Error message follows:

"There was an error while attempting to start a new game. If you are using a theme, please revert to the default Distant Worlds theme and try again.

Error details:

System.NullReferenceException: Object reference not set to an instance of an object.
at DistantWorlds.Types.Galaxy.GeneratePirateEmpire(Habitat habitat, Int32 offsetx, Int32 offsety, Race race, Int32 designPictureFamilyIndex, Double techLevel, PiratePlayStyle, piratePlayStyle, Boolean isPlayerEmpire, Boolean isSuperPirates)
at DistantWorlds.Types.Galaxy.GeneratePirateEmpire(Habitat habitat, Int32 offsetx, Int32 offsety, Boolean useRace)
at DistantWorlds.Types.Galaxy.GenerateNewPirateEmpires()
at DistantWorlds.Types.Galaxy.DoTasks(Boolean GameFinished, Empire playerEmpire, VictoryConditions globalVictoryConditions, EmpireVictoryConditions playerConditionstoAchieve, EmpireVictoryConditions playerConditionstoPrevent)
at DistantWorlds.Start.e03OrPRhJAFG88ocShQ(Object, Boolean, Object, Object, Object, Object)
at DistantWorlds.Start.OYWJFHBRu7(GalaxyShape ,Int32 ,Int32 ,Boolean ,Double ,Int32 ,Double ,Double ,Int32 ,Double ,Double ,Int32 ,Double ,EmpireStart ,EmpireStartList ,VictoryConditions ,EmpireVictoryConditions ,EmpireVictoryConditions ,Boolean ,Boolean ,GameStartResets )"

Note that the spacing oddity in the last reference was copied as given, even though it breaks pattern.

Rochndil, hoping that this information is useful...
Bloodly
Posts: 108
Joined: Wed Apr 14, 2010 4:20 am

RE: Modding Tool

Post by Bloodly »

What are the rules of Manufactured resources?

This is driving me batty.

I am trying to use the mod tool to make some generic manufactured resources. Manufactured i.e 'no prevalence, they spawn as a colony develops'. The mod tool outputs fine, no errors. Distant Worlds crashes, asking for Prevalence and types. Which don't apply, because they're meant to be A MANUFACTURED RESOURCE.
Sabranan
Posts: 474
Joined: Wed Feb 24, 2016 4:05 pm

RE: Modding Tool

Post by Sabranan »

Rochndil,

First I'd better tell you than whenever DW generates those error messages that don't have selectable text, it automatically copies the text into the clipboard, so in the future you can just paste it without having to type it all out!

From what I can tell (actually having to use process monitor to see what's going on) it's failing when it tries to load the mortalen or naxxilian pirate races, but I can't see anything wrong with them.

I'll look into this some more tomorrow.

Bloodly,

I'm afraid I don't know exactly how manufactured resources work, but evidentially they do need to have at least one set of location values. Perhaps the location(s) determine what colony types the resource can spawn on? Even if, I have no idea what prevalence or abundance values would do (if anything at all).

When I get a chance tomorrow, I'll add a warning that enforces setting at least one resource location.
Sabranan
Posts: 474
Joined: Wed Feb 24, 2016 4:05 pm

RE: Modding Tool

Post by Sabranan »

Ok, took rather longer than I was hoping (sorry about that) but I think I've cracked this issue. Basically the game doesn't like having blank design templates and the tool created them for you if you loaded in a mod that didn't have some. So the mortalen, naxxilian and probably some others ended up having these empty design templates and the game had a hissy-fit over them.

It should no longer do that, if it loads in a blank or non-existant template it just won't bother outputting those files. So Rochndil if you load them in again and output them (should be fine to just output the design templates) that should fix this issue.

Also Bloodly I've added the warning when you delete the last resource location, so at least the user is told now.

That's revision 6.
Rochndil
Posts: 9
Joined: Fri Jun 30, 2017 3:41 pm

RE: Modding Tool

Post by Rochndil »

Glad you got it figured out!

I've been busy finding ways to break the game. And, then, ways to fix it. I've been tweaking UE-II to my tastes and adding in (small) additions, and of course my custom race. So far I've managed to create a functional mod, but with your tool back in action it's guaranteed to be better (and easier, that race grid is a pain!).

Rochndil, looking forward to maxing out the race list at 50...
Rochndil
Posts: 9
Joined: Fri Jun 30, 2017 3:41 pm

RE: Modding Tool

Post by Rochndil »

Good afternoon!

I've been continuing with my mod project (which, as they tend to do, has grown in scope - now I'm adding 7 new races and tweaking a bunch of stuff). Your tool has not produced any more game-crashing errors (yay!), but it is doing something incorrectly. To a certain degree, this is not your fault, since the readme.txt file in the game folder is actually inaccurate.

The Tactics settings for design templates (added in some version I don't remember), as noted in that readme, are WRONG. Using the formatting indicated does NOT work. The doc says:

TacticsWeaker: Evade (and others)

This is wrong and does not function. After a good deal of tinkering and experimentation, I found a format that DOES work. There may be others, but this tested right.

TacticsWeaker; Evade (and others)

Note the lack of space after the variable name, the semicolon, and one space before the value. Your tool is currently outputting something like:

TacticsWeaker[TAB][TAB]: Evade

This doesn't work, even though it's basically what the dev docs say to use. Bad dev! While this is hardly a planet-busting error, I'd definitely add it to the fix pile (should be pretty trivial) for the next iteration.

Now, I've got a different issue to mention. This isn't strictly a bug, and it may be a bit tricky to fix. If a race does not have a pirate design template folder, your tool will create one. It does this even if the race is set NOT to be a pirate! Now, creating a bunch of files that won't then be used isn't really a big deal, but it's technically not necessary if the race explicitly is set not to need them. A logic check against the race file would quickly determine the need for such files, but how complex that would be to code in (and, really, how necessary) is your call.

Rochndil, throwing out the GREP program he was using after determining it doesn't support replace operations...

Sabranan
Posts: 474
Joined: Wed Feb 24, 2016 4:05 pm

RE: Modding Tool

Post by Sabranan »

I hate it when they do that lol, so annoying and the modding guide/text files are full of issues like this. As you say though, easy enough to fix. Internally, the tool actually changes any colons in the design templates to semi-colons anyway for ease of coding, so all I needed to do was change what it actually outputted. It means it'll even correct any files you might have that are still using colons next time you output. I've also removed the tab character that was in there, I'm not sure why that was there in the first place.

As for the other issue, it does create the folder path for the pirate version of a race but it doesn't create any design template files unless you've loaded them in or populated at least one value for them with the tool. I don't really want to have it automatically remove design templates based on the CanBeNormalEmpire/CanBePirate options in the race file, because that would create a situation where a simple unnoticed mis-click could result in you losing a folder full of design templates.

Instead, I've added three buttons at the bottom of the design template form to purge either the current template, all the standard/pirate templates for the race or just all the templates for the race. They all have confirmation boxes so you can't accidentally wipe them, but they should allow you to easily control what files you don't want created.

That's revision 7.
Rochndil
Posts: 9
Joined: Fri Jun 30, 2017 3:41 pm

RE: Modding Tool

Post by Rochndil »

Good evening!

No bugs to report, yay!

I do have a feature request to think about, which could possibly open up a whole new method of modding. I've been tinkering with the scaling attribute for ship designs, and feel that it really adds a lot to the game. When your explorer ships are pretty visually close in size to your capitals, it looks a bit weird. But when you scale those suckers down to represent their relative tonnage, wow what a difference! The problem then becomes everybody ELSE's ships. And, of course, that can also be fixed...by editing 50 different sets of ship designs, PLUS all the pirate versions. And, yes, some of that can be done relatively efficiently by opening all "cruiser.txt" files at once, and doing a global replace on all, but that's still pretty tedious.

What would be really cool is to have a feature in the editing tool that applies a given change to ALL designs of a type (or similar groupings) at once. I wouldn't think the database work would be too tedious, but you'd need a new interface screen to control the process. And, what other fun things could you do with an interface like that? Bump up the shields on ALL pirate ships at once? Easily edit all the ships of one empire to reflect a technology/weapons change? There are probably other bulk changes that folks have wanted to try that were simply too much trouble to accomplish by hand.

Give it some thought - I'm sure there are potential challenges I'm not knowledgeable enough to consider, but the possibilities are still inspiring.

Rochndil, re-jiggering a bunch of stuff, slaving away in the mod fields...
Sabranan
Posts: 474
Joined: Wed Feb 24, 2016 4:05 pm

RE: Modding Tool

Post by Sabranan »

That's an interesting thought actually, you might have noticed that the components and resources forms already have some multiplier functions you can apply in batch, so the concept is there already. I don't see why it couldn't be done for design templates too, I'll have a look at what can be done there over the next week.
User avatar
Hattori Hanzo
Posts: 735
Joined: Mon Mar 21, 2011 12:40 pm
Location: Okinawa
Contact:

RE: Modding Tool

Post by Hattori Hanzo »

the "scaling feature" suggested by Rochndil seem extremely interesting: it's so weird that the smaller ships in the game are so similar to the capital ships [8|]
User avatar
Capshades
Posts: 138
Joined: Sat Aug 02, 2014 8:17 pm

RE: Modding Tool

Post by Capshades »

This would be fantastic, a much faster way to balance and do those small edits when polishing a mod.
Sabranan
Posts: 474
Joined: Wed Feb 24, 2016 4:05 pm

RE: Modding Tool

Post by Sabranan »

Ok, I've just put together a batch tasks subform for the design templates. So in revision 8 you can apply an absolute or scaling value to any combination of ships/bases, for either standard, pirate races or both at the same time. You can do this for multiple races at once too, so it should be easy to standardise scaling across all your races.

You can also apply the value as a multiplier to whatever the existing value is, you'll need to be a bit careful doing that to stay within the acceptable range but it means you can do scaled changes across all of your design templates.

Lastly, I've put in something so you can set tactics on mass. So if you want to set every race's troop transports to invade immediately, you can do that in a few clicks rather than changing them all individually. You can set tactics one tactic type at a time, all at once or any combination thereof.

Hopefully that should give you much greater control over your tactics and scaling!
Sabranan
Posts: 474
Joined: Wed Feb 24, 2016 4:05 pm

RE: Modding Tool

Post by Sabranan »

Turns out components wasn't that hard either, so in revision 9 you can now set or multiply each component type in your design templates in the same way you can for the scaling or tactics!
Overlord015
Posts: 55
Joined: Tue Jan 20, 2015 8:08 pm

RE: Modding Tool

Post by Overlord015 »

Hello,

I've recently been trying to mod the troop techs and I've hit a wall, I'm not sure if its a bug or I'm dong something wrong. What I'm trying to do is create a new troop tech that increases both attack and defense. Whenever I try to define the troop type it affects it always seems to default to the all troop types option when i close the abilities sub-menu or switch to another ability line (I'm trying to limit it to infantry).
Sabranan
Posts: 474
Joined: Wed Feb 24, 2016 4:05 pm

RE: Modding Tool

Post by Sabranan »

Thanks Overlord015, I've fixed that now in revision 10.
Post Reply

Return to “Design and Modding”