[Guide] GSB Modding 101

Welcome to the shipyards. Here you can discuss how to re-calibrate the positronic neutron flow to double power to the aft shields. Or you can discuss how to add new ships, new maps, new scenarios, new modules, etc. have fun!
User avatar
Praetors
Supreme Robot
Supreme Robot
Posts: 1820
Joined: Sat Oct 02, 2010 2:27 am
Location: In a Patrol mission at Argena Prime.
Contact:

Re: [Guide] GSB Modding 101

Postby Praetors » Fri Dec 23, 2011 9:03 pm

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*???????
PI: positech.co.uk/forums/phpBB3/viewtopic.php?f=23&t=5698
TP: positech.co.uk/forums/phpBB3/viewtopic.php?f=23&t=6928
TG: positech.co.uk/forums/phpBB3/viewtopic.php?f=23&t=7659

Engineer of the Friendly Community Mod Squad.
User avatar
Kemp
Supreme Robot
Supreme Robot
Posts: 528
Joined: Fri Dec 03, 2010 10:21 pm
Contact:

Re: [Guide] GSB Modding 101

Postby Kemp » Fri Dec 23, 2011 9:44 pm

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 :)
GSBEdit - http://positech.co.uk/forums/phpBB3/viewtopic.php?f=23&t=6121
Restricted Vanilla Modules - http://positech.co.uk/forums/phpBB3/viewtopic.php?f=23&t=6230 (obsolete)
User avatar
Praetors
Supreme Robot
Supreme Robot
Posts: 1820
Joined: Sat Oct 02, 2010 2:27 am
Location: In a Patrol mission at Argena Prime.
Contact:

Re: [Guide] GSB Modding 101

Postby Praetors » Fri Dec 23, 2011 10:03 pm

Kemp wrote: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 :)


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 ^^
PI: positech.co.uk/forums/phpBB3/viewtopic.php?f=23&t=5698
TP: positech.co.uk/forums/phpBB3/viewtopic.php?f=23&t=6928
TG: positech.co.uk/forums/phpBB3/viewtopic.php?f=23&t=7659

Engineer of the Friendly Community Mod Squad.
User avatar
Tohron
Type II Robot
Type II Robot
Posts: 69
Joined: Thu Nov 11, 2010 3:24 pm

Re: Question: coordinate system for placing modules, etc.

Postby Tohron » Mon Jan 30, 2012 12:01 am

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.
User avatar
darkstar076
Supreme Robot
Supreme Robot
Posts: 2200
Joined: Sun Feb 28, 2010 2:14 am
Location: Lurking somewhere in the Forum

Re: [Guide] GSB Modding 101

Postby darkstar076 » Mon Jan 30, 2012 10:11 am

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)
federation_hulks copy.png
Where fighters go to die
federation_hulks copy.png (8.48 KiB) Viewed 6879 times


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)
Wisdom is something you generally obtain around three seconds after you needed it the most
-=Modding Guru & Egon Spengler of the Friendly Community Mod Squad=-
User avatar
Praetors
Supreme Robot
Supreme Robot
Posts: 1820
Joined: Sat Oct 02, 2010 2:27 am
Location: In a Patrol mission at Argena Prime.
Contact:

Re: [Guide] GSB Modding 101

Postby Praetors » Mon Jan 30, 2012 10:46 am

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

How to add the trails to fighters

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. (Optional: Make the light pulse speed very high, enough to make it "always shown", you will need it for step 10)
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.
PI: positech.co.uk/forums/phpBB3/viewtopic.php?f=23&t=5698
TP: positech.co.uk/forums/phpBB3/viewtopic.php?f=23&t=6928
TG: positech.co.uk/forums/phpBB3/viewtopic.php?f=23&t=7659

Engineer of the Friendly Community Mod Squad.
User avatar
Tohron
Type II Robot
Type II Robot
Posts: 69
Joined: Thu Nov 11, 2010 3:24 pm

Re: [Guide] GSB Modding 101

Postby Tohron » Mon Jan 30, 2012 4:14 pm

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.
User avatar
Kemp
Supreme Robot
Supreme Robot
Posts: 528
Joined: Fri Dec 03, 2010 10:21 pm
Contact:

Re: [Guide] GSB Modding 101

Postby Kemp » Mon Jan 30, 2012 11:31 pm

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.
GSBEdit - http://positech.co.uk/forums/phpBB3/viewtopic.php?f=23&t=6121
Restricted Vanilla Modules - http://positech.co.uk/forums/phpBB3/viewtopic.php?f=23&t=6230 (obsolete)
User avatar
Archduke Astro
Positech Staff
Positech Staff
Posts: 1654
Joined: Sun Aug 30, 2009 10:09 pm
Location: Building The Future.

