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

[Guide] GSB Modding 101

Postby darkstar076 » Fri Aug 20, 2010 2:43 am

"Give a man a mod - and he plays for the day . .
    . .Teach a man to mod - and he plays for a lifetime"

Throughout the GSB forum there are various posts on the "how to" of modding GSB files. I thought it would be a good idea to create a collection for all the the budding modders.

I invite anyone out there to post their own guide (or a link to a guide) on how to mod GSB.
Last edited by darkstar076 on Fri Aug 20, 2010 8:47 am, edited 2 times in total.
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
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 » Fri Aug 20, 2010 2:43 am

Making your own hulls for GSB:
This thread gives you an idea on how to get a ship into the game
viewtopic.php?f=23&t=2905&start=0


Editing the text file for your new ship:
viewtopic.php?f=23&t=4783&p=29938#p29938
SirJamon wrote:

Code: Select all

[b]Running lights:[/b]
Basically the running light effect consists in the light sprite starting at a certain size and increasing its size depending on its 'grow rate' until it reaches a maximum size where it srinks to the original size. Then starts growing again. At low 'grow rate' you'll see a 'blinking' effect.

[runninglights]
0 = x,y,gr,ms,lc

Where:
x -> x coordinate
y -> y coordinate (x,y coordinates are relative to a 256x256 sprite)
gr -> 'Grow Rate' (The rate at which this light will 'grow', big numbers are equal to slow 'growing' speeds)
ms -> Max Size (The maximum size the light will reach)
lc -> Light Color (0=greeen, 1=red, 2=purple, 3=white)
The color is picked from the sprite runninglights.dds under the ..\data\bitmaps\fx folder

Example: 0 = 59.00,171.00,200.00,4.00,1

[b]Now the Targets:[/b]
Here you determine the place where your ship will be hit and the changes in the sprite when the ship is damaged (the changes are picked from the ship_damaged.dds sprite). Also you can add spark and smoke effects when certain parts are hit.

[targets]
0 = x,y,ee,ed,ds,
1 = x,y,ee,1,ds,(damage_sprite_effect-x-y),
2 = x,y,1,ed,ds,SHIP_EMMITER_EFFECT,

