gimp script to save terrain corner transitions

Production of artwork for the game by regular contributors takes place here.

Moderator: Forum Moderators

Post Reply
yobbo
Art Contributor
Posts: 151
Joined: September 16th, 2005, 6:31 am
Location: New Zealand

gimp script to save terrain corner transitions

Post by yobbo »

I've gone and made a gimp script to save terrain corner transitions from a single file. It duplicates and crops your image to the sizes that work best for Wesnoth. You can choose whether you're saving a concave or covex corner, and which direction (ne, e, se, sw, w, nw), and it'll resize and name the resulting png accordingly.

You just have to draw a concave and convex version of your terrain edges, around the position of the central white hex in the template image (err, don't draw on the template image), then cut it up so that each corner is on a separate layer. Make the corner you want to save visible, then run the plugin.

To install it, just extract it to your gimp plug-ins folder, then restart gimp.

It'll then be in your "Python-Fu" menu, under "Wesnoth". For lack of a better name, I called it "WesCutter".
Attachments
overlay_template.png
overlay_template.png (1.56 KiB) Viewed 6364 times
wescutter.py.zip
extract to gimp plug-ins directory
(1.17 KiB) Downloaded 631 times
yobbo
Art Contributor
Posts: 151
Joined: September 16th, 2005, 6:31 am
Location: New Zealand

Post by yobbo »

EDIT: removed example - see below.
Last edited by yobbo on November 16th, 2005, 11:47 am, edited 1 time in total.
freim
Retired Terrain Art Director
Posts: 1113
Joined: November 29th, 2003, 11:40 pm
Location: Norway

Post by freim »

Very nice. It's working with stuff like this manually that makes tile creation tedious.
Boucman
Inactive Developer
Posts: 2119
Joined: March 31st, 2004, 1:04 pm

Post by Boucman »

did you add it to the wiki yet ?
Fight key loggers: write some perl using vim
User avatar
Jetrel
Posts: 7242
Joined: February 23rd, 2004, 3:36 am
Location: Midwest US

Post by Jetrel »

Boucman wrote:did you add it to the wiki yet ?
Yeah - I haven't checked to see if you have, but if not, please do. I've started the art tutorials section, and will be adding a bunch of my own material up there, but I don't have the time to maintain it myself.

I've been doing a bit too much of that, and ... I'm not Cedric, or AT - my time is best spent doing art, or soon enough, code. It's really been sapping my already minimal free time.
yobbo
Art Contributor
Posts: 151
Joined: September 16th, 2005, 6:31 am
Location: New Zealand

Post by yobbo »

Hmm, I'll add this to the wiki when I've made sure it all works properly. Here's a new version which lets you save without the "concave" / "convex" part. Useful for keeps, for example.

And an updated template. With guides for easy image placement. (Thanks to Eleazar - this is actually a copy of his photoshop template)
Attachments
overlay_template.xcf.zip
template with guides
(3.02 KiB) Downloaded 829 times
wescutter.py.zip
more current script
(1.2 KiB) Downloaded 921 times
yobbo
Art Contributor
Posts: 151
Joined: September 16th, 2005, 6:31 am
Location: New Zealand

Post by yobbo »

I'm just in the process of adding this (with instructions) to the wiki. It's currently at http://www.wesnoth.org/wiki/Editing_Castles. But I'm gonna copy it here because I need to link the images from somewhere :).

EDITING CASTLES USING WESCUTTER
---------------------------------------

*** Step 1: Open ***

Open the overlay template in The GIMP.

IMAGE 1

Find the castle tiles you want to modify and drag them onto your image. This should add each castle image as a separate layer. In this case I'm modifying the "castle-convex" parts of pekka's castles. Press 'M' and move the layers around so that the images line up around the central white hex. The layers should snap to the guides in the overlay template, so this should be easy to get exactly right.

IMAGE 2

You can hide the guides (as I've done here) by pressing shift-control-T, or deselecting "show guides" in the "View" menu.
Attachments
IMAGE 2 - correctly placed castle
IMAGE 2 - correctly placed castle
shot2.jpg (27.43 KiB) Viewed 6115 times
IMAGE 1 - overlay template
IMAGE 1 - overlay template
shot1.jpg (31.38 KiB) Viewed 6116 times
yobbo
Art Contributor
Posts: 151
Joined: September 16th, 2005, 6:31 am
Location: New Zealand

Post by yobbo »

*** Step 2: Edit ***

Edit the castle to your heart's content. Here I'm just going to put some annoying little flags on top. Make sure you edit one corner at a time, and that you keep each corner on a separate layer. It's useful to turn "Snap to Guides" off (in the "View" menu) if you're doing any freehand drawing.

IMAGE 3
Attachments
IMAGE 3 - castle with some silly flags
IMAGE 3 - castle with some silly flags
shot3.jpg (29.31 KiB) Viewed 6118 times
yobbo
Art Contributor
Posts: 151
Joined: September 16th, 2005, 6:31 am
Location: New Zealand

Post by yobbo »

*** Step 3: Save ***

Now to save the edited castle. First, make everything except for one corner invisible.

IMAGE 4

Then run the "WesCutter" script. If you've extracted the plugin to the right place, it should be found in "Wesnoth" under the "Python-Fu" menu. You'll be doing this again, so click the dotted line to detach the Wesnoth menu and save yourself a few clicks.

The script lets you choose a directory to save the file in (I'm saving to my desktop), the base filename (in this case, "castle"), whether it's a concave or convex image (added to the filename) and which corner it is (in this case, NW).

IMAGE 5

After clicking on "OK", I have a shiny new image called "castle-convex-nw.png" on my desktop, just the right size to work in Wesnoth. After doing this with all 6 corners, you can put them in the "images/terrain" subdirectory of your userdata directory (see EditingWesnoth). If you've put them in the right place, your new castles will automatically replace the old ones next time you run wesnoth :).

IMAGE 6

hooray!
Attachments
IMAGE 6 - w00t! fl4gz!
IMAGE 6 - w00t! fl4gz!
shot6.jpg (41.25 KiB) Viewed 6095 times
IMAGE 5 - wescutter
IMAGE 5 - wescutter
shot5.jpg (29.03 KiB) Viewed 6124 times
IMAGE 4 - one corner at a time
IMAGE 4 - one corner at a time
shot4.jpg (33.43 KiB) Viewed 6107 times
Post Reply