gimp script to save terrain corner transitions
Moderator: Forum Moderators
gimp script to save terrain corner transitions
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".
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 (1.56 KiB) Viewed 6367 times
-
- wescutter.py.zip
- extract to gimp plug-ins directory
- (1.17 KiB) Downloaded 632 times
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.Boucman wrote:did you add it to the wiki yet ?
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.
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)
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 922 times
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.
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
- shot2.jpg (27.43 KiB) Viewed 6118 times
-
- IMAGE 1 - overlay template
- shot1.jpg (31.38 KiB) Viewed 6119 times
*** 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
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
- shot3.jpg (29.31 KiB) Viewed 6121 times
*** 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!
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!
- shot6.jpg (41.25 KiB) Viewed 6098 times
-
- IMAGE 5 - wescutter
- shot5.jpg (29.03 KiB) Viewed 6127 times
-
- IMAGE 4 - one corner at a time
- shot4.jpg (33.43 KiB) Viewed 6110 times