Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: jdjtcagle on January 21, 2008, 08:12:23 am

Title: Modding Planets
Post by: jdjtcagle on January 21, 2008, 08:12:23 am
I've made planets that I would love to have in game but won't show up... hmm....

I made the planet in photoshop cs2 named it as planete to override the existing one and put it under data/effects.

I made the background solid rgb 0,255,0 and the planet is 16 bit tga, any suggestions?

I'm not sure what format to make it or anything...
Title: Re: Modding Planets
Post by: jdjtcagle on January 21, 2008, 02:26:32 pm
Nobody?  :(
Title: Re: Modding Planets
Post by: blowfish on January 21, 2008, 03:08:49 pm
To be honest, I have no experience with planets, but I think you should name them something else and use a TBM ( blahblahblah-str.tbm ) to add them.  I have had an issue before where a texture or effect just refuses to show up before though.
Title: Re: Modding Planets
Post by: jdjtcagle on January 21, 2008, 03:14:30 pm
TBM? Do you mean table.. TBL?  :confused:
Title: Re: Modding Planets
Post by: Mad Bomber on January 21, 2008, 03:24:43 pm
TBM is modular table file. Works the same, but adds on to the existing relevant TBL rather than replacing it.

I'm surprised you haven't noticed them.
Title: Re: Modding Planets
Post by: jdjtcagle on January 21, 2008, 03:26:38 pm
TBM is modular table file. Works the same, but adds on to the existing relevant TBL rather than replacing it.

I'm surprised you haven't noticed them.

Been away for a long while...

So I can create a second stars table with the NEW planet info only name it stars.tbm and it will act as an extension?
Title: Re: Modding Planets
Post by: blowfish on January 21, 2008, 03:41:42 pm
well, you name it somethinglikethis-str.tbm actually.  Your TBM should look something like this:

-------

$Bitmap: insertyourfilenamehere

#end

-------

Also, make sure the image is in data/effects
Title: Re: Modding Planets
Post by: Getter Robo G on January 21, 2008, 03:44:19 pm
Cart before the horse...

Why get into a new thing when you don't know if your image itself is valid?

I overrid and my 2048 Earth shows up no problem (screwed up as it is).

Find out WHY it's not working before you start monkeying around with new things.
That's my advice.

IF Sizzler comes back maybe he can look at it?  :nervous:
Title: Re: Modding Planets
Post by: jdjtcagle on January 21, 2008, 03:48:25 pm
I'll post the planet up here when I get off work in 2 hours
Title: Re: Modding Planets
Post by: Polpolion on January 21, 2008, 04:39:34 pm

I overrid and my 2048 Earth shows up no problem (screwed up as it is).

IF Sizzler comes back maybe he can look at it?  :nervous:

I said I'd take a look at it if you uploaded it in that previous thread :p. I'd be more than happy to do it :).
Title: Re: Modding Planets
Post by: Nuke on January 21, 2008, 04:58:36 pm
if i made some slight modifications to my atmo script, i bet i could make things orbit :D
Title: Re: Modding Planets
Post by: Getter Robo G on January 21, 2008, 05:10:28 pm
It's posted there for DL.

Title: Re: Modding Planets
Post by: jdjtcagle on January 21, 2008, 05:23:40 pm
It won't let me attach it but here's what it looks like

WIP  :nervous:

(http://img80.imageshack.us/img80/6994/planetema1.jpg)
Title: Re: Modding Planets
Post by: Herra Tohtori on January 21, 2008, 06:46:38 pm
Uh-oh. That's pretty messed up...

Okay, planets. Or backgrounds in general. There are two ways - the Retail way and the Better way. In Retail way, you need to use 256-colour (8-bit) PCX format, and on this case the colour (0,255,0) aka pure green will be interpreted as transparent (if you use the transparency mode in the table file, but more of that later). However, this has numerous downsides, the biggest of them being that you cannot blend things to transparency, since only pure green is transparent. This means that all the blended/aliased grey-green parts would be displayed as grey-green ugly mix and only the pure green parts of the image would show themselves transparent.

Now, the Better way, courtesy of friendly neighbourhood SCP coders, offers a lot more versatile way to use background textures, because it allows the use of 32-bit RGBA images, in either TGA or DDS format depending on which is better for the image in question. The inclusion of alpha channel allows you to blend things smoothly into transparency, which is a godsend with atmospheric glows, nebulae and other fancy schmancy stuff that are supposed to blend into transparency.

[There is a third way which is usable exclusively for nebulae, and that's additive blending, which uses black on the image as transparent and the transparency is defined by colour intensity of the image; these use just 24-bit RGB images without alpha channel. For planets though, that isn't really viable option since you hardly want the shadowed part of your planet to be transparent, do you? Now you don't, so let's get on with it... :p]

So, you'll need to put your planet, including it's atmosphere and the shadowed side, on a transparent layer and save as TGA. Once you get the TGA one working, you can then see if DDS compression can be used without damaging the gradient-rich atmosphere portion of the image too severely, but while you're working on it, get the TGA working first.

Your planet should look something like this:

(http://i28.tinypic.com/9898n6.png)

Save the image and open it in your image editing software of choice to compare with your planet.

---

As to how to actually make the game read the background, you need to make a newplanet-str.tbm modular table file, which tells to the game that there's new stuff to be used.

Make a mod folder called "newplanets" or whatever you like to call it on your Freespace2 directory (..\Freespace2\newplanets\). Then, create data directory on it. On it, create "tables" and "effects" -directories.

On the ..\Freespace2\newplanets\data\tables\ directory, create a new notepad document, type

Code: [Select]
$BitmapX: newplanet-01

#end

Then, save the file as newplanets-str.tbm (or in general, xxx-str.tbm, whatever you prefer to use as it's name; I suggest something descriptive :D)

This tells the game to find a transparency-blended background image called newplanet-01.* from the data used by the game. Now, you need to put the planet into the game with that filename. Simply save your ready alpha-blended planet to ..\Freespace2\newplanets\data\effects\ with filename newplanet-01.tga.

Now you will have that planet on your disposal when you start either FRED2_Open or FS2_Open with the command line -mod newplanets. To use a mod command line with FRED2_Open, create an icon to FRED2_Open, then open it's properties and add the appropriate command line options to the command line activated by the icon.
Title: Re: Modding Planets
Post by: Polpolion on January 21, 2008, 09:07:43 pm
It's posted there for DL.



:nervous: woops. I guess I stopped checking it after my school got back in session. I'll get to it ASAP. Dunno when ASAP will be, though, since it's finals week at my school.

EDIT: And I guess ASAP would be right now; so here we are: Take that, mediafire! (http://download201.mediafire.com/gqg1i995zmtg/5ce0v0ghzoo/earth.zip)
Title: Re: Modding Planets
Post by: jdjtcagle on January 21, 2008, 10:05:44 pm
IT WORKED!
Thank you so much, and tbm's are sooo useful, I've missed so much!

Last time I was here Tartisan(SP?) was Raa' Torh :p

(http://img223.imageshack.us/img223/197/itworkedok8.jpg)
Title: Re: Modding Planets
Post by: jdjtcagle on January 21, 2008, 11:25:56 pm
BTW, this is supposed to be the Fs2 Intro Deneb ;)