:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Privacy Policy :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::
Do you want to advertise at Project Perfect Mod. Find out how to do it HERE.

The time now is Tue Jul 16, 2019 12:16 pm
All times are UTC + 0
 Forum index » Featured Tools » Community Tools
BatchTMPConverter
Moderators: Community Tools Developpers
Post new topic   Reply to topic Page 1 of 1 [10 Posts] View previous topic :: View next topic
Author Message
Starkku
Cyborg Commando


Joined: 28 Dec 2007
Location: Finland

PostPosted: Thu May 26, 2016 3:34 pm    Post subject:  BatchTMPConverter
Subject description: Command-line tool for converting TMP's.
Reply with quote

BatchTMPConverter is a command-line tool for replacing tile image data on Command & Conquer Tiberian Sun / Red Alert 2 terrain template (tmp) files. It allows for fast and quick conversion of PNG image files into already existing terrain templates.

It works by looking for tmp files from input/files directories filtered by file extensions, and looking for a PNG image file matching the filename of the template (sans extension, of course). Only 32-, 24- and 8-bit images are supported as of current, with 8-bit images retaining their own palette information. Image dimensions have to match the full size of the template for the tool to attempt conversion.

DOWNLOAD (v.1.0.1): BatchTMPConverter.zip

System Requirements: Microsoft .NET Framework 2.0

Command-Line Arguments:
Code:

-h  | Show help.
-i= | A comma-separated list of input tmp file(s) and/or directory/directories.
-p= | Palette file to use for conversion.
-e= | Comma-separated list of file extensions (including the .) to use instead of built-in defaults.
-b  | Disable backing up the edited files with same name using file extension .old.
-r  | Alter tile radar colors based on new image & palette data.
-m= | Floating point multiplier to radar color RGB values, if they are altered.

Example: -i="C:\MyFiles,C:\MyFiles\MoreFiles\example.tem" -p="C:\MyFiles\isotem.pal" -e=".tem" -r -m="1.0"


Special Thanks:
To Olaf van der Spek for his documentation on TS/RA2 TMP file format.


Changelog:

Version 1.0.1
* Silhouette of existing extra images is now respected and no pixels will be drawn on background color.
* Tool will now correctly draw background color over existing tile image data (except extra images) where needed.
_________________
Project Phantom

Last edited by Starkku on Fri May 27, 2016 7:40 pm; edited 7 times in total

Back to top
View user's profile Send private message Visit poster's website ModDB Profile ID Twitter Channel URL
E1 Elite
Commander


Joined: 28 May 2013

PostPosted: Thu May 26, 2016 5:30 pm    Post subject: Reply with quote

XCC TMP Editor clips the extra image and fills with 0. This converter does not.


TmpConv.jpg
 Description:
Original - Full import in TMP Editor - TMP Converter
 Filesize:  43.84 KB
 Viewed:  2651 Time(s)

TmpConv.jpg



Back to top
View user's profile Send private message
Starkku
Cyborg Commando


Joined: 28 Dec 2007
Location: Finland

PostPosted: Thu May 26, 2016 5:39 pm    Post subject: Reply with quote

If you can show me that this has some effect on the display of tiles in the game, I will attempt to change it to work like XCC's but otherwise I will not bother.
_________________
Project Phantom

Back to top
View user's profile Send private message Visit poster's website ModDB Profile ID Twitter Channel URL
E1 Elite
Commander


Joined: 28 May 2013

PostPosted: Thu May 26, 2016 5:44 pm    Post subject: Reply with quote

I don't think it will have any impact in-game except may be rendering some non-transparent pixels twice. But
I just checked it with just this one tile only and that too not in-game. Just saw the difference, so reported it.

Back to top
View user's profile Send private message
Starkku
Cyborg Commando


Joined: 28 Dec 2007
Location: Finland

PostPosted: Thu May 26, 2016 5:55 pm    Post subject: Reply with quote

Well thanks for the report in any case. I will see what I can do about it.
_________________
Project Phantom

Back to top
View user's profile Send private message Visit poster's website ModDB Profile ID Twitter Channel URL
Lin Kuei Ominae
Seth


Joined: 16 Aug 2006
Location: Germany

PostPosted: Fri May 27, 2016 7:14 am    Post subject: Reply with quote

nice tool Starkku.

The doubled image on the extra graphics could cause trouble when rendering stuff that stands on this tile, causing the image in the high render layer extra graphic to be shown in front of the object.
_________________
SHP Artist of Twisted Insurrection:  Nod buildings

Public SHPs
X-Mech Calendar (28 Mechs for GDI and Nod)
5 GDI, 5 Nod, 1 Mutant, 1 Scrin unit, 1 GDI building

Tools
Image Shaper______TMP Shop______C&C Executable Modifier

Back to top
View user's profile Send private message
Mig Eater
Defense Minister


Joined: 13 Nov 2003
Location: Eindhoven

PostPosted: Fri May 27, 2016 10:30 am    Post subject: Reply with quote

When using the "paste complete" option in TMP Editor it will only apply the new image to pre-existing, non 0 colour pixels. If you use "paste extra image" then it will copy the whole image like in Starkku's program.

As LKO said it can cause problems & would need to be manually clipped or the Z-data lowered. However the majority of tiles using extra images aren't accessible to units, so the overlapping would be minimal.

It's a nice tool but for my workflow it would take just as long to save each tile as a PNG as it would to just copy it into TMP Editor. If you are just recolouring the original tiles tho I can see this as being a quick & easy way to do it.
_________________



Back to top
View user's profile Send private message Visit poster's website ModDB Profile ID YouTube User URL Facebook Profile URL Twitter Channel URL
E1 Elite
Commander


Joined: 28 May 2013

PostPosted: Fri May 27, 2016 6:39 pm    Post subject: Reply with quote

Exe has been updated but there is no update post, so assuming it is still WIP:
- If the new image is smaller than in the template, it retains the old surplus portions.
- Problem with RA2 cliff08.tem, the resulting tem file had distorted image even with its own exported
image. Tried few other tiles, they were fine.

Back to top
View user's profile Send private message
Starkku
Cyborg Commando


Joined: 28 Dec 2007
Location: Finland

PostPosted: Fri May 27, 2016 7:37 pm    Post subject: Reply with quote

I did issue an update earlier but it was faulty and quickly withdrawn. Here's a new one.

Version 1.0.1
* Silhouette of existing extra images is now respected and no pixels will be drawn on background color.
* Tool will now correctly draw background color over existing tile image data (except extra images) where needed.

I am unsure on cause of the distortion issue but it seems it is related to the input image, possibly only happening on 8-bit bitmaps. I will investigate.
_________________
Project Phantom

Back to top
View user's profile Send private message Visit poster's website ModDB Profile ID Twitter Channel URL
E1 Elite
Commander


Joined: 28 May 2013

PostPosted: Sat May 28, 2016 2:55 pm    Post subject: Reply with quote

If there is support for larger image than the template image like in the yesterday's version, users will
have the ability to replace with a similar image. What XCC does with full import seems restrictive.

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [10 Posts] View previous topic :: View next topic
 Forum index » Featured Tools » Community Tools
Jump to:  
Share on TwitterShare on FacebookShare on Google+Share on DiggShare on RedditShare on PInterestShare on Del.icio.usShare on Stumble Upon
Quick Reply
Username:


If you are visually impaired or cannot otherwise answer the challenges below please contact the Administrator for help.


Write only two of the following words separated by a sharp: Brotherhood, unity, peace! 

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © phpBB Group

Wildcard SSL Certificates
[ Time: 0.2647s ][ Queries: 14 (0.0644s) ][ Debug on ]