Those are 3 examples of diferent types of targets where:
x -> x coordinate
y -> y coordinate (x,y coordinates are relative to a 256x256 sprite)
ee -> Enables ship Emmiter effect (0 disabled, 1 enabled) CAUTION!!! if its disabled and there's a SHIP_EMMITER_EFFECT the game will crash
ed -> Enable Damage effect (0 means there won't be any change in the hull sprite and 1 means that there will be a change in the hull sprite determined by the ds valor you enter)
ds -> Damage Square (aka damage box) (It determines the part of the ship that will be changed with its corresponding damaged img. Its represented as xi,yi,xf,yf [Top-Left x,y coordinates of the box and Bottom-Right x,y coordinates of the box])
SHIP_EMMITER_EFFECT -> Okay I haven't tested with this enough to know surely what it does
 - Can be one of the following:
   · SHIP_EMMITER_LARGE
   · SHIP_EMMITER_THIN
damage_sprite_effect -> Effect that appears alongside with the damage effect in the determined position. It doesn't work if Damage effect is disabled
 - Can be one of the following:
   · damage_sprite_sparks
   · damage_sprite_smoke

Examples:
0 = 187.50,164.50,0,1,170.00,150.50,194.50,227.00,
1 = 99.00,88.00,0,0,
2 = 133.00,114.00,0,1,125.00,102.00,141.00,126.00,(damage_sprite_sparks-133.00-114.00),(damage_sprite_smoke-133.00-116.00),
3 = 99.50,186.00,1,1,88.00,172.00,111.00,200.00,SHIP_EMMITER_THIN,

All the examples are from the vanilla gsb ships.

I don't know if this helps, if there's something you don't understand post it here. Also if any other gsb modder sees this would be nice if he can check if this is correctly explained.



When your ship explodes:
SirJamon has written an excellent explosion guide - it also highlights traps for modders.
The original post can be found here - viewtopic.php?f=23&t=5067&view=unread#p32997

Here is a summary:

Code: Select all

[explosions]       //Here we determine the ship explosion sequence shown
**BUG ALERT!!! If there isn't any explosion the ship is never destroyed, then the battle never ends**
- Always, when ends the sequence of ship destruction, there's a shockwave from the center of the ship & some smoke
- Explosions sizes are relative to the ship size
- Each explosion generates 1 escape pod (except for fighters and STARTBREAKUP)

The line format looks like this
0 = t,x,y,EXP_?????

- 0 = index number (0,1,2,etc . . )
- x = Part of the coordinated to locate where the explosion occurs (0 - 256)
- y = Other part of the coordinate to locate where the explosion occurs  (0 - 256)
- t = Timer (Determines in ms how much time will last after the ship destruction for this effect to happen
- EXP_?????-> Explosion effect when ship is destroyed [i]**????? is replaced by the following names for different desired effects:[/i]
     - STARTBREAKUP (This determines when the ship will break and change its img to the hulk img. x,y are useless here so they can be 0,0) **ALERT!!! THIS EFFECT MUSTN'T BE THE LAST OF THE EXPLOSION CHAIN (Indestructible bug)**
     - FRIGATE (Medium explosion)
     - ANGLED_DEBRIS (Large debris blast)
     - DESTRUCTION_PLACED (A few debris)
     - FRIGATEBREAKUP (Medium expanded explosion)
     - CRUISERDEBRIS (Some debris)
     - FRIGATEDEBRIS (Small debris)
     - PLUMES (Fragments large explosion)
     - BLASTGLARE (White blast)
     - BLASTGLARESMALL (Small white blast)
     - CRUISER_PLUMECENTER
     - SPARKBURST 
     - FIGHTER_DESTROYED_LOD
     - FIGHTER_DESTROYED




Creating Damage Textures on Hulls:
Cliffski has posted a really rough guide for anyone wanting a similar 'look' to the current damage textures on their ships
How The Damage Textures Were Done

Other Damage guides
Damage overlays of Awesomeness
Damage Underlays and Tutorial, Image Heavy




Fighter Sprites:
These ships are put together a little differently then the other two types of ships. I have highlighted the differences below.
------------------------------------------------------------------------------------------------------------------------
In the configuration file there are two main differences when turing your sprite into a playable ship:
Damage & Hulk.

Looking at the Federation Falcon you have the following lines
[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
hulkUVstart = 0
hulkUVend = 3
width = 11
height = 11
powerproduced = 3
cost = 44
racename = federation
...
...
..

------------------------------------------------------------------------------------------------------------------------
::Modders' Note::
To avoid a ship that looks like it is being affected by gravity (stretched), keep the width and height the same.
------------------------------------------------------------------------------------------------------------------------

Damage:
You will notice that the damagetexture file has an _damaged at the end of it like frigates and cruiser. However when we navigate to where the hull file is kept you will only see these two files:
(found in\Gratuitous Space Battles\data\bitmaps\ships\federation\Federation Falcon Fighter)
Federation Falcon Fighter.dds
Federation Falcon Fighter_sprite.dds

The _sprite.dds file provides the damaged look for the ship. It is a combination of the Hull sprite and the Damage sprite placed side by side in the same image.
Image

NOTE: It is important to have the name of the Hull file and the _sprite file the same. So when your endering the line damage texture copy/paste your file name in and replace _sprite with _damaged and you can avoid that annoying "white square" error.

------------------------------------------------------------------------------------------------------------------------
::Modders' Note::
Now, when you combine your Hull and Damage file to create the _sprite file, keep the damage file with the others. It will prove useful when you use the Hull Editor to place the damage on the ship. (You can do the same for hulks but you then have to rename the hulk texture to your fighter hulk map)
------------------------------------------------------------------------------------------------------------------------

Hulk:
With Cruisers and Frigates, you have a unique hulk file thich the game will generate leaving various peices of the wreckage to twist and turn independantly. With fighters the hulk is one complete image however you can have multiple hulk images to be randomly choosen by the game. The random selection of fighter hulks is controled with the following code:

hulktexture = federation_hulks.dds <-Which file has the hulks
hulkUVstart = 0 <-Where the hulks start
hulkUVend = 3 <-Where the hulks end

This tells the game that when the fighter goes kaboom, choose a image between the start and end numbers and display that image as the chared remains on screen. (In this case when they die the game will randomly select from the locations 0,1,2 or 3 in the federation_hulks.dds file)

So you desire, you can have several hulk images for a single fighter if you desire. AFAIK - this image is static, there is no way to make it twist and turn like frigates and cruisers.) If you want (and you have the time) each fighter have its own fighter hulk maps so you can have multiple ways (max of 16) for each fighter to meet its demise.

So lets have a look at the federation_hulks.dds:
(found in\Gratuitous Space Battles\data\bitmaps\ships\federation)

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

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

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.

------------------------------------------------------------------------------------------------------------------------
::Modders' Note::
The naming of sprites, textures and hulks is CASE SENSITIVE. Be careful when entering them into the config file. One way to avoid errors is to use "copy" and "paste".
------------------------------------------------------------------------------------------------------------------------
Last edited by darkstar076 on Tue Sep 28, 2010 6:43 am, edited 10 times in total.
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
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 » Fri Aug 20, 2010 2:45 am

Scenario Editing Tips:
viewtopic.php?f=23&t=2985#p15246


Modifying the Shaders for a Scenario:
viewtopic.php?f=23&t=5225&start=0


How to make a campaign map for use within Galactic Conquest:
Props to ekalin for posting this comprehensive guide.
----------------------------------------------------------------------------------------------------------------

Hi, here is everything I know. I will use "../gratuitous space battles/" to denote the root folder where the game is located on your machine.

In order to build your own campaign map the very least you will need to do is define a campaign map configuration file in "../gratuitous space battles/campaign/maps/", and planet configuration files (one for each planet you want on your map) anywhere in "../gratuitous space battles/".

Campaign Map Configuration

Your map's configuration file should be a .txt file in "..gratuitous space battles/campaign/maps/". It should contain two sections: config and encounters. I'll try and describe every field you must define each section.

[config]

Homeworld: This is the encounter ID of the planet that will serve as the homeworld (the starting planet for the player)
MapSizeX: This defines the width of your map.
MapSizeY: This defines the height of your map. You do not need to be afraid about exceeding a player's resolution. If the map is large then GSB will let you scroll the map.

Name: This is the internal name for your campaign map, it should be unique.
GUIName: This is the name of your campaign map as shown to the user.
MapTexture: This is a file in "../gratuitous space battles/campaign/data/bitmaps/ui/". It is the background for your campaign map. It will be stretched/shrunk according to the player's resolution. There is no need to match the dimensions of the MapTexture to your MapSizeX/MapSizeY values.

[encounters]

This is a list of file paths for your planet configuration files. Say you only had three planets in your map, then your encounters list would look something like this:

Code: Select all

0 = campaign/data/path/to/planets/planet1.txt
1 = campaign/data/path/to/planets/planet2.txt
2 = campaign/data/path/to/planets/planet3.txt

Planet configuration files should exist anywhere in "../gratuitous space battles/" (including its subdirectories).

Planet Configuration
There are five sections possible: config, terrain, variables, facilities, and hopcounts.

[config]

MapPosition.X: A number between 0 and 1 inclusive. Determines the position of your planet along the x-axis.
MapPosition.Y: A number between 0 and 1 inclusive. Determines the position of your planet along the y-axis.

The top left corner of your map is the origin and will always have the coordinates 0,0. The higher the Y coordinate, the lower the planet will appear on the map. The higher the X coordinate, the farther right the planet will appear. Examples: 1,1 is the bottom right corner of map; 0.5, 0.5 is the exact center of map.

EncounterID: This is a number that will be used to identify this planet internally. It should be unique.
wormholes: A list of encounter IDs (separated by commas) of planets you can travel to
backdrop: This is the backdrop that is shown during a battle at the planet, the file must be in "..gratuitous space battles/campaign/data/bitmaps/backdrops/"

icon: This is the graphic used to display the planet on the map. It must be a file in "..gratuitous space battles/campaign/data/bitmaps/planets/"

name: Internal name. Probably should be unique, but I don't know for sure.
guiname: This is the name displayed to the user. It can be different then the name field.

starfield = I think this is the flag to toggle background stars when in battle. 0 turns the starfield off, 1 turns it on.
mapiconsize = This is the size of this planet's icon on the map. The larger the number, the bigger the planet on the map.
enemyfleetcost = The higher the number, the larger an enemy fleet can be when attacking this planet (perhaps others can shed light on this)

shader = This is optional. You can add a shader to give your planet a different look. The file must exist somewhere in "../gratuitous space battles/campaign/". The default shaders are all in "../gratuitous space battles/campaign/data/shaders/".

[terrain]

You need to define one cryptic little line under this section. Here is an example of what it could look like:

Code: Select all

0 = 654,367,1.0,spindle_planet1.dds,0,0,0,1.0,1.0,662,662,0,1

Start the field with a '0 =' and give 13 parameters separated by commas. All I know for sure is:
  • the first two parameters are the X,Y location of the planet image in pixels
  • the 4th parameter is the planet image to display in the background during battle. Typically this should be the same as what you set as 'icon' in [config]
  • the 10th and 11th are the width and height of the planet image respectively
The rest of the parameters appear to be always the same values in every planet's configuration. Perhaps someone could add to this?

[variables]

This section is optional. It is used to define planetary anomalies. Here are some examples you can use:

Code: Select all

WEAPON_RANGE_MULTIPLIER,0.75
WEAPON_RANGE_MULTIPLIER,0.50
SHIELD_STRENGTH_MULTIPLIER,0.25
ENGINE_SPEED_MULTIPLIER,0.50
FIGHTERS_INOPERABLE
FRIGATES_INOPERABLE
CRUISERS_INOPERABLE
SHIELDS_INOPERABLE
REPAIR_INOPERABLE
CLOAK_INOPERABLE
TRACTOR_INOPERABLE

'Multiplier' variables above have an extra parameter after them. This is a number between 0 and 1 inclusive.

[facilities]

This section is also optional. It is a list of all facilities on your planet. If I wanted to add a small factory and academy to my planet I would add this under
[facilities]:

Code: Select all

0 = smallfactory
1 = smallacademy

Here is a list of the IDs of all (default) facilities for your convenience:

Code: Select all

largeacademy
largefactory
mediumfactory
repairyard
shipyarda
shipyardb
shipyardc
smallacademy
smallfactory

And yes, it is possible to add custom facilities.

[hopcounts]

Used to defines the distances between planets. A typical list may look like this:

Code: Select all

0 = 96,8
1 = 95,7
2 = 94,6

The number before the '=' character is for ordering the list (start at 0 and increment by 1 as you add more hopcount entries). The first number after '=' is the encounter ID of a planet. The second number after '=' is the number of warps or hops it would take to get from this planet to the planet with the same encounter ID you. So this:

Code: Select all

0 = 96,8

would mean that it would take 8 hops to get to the planet with encounter id 96 from here. I remember reading somewhere that hopcounts are used in calculating the spread of "fear" between planets.

END OF KNOWLEDGE

If anyone sees any errors above or if there is anything confusing let me know.

For large maps, editing these configuration files is tedious (and painful). In order to create Atellian Expanse, I had to create my own campaign map editor to remove most of the difficulty. I have not made this editor public yet (it's not done), though if you are still interested in building maps I am willing to send you the current version for you to use. You would also be helping me out in testing it before I release it to the community.
Last edited by darkstar076 on Mon Aug 23, 2010 12:44 am, edited 3 times in total.
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
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 » Fri Aug 20, 2010 2:46 am

A quick breakdown of the file "race.txt" -
very useful to know if your creating your own race.


In this case i will use my Uni-T mod race as an example :)

[config]
name = "unit" <- Unique name of the race. This name will be used by the code to link other modules and hulls
guiname = "Uni-T" <- this is the name that the player will see in the game
logo = "unit.jpg" <- What picture will be displayed when the player looks at your race in the selection screen
debrisstartuv = 0 <- as your ship is shot, it will shead parts. This is the start of the range
debrisenduv = 31 <- this is the end of the range for debris graphics id
escapepodid = 1 <- when you ship is destroyed, use this escape pod graphic id (0-3)
shield = "Corrupt_shield.dds" <- if you have shields, use this graphics file to show them
description = ""Uni-T is a collective, ..." <- a description of the race you have created
repairbotid = 3 <- When little bots are repairing your ship, use this graphic id (0-3)
contrailid = 3 <- as your fighters zoom around the screen, they leave coloured trails, use this graphic id (0-3)
music = unit_battle.ogg <- when your fighting against this race, play this music
shieldcollapseuv = 3 <- as your shields collape, use this graphic id (0-3)
defaultnames = warships <- when your placing ships on the deploy screen, refer to this file to retireve a name
guiid = 10 <- The order in which your race will appear in the race selection menu
lockable = 1 <- is this race locked (0 = no / 1 = yes)
unlockcost = 1500 <- if locked, how much honor to unlock it
unlock_texture = "Dominator Core.dds" <- in fleet HQ, display this image to represent the race

[turrets] - this area is dedicated to the turret mapping. it is covered in another tutorial further down
turret_auto_v1 = unit_turret_auto_v1.dds,turrets_unit.dds,0
...
...
...
turret_ecm_v1 = unit_turret_las_v5.dds,turrets_unit.dds,16

[victory_messages] - if you win with this race, display one of these messages.
0 = "This sector has been cleansed of garbage, continue the sweep"
1 = "No garbage detected, sector clear"
2 = "We are Uni-T, refuse is futile"

[defeat_messages] - if you lose with this race, display one of these messages.
1 = "We are Uni-T but you are defective, report to recycling"
2 = "The directive was clear, dispose of the garbage, is your programming defective ?"
3 = "You have failed, you will be cleansed!"

[crew] - in the comms chatter box, use this names.
0 = "Drone-OMGWTF"
1 = "Drone-001010"
...
...
...

---------------------------------------------------------------------------------------------------------------------------

Ship Modules:
Here is a quick A-Z of the variables you will find in the module files:
(and what I think they mean - if i have made a mistake, let me know so i can fix it)

Code: Select all

armour_penetration - The amount of armor that the weapon can penetrate (if armor of target is higher, the weapon is not effective)
beam_duration - How long the beam is drawn on the screen (in milli seconds - ie 1000 = 1 second)
beam_texture - the dds file used to draw the beam between the target and the turret
beam_width - how wide the beam is
beampower - the size of the capacitor for the tractor beam
beamweight - the amount of weight applied by the tractor beam
blasttexture - the dds file used to draw the turret muzzle flare
category - what group the module will appear in (Weapons,Defense,Engines,Other)
classname - which type of module you are using and there are many:
- SIM_ArmourModule
- SIM_BeamWeaponModule
- SIM_BulletWeaponModule
- SIM_CamoflageShieldModule
- SIM_CarrierModule
- SIM_ECMBeamModule
- SIM_ECMShieldModule
- SIM_ECMShockModule
- SIM_EngineModule
- SIM_KineticWeapon
- SIM_LightningGunModule
- SIM_LimpetLauncher
- SIM_MissileModule
- SIM_PDScannerModule
- SIM_PlasmaLauncherModule
- SIM_PointDefenseModule
- SIM_PowerModule
- SIM_RepairModule
- SIM_ShieldModule
- SIM_SmartBombModule
- SIM_TargetBoosterModule
- SIM_TargetPainterModule
- SIM_TractorModule
cloak_consumptionrate - How quickly the cloak drains the power
cloak_rechargerate - how quickly the cloak regains power
color - Only used in SIM_BulletWeaponModule and can only have a value of 0 to 8
convergence - Used for when you want your beams to join forces (only works on turrets with multi hard points)
cost - how much money you need to have that weapon on the ship
crew_required - Number of crew needed to operate the module.
damage - How much hurt the module does when it penetrates the shield / armour
damage_duration - used for radiation weapons, how long the target is effected by radiation
description - Used in the ship build screen, its is used to tell the player what the module is and what it does.
drift_decelleration - How quickly a limpet slows down
ecm_strength - How strong the ecm is for beams/missiles - how much the module can withstand for ECM shields.
end_launch_speed - How fast the limpet travels
fire_interval - how often the module fires (in milli seconds - ie 1000 = 1 second)
firedelay - how long it takes for the beams to join and reach its target.
flareuvid - chooses the colour of the glowy blob over the missile value between 0 - 3
flaresize' (default 16) - the size of flare drawn on the missile
fuel - how long the missile / plasma will go for.
grain - the dds file that provides a overlay pattern for the beam
guiname - used in the ship build screen, its the name of the module
has_decoys - does the missile break into 4 separate missiles
has_flare - does the missile have a glowy blow drawn over it
has_grain - Does the beam have a pattern drawn over it
has_splines - does the missile travel along a spline path with a smoke trail
height - used to change how tall the bullet is
hitpoints - how much damage the module can take before destruction
icon - for weapons its "turret" for everything else its the dds file that has a picture of the module. Unless you have a specific icon for your weapon that you want to use :)
launch_duration - How long it takes for the limpet to slow down after launch
limpet_weight - how much weight the limpet adds to the target once attached
limpetsize - how big the limpet is drawn ingame
lockable - can this module be used right away or do you have to earn it
max_cloak_power - maximum power capacity of the cloak
max_range - maximum range that the module is effective
max_seek_speed - the top speed of the limpet when chasing a target
maxdamageabsorbable - how much damage the armour can take
maxrepairsupplies - how much damage the module can repair
min_range - the minimum range that the module is effective
missilelength - how long the missile is
missilewidth - how wide the missile is
name - the Unique name of the module, used by the code, not seen by the player.
num_submunitions' (max 6) - The number of warheads that missile will break into at decoy release range
optimum_range - the range when the module inflicts the most damage
payload - When your bullet hits the target, what type of damage can it do (at the moment its only RADIATION)
peace_interval - the minimum time for the module not to be under attack to activate.
powerconsumed - how much power the module needs to operate
powerproduced - how much power the module produces
powerrecharge - how quickly the tractor beam capacitor recharges
powerusage - how much power the tractor beam uses from the capacitor per cycle
radiation_damage - the initail amount of damage done by radiation
radiation_decay - how quickly the radiation damage falls off
range - how far the tractor beam can reach
recharge_rate - how quickly the shields can recharge after being damaged
repair_rate - how quickly the module can repair damage per second
repair_type - used if you want a repair module to focus on one aspect (at the moment its only armor)
resistance - how much the shield can reflect or the level of shield penetration required to cause damage
restricted - is this module only for one race
salvo_interval - length of time between volleys
salvo_size - how may shots in a volley
sb_trigger_percentage - the chance that the smart bomb will detonate the missile
scanner_accuracy - how well a module can determine the difference between a decoy and the warhead
seek_acceleration - how fast the limpet accelerates towards a target
seek_range - how far the limpet will look for a target
shield_penetration - The level of shield that the weapon can penetrate (if shield resistance of target is higher, the weapon is not effective)
shieldpoints - the amount of hitpoint the shield has
shock_duration - how long the ECM is in effect on the target ship (in milliseconds 1000 = 1 second)
size - what class of ship is the module fore (Fighter, frigate or cruiser)
slot_type - What type of module is it Standard or Turret
sound - what ogg sound file to play make when it fires.
soundvolume - controls the volume of the sound file
speed  - how fast the projectile moves
spritesize - how big to draw the sprite used for plasma weapons
stack_effectiveness - When you have more than one of the module, the performance will change by x%
start_launch_speed  - how fast the limpet is when launched
style - used in the PlasmaLauncherModule, you can switch between the 2 types FRAGMENTED & STANDARD
submunitionslive - used to make the decoys do damage
targetboost - how much faster to other modules track a target
texture - the dds file used to span between the turret and target
thrust - the amount of force generated by the module to move the ship
total_damage - the total amount of damage done by the radiation
tracking_speed - the turning spead of the module, the faster the module turns the better chance of hitting fast targets
trail_fade_time - time it takes for the missile trail to fade
turn speed - how quickly the missile / limpet can turn.
turret_sprite - a refence used by turret mapping which is found in the race file.  Determins the icon and sprite used in the game
turretsize - size of the turret in the game.
uisortpos - User Interface Sort Position.  Where about on the module list does it appear
unlockcost - how much honour do you need to unlock this module
warhead -  determines what type of damage the missile does (ECMSHOCK, RADIATION, DUMMY, EXPLOSION)
weight - how heavy is the module
width - how wide is the bullet / projectile
capacitorsize - Maximum amount of shield energy the unit can hold
ssb_beamrate - The quantity of shield energy beamed over to the target per pulse
mincaptodischarge - if the shield energy is below this number then it will not fire.
ssb_rechargerate = How much shield energy the unit creates per second
pulseduration = the amount of time between pulses of transfering shield energy.


---------------------------------------------------------------------------------------------------------------------------

A quick guide on how a beam effect graphics file works
1) The blast effect is placed at the start of the turret
2) The main beam effect is stretched from the turret to the target
3) The grain section is repeatedly placed along the effects (without stretching) back to back
beam_guide.jpg
beam_guide.jpg (8.51 KiB) Viewed 33114 times


