Question: coordinate system for placing modules, etc.


I’m working on a mod and ran into the dreaded width limit crash when I tried to make a very large ship. Fortunately the ship I am working on is twice as wide as it is long. I followed the starwars and stargate mods as a guide when stretching out ships to make them bigger and get around the width limit. By doing this I was able to get my ship ingame without incident, at the size I wanted. I now see why the emp effect on these ships is not in the correct position. For my purposes though, I would rather have a bigger ship.

However, the problem I am running into now is placing modules correctly once I have stretched out my ship. The ingame editor works perfectly if I am not stretching anything. Once I stretch my ship out, I end up with turrets floating out in space. I could place them manually…If I could figure out how the coordinate system works.

Here’s part of the hull file with the first five weapon slots:

0 = 75.00,40.25,TURRET,
1 = 94.50,80.75,TURRET,
2 = 127.50,16.00,TURRET,
3 = 127.50,62.00,TURRET,
4 = 181.00,41.75,TURRET,
5 = 160.50,78.38,TURRET,

I assume one number is an X coordinate and the other is a Y coordinate. After experimenting, I can tell that this doesn’t follow the standard X,Y positioning like in math.

I don’t even know where to begin with the damage section. Example:
0 = 97.75,89.75,0,1,95.00,86.50,100.50,93.00,(damage_sprite_sparks-97.00-89.00),
1 = 111.50,131.75,0,1,108.50,128.50,114.50,135.00,(damage_sprite_sparks-111.00-131.00),
2 = 94.25,79.50,0,1,92.00,76.50,96.50,82.50,(damage_sprite_sparks-94.00-79.00),
3 = 118.50,149.50,0,1,115.50,146.00,121.50,153.00,(damage_sprite_sparks-119.00-149.00),
4 = 125.25,80.25,0,1,122.50,77.50,128.00,83.00,(damage_sprite_sparks-125.00-80.00),
5 = 128.00,128.00,0,0,
6 = 141.00,153.25,0,1,138.00,150.00,144.00,156.50,(damage_sprite_sparks-141.00-153.00),
7 = 180.00,41.75,0,1,177.50,38.50,182.50,45.00,(damage_sprite_sparks-179.00-42.00),
8 = 163.00,192.00,0,1,160.50,188.50,165.50,195.50,(damage_sprite_sparks-164.00-191.00),
9 = 128.50,173.75,0,1,125.50,171.00,131.50,176.50,(damage_sprite_sparks-128.00-173.00),

The hulks section is pretty straightforward (If I could figure out the coordinate system). You just place a boundary of four points around each hulk section.

The explosion section has three coordinates?! What do I do with these? Example:
0 = 0.00,162.50,78.50,EXP_FRIGATE
1 = 120.00,128.50,88.00,EXP_DESTRUCTION_PLACED
2 = 130.00,115.50,147.50,EXP_DESTRUCTION_PLACED
3 = 170.00,188.00,215.00,EXP_DESTRUCTION_PLACED
4 = 203.00,128.00,128.00,EXP_PLUMES


you might like this Thread, Dosnt have all the Answers but it might have some


The coordinate system is a 256x256 grid that the module slots are put on. So placing a module at 128.00,128.00 will place it in the center of the ship. The first number is the X position, and the second is the Y position: XX.XX,YY.YY. The you follow that with the type of point it is, standard or turret. So now it will be in this format: XX.XX,YY.YY,type . After that you have the option of specifying where the turrets will actually be displayed while fighting. This is completely optional, and if you decide not to do it the game will simply draw the turret where it is in the ship editor. If you want to do it then you simply add another field in this format (XX.XX-YY.YY). This can be done for as many turrets as you want to appear. Now the entire thing will look like this… XX.XX,YY.YY,type,(XX.XX-YY.YY),(XX.XX-YY.YY),. Mind you that no matter how many turrets you make the game draw they will all still be considered only one weapon.


In hull coding, GSB mostly uses corrdinate position realative to a 256x256 sprite. Then it doesn’t matter if your sprite is bigger or smaller you’ll have to place stuff as if you are working with a sprite of that size (fast way is making a copy of the sprite and resizing it to know where you are placing stuff). The 256x256 law doesn’t apply with the hulk and tractor section.
Also consider that when placing the different items you are marking the placement of the center of that item (center of a turret, a explosion, etc)

Little copy & paste of the chaotic info I wrote about explosions:

[code][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)
//t -> Timer (Determines in ms how much time will last after the ship destruction for this effect to happen
//EXP_EFFECT -> Explosion effect when ship is destroyed
//EFFECT is replaced by the following names for different desired effects:
//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)
//FRIGATEBREAKUP (Medium expanded explosion)
//CRUISERDEBRIS (Some debris)
//FRIGATEDEBRIS (Small debris)
//PLUMES (Fragments large explosion)
//BLASTGLARE (White blast)
//BLASTGLARESMALL (Small white blast)

0 = t,x,y,EXP_EFFECT[/code]

Ignore the explosion description in parenthesis, you’d better see for yourself what each line in the explosion sequence does.
I think those are all the explosions that are in the game.


Thanks! I need to retexture my cruiser anyways, so I’ll give it a shot later today. Much to my disappointment, adding hardpoints only works for turrets. If you give hardpoints to any other module, the game places the module wherever its original position is. While this may not be a problem for most modules, having fighters dock in empty space around my cruiser looks just plain silly. :\