[Guide] GSB_1_ "Modding 101" Guide

But how the game knows that that package is relationed to a determinated mod? the “name” line must be the directory name (ie mod folder name), the race name used to make restriction or any reference to the mod OR instert option here???

As far as I’ve been able to discover, it doesn’t matter. All the game needs to know is that there is a package called “whatever” installed (not caring what is in the package). The installs files tell it where everything is.

It’s not the way I’d do things, but I didn’t write the game :slight_smile:

Gaahhhh, i hate to do things without knowing how it works… it leaves too many questions and theories in my so courious brain D:

Thanks anyways ^^

Just one more thing to note - the BlastGlare effect seems to be locked to the center of the cruiser and can’t be positioned elsewhere (unfortunately). BlastGlareSmall does not seem to suffer from this drawback.

Edit, I was responding to the post linked in the modding 101 thread, sorry for necro.

Fighter Hulk Sprites - Ever wondered how the game knows what to do when a fighter blows up - well wonder no more:

Looking at the Federation Falcon you have the following lines (in BLue)
[config]
classname = fighter
name = Federation Falcon Fighter
guiname = Federation Falcon Fighter Hull
sprite = Federation Falcon Fighter.dds
damagetexture = Federation Falcon Fighter_damaged.dds
hulktexture = federation_hulks.dds <-Which file has the hulks
hulkUVstart = 0 <-Where the hulks start
hulkUVend = 3 <-Where the hulks end
width = 11
height = 11
powerproduced = 3
cost = 44
racename = federation

So if we look at federation_hulks.dds:
(found in\Gratuitous Space Battles\data\bitmaps\ships\federation)
image

We can see the hulks are arranged in a 4x4 grid (yes the last row is blank)
So if we number them it would go like this

0 1 2 3
4 5 6 7
8 9 etc . .

So going back to the falcon fighter, when they die the game will randomly select from the locations 0,1,2 or 3

Disclaimer - as far as i am aware the game will split the hulk file into a 4x4 grid (total of 16)- so if you have 5 fighters and want to have 4 hulks for each, (total of 20 hulks) you will need to make a second hulk file. (see Unity for an example)

I have a tip for you when having to add the trails to any hull:

[size=120]How to add the trails to fighters[/size]

As everyone noticed, there is no way to add the engine trails to the fighters using the in-game editor, and taking in count the high number of fighter based ships in Praetorian Industries i was needing a solution, fast.

Then noticed something, the [runninglights] are easy to put and remove, and its even easier to read its code. Below, an example of it:

0 = 189.00,44.00,200.00,2.09,0

All what you need are the first two values, in this case 189.00 and 44.00, those are the x;y coordinates of the [runninglights].

To the point… you can use them as coordinate markers, how? Easy:

1> First open a fighter hull with the in-game editor.
2> Then select the running lights tab and create as many running lights as trails you want to add to the fighter. [size=85](Optional: Make the light pulse speed very high, enough to make it “always shown”, you will need it for step 10)[/size]
3> Then move each running light to each engine, be cautious with 2 things: First, if the ship is symetric, you need to be accurate. Second, DO NOT put the running light right behind the engine, put it INSIDE of it, the reason for this is that sometimes the game takes his time to show the trails, meaning that it may “appear” some pixels away from the fighter if you dont do that.
An example of a “contrail” without positioning fix: http://img26.imageshack.us/img26/9470/thunderboltrush.jpg
4> Save and close the game
5> Go to the fighter hull code and copy the whole [runninglights] section and rename it as [contrails]
6> Delete the unused values of every line, in our case “,200.00,2.09,0”
7> Then paste this code ( ,40,500,1.5,4 ) like right in the same place of the values that you deleted in step 6, it is the standard trail code.
8> With that you get the engine trails, the next steps are optional. If you dont want to follow the next steps, just delete the whole [runninglights] section.

Optional Procedures:

9> When you look at Praetorian Industries Fighters and Corvettes you can see that their engine trails have a nice starting effect, that is because i didn’t deleted the [runninglights]
10> Move the running lights to the end of each engine.
11> Resize them to your taste.

This may sound long, but after doing it the first time and figure it out you may find this VERY easy, doing this the fighter coding just took me a few days.

Just a small comment regarding radiation weapons - I discovered in the process of developing the Collective Heavy Disintegrator that the total_damage stat seems to do nothing - radiation damage seems to involve the radiation_damage value being dealt regularly in decaying amounts until the damage_duration expires.

I always considered it a little odd that there was redundancy there, the total damage can only be calculated one way. One question though, does total_damage limit the damage dealt at all? (i.e. it will deal the appropriate damage until damage_duration is over or until it exceeds total_damage.)

I think this was clarified somewhere, but that thread is probably buried deep somewhere.

Very deep indeed – these appear to be Cliff’s only substantial public words on this rather complex & obscure subject. Hopefully this will light a candle to lead the way.

Throwing this out to whoever wants to answer…

Has a guide to survival missions been compiled and put out here where everybody (at the moment, me) can benefit from it?