---------------------------------------------------------------------------------------------------------------------------

Creating your own Turrets:
Quick guide on what is required to get your own custom turrets into the game
viewtopic.php?f=23&t=4550&p=33932#p33802


---------------------------------------------------------------------------------------------------------------------------

Instructions to make your modded weapons compatible with the battle stats screen
or
Locking down a new turret without causing a conflict in Fleet HQ:
In all module files you have the following line:
Icon = <<something>>

This line is used to display an icon in areas like your weapon selection window in your ship building screen and for fleet HQ when you are choosing which module to unlock next.

Modules such as engines, shields etc look something like this: icon = turbocharged_engine_mkIV.dds
while turrets have look something like this: icon = turret

When the game finds icon = turret, the program heads down a few lines to turret_sprite to find the name of this particular turret - for example:
turret_sprite = "mega_tach_v1"

Then it heads over to (in this case) unity.txt and to obtain the dds filename from the turret mapping section. In this example:
mega_tach_v1 = turret_mega_tach_v0.dds,turrets_unit_mega.dds,5
Therefore the game will display turret_mega_tach_v0.dds in the weapon display menu

So far so good.
However if your modded turret is locked which is controlled through lockable = 1 the program will use federation.txt to display in in Fleet HQ. In this example there is no "mega_tach_v1" in federation.txt so the game will crash.

