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: elliotg, Icemania

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

RE: Modding Tool

Post by Sabranan »

Thank you for your kind words, not to mention your top-notch feedback Drybreeze!

I've spent a decent amount of time debugging the Dialogue Templates form now, and I can't find anything else wrong with it. It does output blank files if they didn't exist in the first place, but this isn't really a bad thing. It saves you creating the file yourself if you want to create more templates for that folder and it doesn’t seem to bother the DW engine to have blank files here.

When I go through the second pass I’ll look into seeing how big the form would have to be to change it so it just displays all the variables at the same time. I’ll likely do the opposite for the Races and Policies forms, as it is they’re just too big.

But that can wait. For now, we’re at 0.1.5 and I can declare core functionality done! Everything works, it’s now just a matter of implementing ease of use features and making it all look pretty.

For 0.1.6 I’ll be looking at linking in the picture references various forms that use them. Right now it’s just a number that relates to a file somewhere, I’d like to have it so it actually shows the picture and upon clicking it it should give you the option to choose a new one, which it would then save to your mod folder when you output.
User avatar
Pymous
Posts: 191
Joined: Thu Apr 01, 2010 7:12 am
Contact:

RE: Modding Tool

Post by Pymous »

I just logged in to say a big Bravo! and thank you for such tool!
Please continue to improve it!
Thank you again!
[Mod]Shadow Stratagems Artpack for Shadow Empire game.
soulstenance
Posts: 7
Joined: Thu May 19, 2016 7:27 am

RE: Modding Tool

Post by soulstenance »

This looks pretty cool! Good work, perhaps I'll try it out. [:)]
User avatar
Drybreeze
Posts: 129
Joined: Thu Apr 14, 2016 11:21 pm
Contact:

RE: Modding Tool

Post by Drybreeze »

Hi Sabranan,

Thank you for helping me with the issue I had.

I'm having another, I don't think it's related...?

I have edited a design template and gone to export the files... actually the first time I edited basically ALL of them... aw well.
So I noticed the design template folder was empty except for the Shakturi folder. It had given me an exception error while exporting the files, and I'd selected "continue".