Another question for which neither reading nor searching seems to produce results: Has anyone covered the subject of pulse glows for ships (i.e., like the Order power generators) in at least basic detail? I understand why they aren’t covered in most of the “how to code your ships” topics - most ships don’t have them. Just wondering if there are details out there to be found (I tried a number of search terms that turned up a veritable cornucopia of nothing).

Not sure if it’s been written down anywhere, but here’s what I managed to learn from my own experiments.

Below is a typical example of a pulse glow entry:

0 = 128,128,512,900,fancy_glow.dds

-First number (to the left of the equal sign indicates the order of glows and is pretty much the same as any other type of entry.
-The next two numbers (128, 128 in this case) are the coordinates of the glow relative to the hull, where maximum width and height equal 256. In this case they’re dead center.
-The third number (512) is the size of the pulse glow. When set to 512 the pulse glow matches the size of the ship exactly, which makes it perfect for creating shifting patterns on ships or making energy entities. For a fun experiment, try creating a pulseglow using a ship’s normal texture as a glow and setting it to 1024. :slight_smile:
-The last number is the pulse interval in milliseconds. The default state is off so if set to a long interval, it will very slowly fade in and then out.
-The final bit is obviously your pulseglow texture. The size is in no way related to the numbers in the code. Just keep it in the usual ratio and pixel size (128x128, 512x512, 2048x2048 etc.) You can keep this in the ships folder for organization purposes.

When using pulse glows, bear in mind that:
-You can use more than one at a time, even in the same space.

  • They will overlap EVERYTHING else including turrets and damaged sections
  • Pulseglows occasionally flash white when the ship using them fires weapons
  • They don’t show up in unit creation or deployment screen. So have a placeholder or unsaturated texture if creating ships made of glows

Hopefully that’s all you need. :slight_smile:

Yup, that should cover it. Or at the least, give me enough knowledge to become truly self-dangerous. :wink:

Oh you evil person. You really have to stop giving me ideas, of the full release of te Matmos Rift will never be ready!

I’ve discovered a little more about fighter contrails to add to Praetors’ analysis.

Since I don’t have the addition of the in-game hull editing feature on a mac, I’ve figured out the following:

[contrails] (Order Acolyte Fighter) 0 = 166,213,40,500,1.5,4

Above is the coding for the order’s Acolyte Fighter (a.k.a. the default). Below is the coding for the explanation.

0 = X, Y, a, b, c, d

ship = Uglies Defiance Fighter

Default Contrail

X = X coordinate for the location of the contrail based on a 256x256 square. It might help to open up a ship.dds and scale it down. Or you can take the full size (512x512) and divide by 2.

Y = Y coordinate for the location of the contrail based on a 256x256 square.

a = Seems to control the stretching of the “contrail” image or something. At a = 10, it is “skippy” in animation and there is no dissipating trail to be had. At a = 100, the contrail looks like the default but somehow seems even longer and opaque. Default is the best here.

a = 10

a = 100

b = Controls the length of the contrail. At b = 100, it is rather short. At b = 1000, it is very long and is “skippy.”

b = 100

b = 1000

c = Controls the width of the contrail. At c = 0.25, it is thin and wispy. At c = 4, it is very awesomely wide.

c = 0.25

c = 4

d = Hmm…not sure what this does. Leave it at the default. at d = 1 and d = 10 the contrail seems to have not changed much at all.

d = 1

d = 10

It seems that values X, Y, b, c are the ones you want to mod. It might be best to leave the others (a and d) alone.

Final coding:

0 = 128,221,40,150,2,4

OMG such a great guide man!! Incredibly useful!! If i find time to deal with the PI Mod 1.1 Patch i will apply the new shinny knowings about contrails that you have added to my brain =D

Another rather odd question; some searching of the forums failed to produce a definitive answer. Does anyone know if (and if so, how) the visual texture of a smart-bomb module can be changed? Looking at the Swarm Smart Bomb module code, I don’t see a “texture =” line or anything similar. Help would be appreciated. :slight_smile:

Sadly, there is no way to change the texture of the Swarmy Smart Bomb, its hardcoded.
Also, i think that call it “texture” is wrong, cuz AFAIK its a fully animated shockwave, i wonder how it works… xD

Well I call it “texture” because there’s a 512X512 sprite called “smartbomb_texture” that shows the greeny-blue pattern (plus a “smartbomb_alpha” that has the circular shockwave). That’s crummy, though. Especially since it means to use a smart bomb module, one must have the Swarm installed. I was hoping to avoid that. Maybe a slight reconception is in order for a module or two…

Actually, you can replace the smart bomb texture without modifying the original files. It will however change appearance of the Swarm Smart Bomb as well to the texture you make. As long as you have smartbomb_alpha.dds and smartbomb_texture.dds in your mod’s bitmaps folder. Alpha is simply a white pattern that is overlaid with the texture pattern in the second file.

Here’s an example of a modified smart bomb:

Okay, time for another silly question that doesn’t quite get answered elsewhere.

Turrets. For the big 8X8 grid of turrets, does the image have to be a power of 2 (256X256, 512X512 etc.) or will any old square file work as long as the turrets are correctly placed along the 8X8 grid? Has anyone tried using a mapping file that wasn’t a power of 2?