To fix this you either
- add in the new turret mapping to federation.txt
or
- follow the following steps: (I will be using my Unity Mod as an example)

Step 1:
Copy the file turret_mega_tach_v0.dds
from \unit\data\bitmaps\turrets\Unit\
to \unit\data\bitmaps\modules\

Step 2:
Rename the file in the modules directory to mega_tachyon_turret.dds

Step 3:
Open the Mega Tachyon ini module and change the line
icon = turret
to
icon = mega_tachyon_turret.dds

the following steps are for locking your module in Fleet HQ
lockable = 0
to
lockable = 1

unlockcost = 0
to
unlockcost = 5000


Run the game.
Now the Mega Tachyon Cannon will be locked without the need to modify the federation.txt. The only drawback to this method is that the more you lock down, the larger your mod becomes since you have to copy the file into 2 locations. Its a small increase in size, but becomes noticable if you unlock 100 turrets.

Please note that you do not have to use the turret sprite as your icon image, you may choose a different icon, say an image of the laser firing from a certian small moon sized battle station . .

If you still have questions or problems, feel free to PM me :)
Darkstar


---------------------------------------------------------------------------------

ECM Payload
classname = "SIM_ECMBeamModule"

Code: Select all

ecmpayload = "RETURNTOSENDER"

What it does:
By adding this new ECM payload into your missile scrambler code it will scramble the missiles guidance system so badly that the missile will try and hit the ship that fired it.