Re: [Guide] GSB Modding 101

Postby Archduke Astro » Mon Jan 30, 2012 11:41 pm

Kemp wrote: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.
.
•• Positech Global Moderator & Forum Sheriff ••
GSB "Combined-Arms Combat" Advocate & Analyst
Enemy of Forum Lulz | Defender of Faction Diversity

∞∆……CURATOR OF CREATIVE CONCEPTS for GSB's Friendly Community Mod Squad……∆∞
User avatar
AcePalarum
Supreme Robot
Supreme Robot
Posts: 1132
Joined: Tue Dec 29, 2009 8:57 pm
Location: Lurking Right Behind You

Re: [Guide] GSB Modding 101

Postby AcePalarum » Sat Mar 31, 2012 5:52 pm

darkstar076 wrote:It should jog his memory to find the indepth guide to survival missions i wrote him . .


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?
While my ability to succeed is finite, my capacity for failure knows no bounds.
*Basement Tinkerer and OCD Savant of the Friendly Community Mod Squad*

Mods: Matmos Rift, Antares Expanse, Great Powers Stations
User avatar
AcePalarum
Supreme Robot
Supreme Robot
Posts: 1132
Joined: Tue Dec 29, 2009 8:57 pm
Location: Lurking Right Behind You

Re: [Guide] GSB Modding 101

Postby AcePalarum » Tue Apr 03, 2012 5:58 pm

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).
While my ability to succeed is finite, my capacity for failure knows no bounds.
*Basement Tinkerer and OCD Savant of the Friendly Community Mod Squad*

Mods: Matmos Rift, Antares Expanse, Great Powers Stations
User avatar
Dantalion
Supreme Robot
Supreme Robot
Posts: 226
Joined: Thu Nov 26, 2009 7:57 pm

Re: [Guide] GSB Modding 101

Postby Dantalion » Tue Apr 03, 2012 8:18 pm

AcePalarum wrote: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:

Code: Select all

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. :)
-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. :)
User avatar
AcePalarum
Supreme Robot
Supreme Robot
Posts: 1132
Joined: Tue Dec 29, 2009 8:57 pm
Location: Lurking Right Behind You

Re: [Guide] GSB Modding 101

Postby AcePalarum » Wed Apr 04, 2012 12:12 am

Dantalion wrote:Hopefully that's all you need. :)


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

Dantalion wrote:For a fun experiment, try creating a pulseglow using a ship's normal texture as a glow and setting it to 1024. :)


Oh you evil person. You really have to stop giving me ideas, of the full release of te Matmos Rift will never be ready!
While my ability to succeed is finite, my capacity for failure knows no bounds.
*Basement Tinkerer and OCD Savant of the Friendly Community Mod Squad*

Mods: Matmos Rift, Antares Expanse, Great Powers Stations
User avatar
BowlNwhsprer
Supreme Robot
Supreme Robot
Posts: 125
Joined: Thu Mar 03, 2011 7:19 am
Location: US, Hawai'i, O'ahu, Mililani

Re: [Guide] GSB Modding 101

Postby BowlNwhsprer » Thu Apr 05, 2012 3:41 am

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:

Code: Select all

[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.

Code: Select all

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


ship = Uglies Defiance Fighter

Default Contrail
Image

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
Image
a = 100
Image

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
Image
b = 1000
Image

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
Image
c = 4
Image

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
Image
d = 10
Image

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:

Code: Select all

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


Image
"Remember, the enemy's gate is down." ~ Andrew "Ender" Wiggin from Orson Scott Card's "Ender's Game"
User avatar
Praetors
Supreme Robot
Supreme Robot
Posts: 1820
Joined: Sat Oct 02, 2010 2:27 am
Location: In a Patrol mission at Argena Prime.
Contact:

Re: [Guide] GSB Modding 101

Postby Praetors » Fri Apr 06, 2012 11:34 pm

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
PI: positech.co.uk/forums/phpBB3/viewtopic.php?f=23&t=5698
TP: positech.co.uk/forums/phpBB3/viewtopic.php?f=23&t=6928
TG: positech.co.uk/forums/phpBB3/viewtopic.php?f=23&t=7659

Engineer of the Friendly Community Mod Squad.

Return to “Gratuitous Modding”

Who is online

Users browsing this forum: No registered users and 5 guests