I recovered the folders from a backup (I'm a backup nut), and tried again.

Second time around I edited just one design, and watched the folder as I exported. Same unhandled exception error came up and sure enough all folders vanished from the design templates folder, except Shakturi.

I was going to post the error below but it occurred to me that maybe it would represent a security issue to either your program or my computer if I posted it, so I've PM'd it to you.

I haven't tested to see if it is the same on anything other than design templates yet.
Image
Sabranan
Posts: 474
Joined: Wed Feb 24, 2016 4:05 pm

RE: Modding Tool

Post by Sabranan »

Hi mate, I've seen this problem before and it's quite simple to solve!

When my tool writes to a subfolder it copies the subfolder into a backup (if it hasn't made one already), then deletes the original before it outputs. That way you've got a backup and the tool has a clean location to write to.

The problem is the "vssver2.scc" file is flagged as a hidden & system file. My tool doesn’t try to invoke admin rights, so it can’t delete them and throws that exception.

You’ll probably find the "vssver2.scc" file under the Shakturi folder since that’s where it stopped deleting, but you might well find it in other places too, it seems to be a leftover file from when they compiled DW (it’s a Visual Studio Source Control file, not needed for the game).

You can safely delete any "vssver2.scc" file you find under your DW installation and doing so should make that error go away.
User avatar
Pymous
Posts: 191
Joined: Thu Apr 01, 2010 7:12 am
Contact:

RE: Modding Tool

Post by Pymous »

I can't wait updates :)
Guys, this tool is just too awesome. Maybe you are going to start a new age of DW modding :)
[Mod]Shadow Stratagems Artpack for Shadow Empire game.
User avatar
Drybreeze
Posts: 129
Joined: Thu Apr 14, 2016 11:21 pm
Contact:

RE: Modding Tool

Post by Drybreeze »

The file keeps appearing in random folders.

Since I'm using yer tool to edit designs while in-game studying designs that work... well it deletes all I've done before hand and I'm back to square 1 each time.

I'll do a search each time prior to outputting and delete the file.

> EDIT: The most effective work-around is to manually delete all folders in the Design Templates folder immediately prior to outputting files from your tool. Works a treat. Keep backups, of course...
Image
Sabranan
Posts: 474
Joined: Wed Feb 24, 2016 4:05 pm

RE: Modding Tool

Post by Sabranan »

So I realised that since those files are included in the default DW installation most likely everyone running the tool will have them, and I'd need to be able to handle it because not everyone will know how to clear those files or feel comfortable doing so.

After bashing my head against a wall for a few days trying to make a ClickOnce app get elevated permissions on command (or at all) so it would have admin permission to delete what it needed to, it occurred to me that file attributes can be changed on command if you have permission to write to the file...

Which of course you do, because DW automatically grants it for the customization folder.

So I thought maybe I could recursively go through all the files in the mod folder and strip any unusual attributes from each one, and if I do that before doing any writing or deleting, it should work nicely.

No doubt it will be difficult, and require some research...

Yeah, someone else has already done it.

6 lines of code later and revision 1 is published. It should now standardize all file attributes in your mod folder before trying to do anything else, which hopefully will sort this issue out forever and even deal with the same problem showing up if you copied a protected file into your mod folder for some reason.

Also includes a minor bugfix to Design Templates, it wasn't clearing the optional values properly when pressing the "Clear Variable" button. Now it does.
User avatar
LordMM
Posts: 904
Joined: Sat May 28, 2016 11:09 pm

RE: Modding Tool

Post by LordMM »

OH hell, great job !!!

Ill try to get to work on this thing :D
It is better to live your own destiny imperfectly, than to live somebody else's life with perfection.
User avatar
Shogouki
Posts: 200
Joined: Sun Aug 11, 2013 7:35 pm

RE: Modding Tool

Post by Shogouki »

Wonderful work Sabranan! [&o]
Sabranan
Posts: 474
Joined: Wed Feb 24, 2016 4:05 pm

RE: Modding Tool

Post by Sabranan »

Revision 2 of 0.1.5 has just been published. It has the components form upgraded to include actual pictures of the components rather than just a Picture Ref textbox with a number.

Clicking on the picture will open a file dialogue box, allowing you to select a replacement image if you like. If you do, it'll copy your selection into the \images\ui\components\ folder of your mod folder when you output.

It seems to be working pretty nicely, and assuming I don't find any major problems with it I'll use it as a template for the various other forms that reference pics.
User avatar
Drybreeze
Posts: 129
Joined: Thu Apr 14, 2016 11:21 pm
Contact:

RE: Modding Tool

Post by Drybreeze »

Ow that's really nice with the icons! Extremely useful.

Except that my icons are larger than your window, so it only shows the top left corner... it will be even more so with the resources since they're twice as large again as the components. I made them as large as the game allows for.

Is it possible to scale them as the game does?
Image
Sabranan
Posts: 474
Joined: Wed Feb 24, 2016 4:05 pm

RE: Modding Tool

Post by Sabranan »

That was actually supposed to be the case, the image under the "about" form already does that. It's already the right size (32x32), I just forgot to set the picture box to zoom mode.

Sorted now with revision 3.
Sabranan
Posts: 474
Joined: Wed Feb 24, 2016 4:05 pm

RE: Modding Tool

Post by Sabranan »

With revision 4 the Special Image Index on the components form now shows the image. This one was a bit of a pain since there are several folders it can potentially be stored in depending on the component type. I think it's working though.

The only one I haven't included is the hyper-drives, since they're stored in sub-folders with 50 separate files (one for each frame) and have separate folders for entering/exiting hyper-drive. I think it’s likely to be a waste of effort since it’s probably going to be quicker for modders to just put the files in the appropriate folder in the first place as opposed to loading 50 separate image files into my tool!
User avatar
kbobbato
Posts: 24
Joined: Fri Mar 07, 2014 9:57 am

RE: Modding Tool

Post by kbobbato »

I get an error while selecting a folder...it says argument length must be greater or equal to zero....perhaps am doing the selection process wrong?
Sabranan
Posts: 474
Joined: Wed Feb 24, 2016 4:05 pm

RE: Modding Tool

Post by Sabranan »

Hi dawnstorme, if you hit continue it should leave you in a position where you can copy/paste the folder. Can you paste it here so I can try it out and see what might be causing it?
User avatar
Drybreeze
Posts: 129
Joined: Thu Apr 14, 2016 11:21 pm
Contact:

RE: Modding Tool

Post by Drybreeze »

When I edit ship designs, it now exports fine without causing that crash I mentioned previously... however it doesn't actually output any of the changes I've made.

In fact, if I make a change and then move to a new variable in the ship design, and then move back to the one I just changed, it's back to the value it was before I changed it.

The icon thing works so damn fine. Very nice addition. I really like it, you can scroll down through the icon images and as with the rest of your tool it makes editing so much easier and more enjoyable than TXT editing. I'm looking forward to seeing all of the new and original mods from the creative minds out there that make use of your mod editing tool.
Image
User avatar
kbobbato
Posts: 24
Joined: Fri Mar 07, 2014 9:57 am

RE: Modding Tool

Post by kbobbato »

You want me to show you the folder I am trying to access...its a mod that i had started a ways back...but kinda got discouraged at how long it was taking me....now with this tool...if i can get it to work...will save me tons of time...

Image
Attachments
error.jpg
error.jpg (271.94 KiB) Viewed 313 times
Sabranan
Posts: 474
Joined: Wed Feb 24, 2016 4:05 pm

RE: Modding Tool

Post by Sabranan »

Ok, I've just published revision 5 which should address both issues.

Drybreeze, you were dead right. I'd somehow managed to delete an "else" line which resulted in the only changes saved in Design Templates being the optional variables. Should be sorted now.

Dawnstorme, the issue here is your mod folder isn't stored under the DW Customization folder. Almost all files are optional in any given mod, and when they're not used the tool needs to be able to reference the original DW files. The error message it gives doesn't match up at all with the actual problem, so I've added a bit of error handling so it actually tells people this!
User avatar
kbobbato
Posts: 24
Joined: Fri Mar 07, 2014 9:57 am

RE: Modding Tool

Post by kbobbato »

Thanks alot...will give it a try now.

A new issue now. Maybe its either since I have distant Worlds on steam or maybe cause i have it on an external hard drive? Here is a picture of it.



Image
Attachments
error2.jpg
error2.jpg (259.84 KiB) Viewed 313 times
Post Reply

Return to “Design and Modding”