Hints and tips.
while a missiles that has been affected by the RETURNTOSENDER can not be turned around again. It still can be shot down by.
- Guidance Scrambler
- Anti Missile Point Defence.

---------------------------------------------------------------------------------

Plasma Burst.
classname = "SIM_PlasmaLauncherModule"

Code: Select all

maxsimultaneous = 4


What it does:
This new addition enables your plasma weapons to have up to a maximum of 4 flaming plasma spheres of death flying across the screen at any one time.

Hints and tips.
Remember to lower your fire_interval to get that Plasma Burst Goodness.

---------------------------------------------------------------------------------

Custom Bullets.
classname = "SIM_BulletWeaponModule"

New Code

Code: Select all

bullet_texture = "moddedbullets.dds"


What it does:
The Community have been bugging Cliff for a long time about this. With the bullet texture override, you can change that bullet into ANYTHING you want.

Example:
[config]
unlockcost = 12000
lockable = 1
armour_penetration = 60
blasttexture = "turret_cannon_blueII.dds"
category = "WEAPONS"
classname = "SIM_BulletWeaponModule"
bullet_texture = "bullets_II.dds" <- it will look for the file here: \<<modname>>\data\bitmaps\fx\
color = 4
cost = 1280
crew_required = 28


::More Examples of what you can do::
viewtopic.php?f=23&t=5698&start=1110#p51234
viewtopic.php?f=23&t=5698&start=1095#p51203
viewtopic.php?f=23&t=5698&start=1095#p51189

Hints and tips.
After you have added in bullet_texture, remember to change
height =
width =
to help get the image the way you want it.

Another point to remember:
the larger the image of the custom bullet, the more you will slow down GSB!!!
(especially if you have an extremely short refire rate for the weapon)
Be a friendly modder, and do not go insane with this modding feature.

---------------------------------------------------------------------------------

AoE / Area of Effect damage (also known as Flak).
classname = "SIM_BulletWeaponModule"

Code: Select all

payload = FLAK
aoe_radius = 50
aoe_scalar = 0.5


What it does:
This section of code will create damage over an area at the intended target when the bullet either:
- Hits the target
- Misses the target and Expires.

Payload = FLAK - This activates the Area of Effect mechanic for the bullet. Please note that Tracking of the weapon is no longer a determining factor on what the turret can and cant hit. Once your using FLAK as a payload, the bullet will always damage the target and any surrounding ships (friend or foe)

aoe_radius = number - This determines the radius of the area of effect. Anything within this distance of the epicentre will receive damage if their shields / armour are not strong enough.

aoe_scalar = number - This determines the percentage of the damage any ship will receive that is caught in the area of effect and did not have strong enough shields / armor to protect it. For example
aoe_scalar = 0.5 - any ships in AoE will receive half of the weapons damage
aoe_scalar = 1.0 - any ships in AoE will receive the full weapons damage
aoe_scalar = 2.0 - any ships in AoE will receive twice the weapons damage


Hints and tips.
- If you are using the AoE payload for a modded weapon, it is a very good idea that you are fully aware of how it works.
- Ignorant use, or deliberate abuse, of AoE will both seriously hurt GSB's balance and quality of gameplay!!!
- There is a discussion on this new feature you can read here.

---------------------------------------------------------------------------------
Last edited by darkstar076 on Thu Jan 13, 2011 11:54 pm, edited 11 times in total.
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
SirJamon
Supreme Robot
Supreme Robot
Posts: 270
Joined: Sat Jan 02, 2010 8:46 am
Location: Spain

Re: [Guide] GSB Modding 101

Postby SirJamon » Fri Aug 20, 2010 2:06 pm

He, he. It's about time someone collected all the data that is scattered around the forum :D

darkstar076 wrote:When your ship blows up:
I had this in my modding notes. I can not find the author who originally wrote this explody guide

I was the one who wrote that info :)

viewtopic.php?f=23&t=5067&view=unread#p32997

---------------------------------------------------------

Cliff posted information about scenarios here (if you look the posts below the first one, there's also information about hulls and deployments)

viewtopic.php?f=23&t=2985#p15246


BTW, I made some time ago (for me) a visual guide for coding explosions, it's just some pics to help me remind each one of them.
Attached down here :)
Attachments
GMM Explosions.zip
Explosive guide
(181.26 KiB) Downloaded 433 times
Last edited by SirJamon on Sat Aug 21, 2010 11:37 am, edited 1 time in total.
The only limit is... Your imagination.
User avatar
N3MES1S
Supreme Robot
Supreme Robot
Posts: 801
Joined: Sun Aug 08, 2010 7:01 pm

Re: [Guide] GSB Modding 101

Postby N3MES1S » Fri Aug 20, 2010 5:37 pm

Ow, i was looking for this info time ago, specially the variable section xD. THX very much!!!.

Looking to the explosions section, i was wondering if the game will "allow" bigger ships modifying those explosion parameters ¿is that even possible?.
User avatar
Peter1x9
Type III Robot
Type III Robot
Posts: 96
Joined: Fri Jun 25, 2010 2:53 am

Re: [Guide] GSB Modding 101

Postby Peter1x9 » Fri Aug 20, 2010 9:07 pm

Thanks! I've been wanting something like this.

Can we get a sticky on this thread, Cliff?
User avatar
N3MES1S
Supreme Robot
Supreme Robot
Posts: 801
Joined: Sun Aug 08, 2010 7:01 pm

Re: [Guide] GSB Modding 101

Postby N3MES1S » Sat Aug 21, 2010 8:47 am

Hmm, wats the difference between style = standard / fragmented in the plasma module??? i noticed if i change it to fragmented, the game picks another portion of the texture, wats the purpose??
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 » Sat Aug 21, 2010 9:34 am

The purpose is just that . . if you look at the dds file you will see the two sprites.
Style = standard / fragmented is just tells the game which sprite to use.

Another example is for bullets. Where the "color = 0" changes the bullet.
If you look at bullets.dds you will see 10 different images of bullets
by changing the color you can select the one you want.
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
N3MES1S
Supreme Robot
Supreme Robot
Posts: 801
Joined: Sun Aug 08, 2010 7:01 pm

Re: [Guide] GSB Modding 101

Postby N3MES1S » Sat Aug 21, 2010 1:35 pm

The thing is using the fragmented style the plasma doesnt seem like a plasma torpedo anymore xD, and it looks really awful. So thats my point. Usually, the parameters that only changes from a texture to another are kinda xxxx = 1. But a parameter "style" should be more useful. I dont think anyone uses the fragmented mode...well, if u make bubble mod... lol.
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 » Sat Aug 21, 2010 11:20 pm

I use the fragment mode for plasma . . but yes it would be nice to change style to refer a .dds file instead
Last edited by darkstar076 on Fri Nov 05, 2010 2:12 am, edited 1 time in total.
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=-
gotswat
Senior Line Supervisor
Senior Line Supervisor
Posts: 28
Joined: Wed Aug 11, 2010 2:02 am

Re: [Guide] GSB Modding 101

Postby gotswat » Wed Sep 01, 2010 12:51 am

Okay if someone can please literally take a screen shot every step and highlight the areas needed to implement your own turrets i for the life of me cant get it to work game keep crashing with a turret mapping error, i mad a .dds for the turrent i wanted (nothing crazy), i then made a turret_crusader.dds file and placed said turret in the top left and then made this line in the crusaders text file.

[turrets]
turret_auto_v1 = crusader_v1.dds,turrets_crusader.dds,0

I even deleted every other turret line in the text file (was just basic federation turrets nothing special)


I am at a loss i was hoping to implement a crusader missel/beam laser, nothing to special just slightly more powerful (not a lot really) and slightly more expensive/more crew needed.

I just can not figure out why it crashing on me.


s.w.a.t.

p.s i have the turret_crusader.dds out side of the crusader folder, and the .dds for the turret it self inside the crusader folder is this is issue?


Here is what my turret_crusader.dds looks like

Image

Should I resize the turret image within the .dds? is that whats causing the issue?
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 » Wed Sep 01, 2010 12:58 am

I assumed you tried to follow this:

darkstar076 wrote:Creating your own Turrets:
Quick guide on what is required to get your own custom turrets into the game
viewtopic.php?f=23&t=4550&p=33932#p33802



From the guide
". .It is worth to note that the turret mapping is for both your new custom weapons and the weapons avaliable to all races."

So in your crusader.txt file you will need to have the standard turret mappings (ie copy from the federation file) plus your own.
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=-
gotswat
Senior Line Supervisor
Senior Line Supervisor
Posts: 28
Joined: Wed Aug 11, 2010 2:02 am

Re: [Guide] GSB Modding 101

Postby gotswat » Wed Sep 01, 2010 1:01 am

darkstar076 wrote:I assumed you tried to follow this:

darkstar076 wrote:Creating your own Turrets:
Quick guide on what is required to get your own custom turrets into the game
viewtopic.php?f=23&t=4550&p=33932#p33802



Yes i made a text file that points to the original .dds first then to the turret_crusader.dds next and use 0 as it was the first one inside only problem is it for some reason can not find the mapping? When i made the turret_crusader.dds file i did not resize the turret i noticed the turrets inside the other files were smaller so is this an issue?


s.w.a.t.
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 » Wed Sep 01, 2010 1:07 am

gotswat wrote:I even deleted every other turret line in the text file (was just basic federation turrets nothing special)


Ah, its not your new turrets, that are causing problems, its the fact that you have removed the standard turret mapping:

Quick Summary - you have your three files:
- <<modname>>\data\bitmaps\turrets\turrets_crusader.dds <- this holds all your new in game images, the file is broken down into an 8 x 8 grid.
- <<modname>>\data\bitmaps\turrets\crusader\crusader_v1.dds <-this file holds a single image. It is used in the ship building screens
- <<modname>>\data\races\crusader.txt <- this is your turret mapping. It tells the game what the file names are and where they are located on the grid

Then your crusader.txt code should at least look like this:

Code: Select all

[turrets]
turret_auto_v1 = crusader_v1.dds,turrets_crusader.dds,0
turret_auto_v2 = fed_turret_auto_v2.dds,turrets_federation.dds,1
turret_auto_v3 = fed_turret_auto_v3.dds,turrets_federation.dds,2
turret_auto_v4 = fed_turret_auto_v4.dds,turrets_federation.dds,3
turret_auto_v5 = fed_turret_auto_v5.dds,turrets_federation.dds,4
turret_auto_v6 = fed_turret_auto_v6.dds,turrets_federation.dds,5
turret_bull_v1 = fed_turret_bull_v1.dds,turrets_federation.dds,6
turret_bull_v2 = fed_turret_bull_v2.dds,turrets_federation.dds,7
turret_bull_v3 = fed_turret_bull_v3.dds,turrets_federation.dds,8
turret_bull_v4 = fed_turret_bull_v4.dds,turrets_federation.dds,9
turret_las_v1 = fed_turret_las_v1.dds,turrets_federation.dds,10
turret_las_v2 = fed_turret_las_v2.dds,turrets_federation.dds,11
turret_las_v3 = fed_turret_las_v3.dds,turrets_federation.dds,12
turret_las_v4 = fed_turret_las_v4.dds,turrets_federation.dds,13
turret_las_v5 = fed_turret_las_v5.dds,turrets_federation.dds,14
turret_miss_v1 = fed_turret_miss_v1.dds,turrets_federation.dds,15
turret_miss_v2 = fed_turret_miss_v2.dds,turrets_federation.dds,16
turret_miss_v3 = fed_turret_miss_v3.dds,turrets_federation.dds,17
turret_miss_v4 = fed_turret_miss_v4.dds,turrets_federation.dds,18
turret_miss_v5 = fed_turret_miss_v5.dds,turrets_federation.dds,19
turret_pd_v1 = federation_turret_pd_v1.dds,turrets_federation.dds,22
turret_pd_v2 = federation_turret_pd_v2.dds,turrets_federation.dds,23
tractor_turret_v1 = tractor_turret_v1.dds,turrets_federation.dds,27
tractor_turret_v2 = tractor_turret_v2.dds,turrets_federation.dds,29
turret_plasma_v1 = plasma_turret_v1.dds,turrets_federation.dds,24
turret_plasma_v2 = plasma_turret_v2.dds,turrets_federation.dds,25
turret_plasma_v3 = plasma_turret_v3.dds,turrets_federation.dds,26
turret_plasma_v4 = plasma_turret_v3.dds,turrets_federation.dds,26
turret_ecm_v1 = fed_turret_ecm_v1.dds,turrets_federation.dds,31


You need to keep those other lines in - this tells the game how your crusader race displays the standard turrets :)
Hope this helps with the turret mapping problem.

If the game displays the turret incorrectly ingame, then yes, your right, resize the image.
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=-

Return to “Gratuitous Modding”

Who is online

Users browsing this forum: Bing [Bot] and 4 guests