Turrets don't twist on their center properly


#1

We as seen in the Image

When the Turrets are rotating to fire at their targets they do not stay center, they rotate around a different center and this different center seems to always be changing, but when not targeting or attacking the turrets face forwards and perfectly center.

Is there something wrong with my graphic, the Canvas size is 512 x 512.


#2

Hi Vorgra and welcome to the modding forums :slight_smile:

The problem is due to the fact that the piviot point of the turret is not in the center of the turret but rather the sprite.
I have posted this quick modding guide here for people read on how to make sprites with long barrels.


#3

Ah yes I see because the barrel extends beyond the turret housing it moves the pivot point closer to the end of the barrel, However with that answered how to I overcome this issue? make my own sprites ad make the smaller to fit within my hull’s (turret mounts on the hull) limitations? or is their another way?

Or I could Increase the size of the Turret mounts but I fear that may look to big then


#4

ah i see what your trying to do. . .
Ok, you need to tackle this from 2 different directions.

First, you need to create a turret sheet where the centre of the turret body is the centre of the turret sheet, see the modding guide for a complete explanation. (previous post has the link)

Second, you might need to decrease the size of the turret mounts on your ship graphic (those gray circles) so that the turrets will completely cover them if/when you place a turret. (Becuase your turrets will be slightly smaller that the original ones with the “off centre” turning point"


#5

I got all that solved but now I have another issue, There is a white outline around my ship, it is not on the dds file so I have little clue how it got there, I assume it is the game engine placing it there, how do i get rid of it?

Also when placing the running lights i noticed that the X,Y that is stated within this Tutorial viewtopic.php?f=23&t=4783&p=29938#p29938 is back to front, this may only be for me though


#6

When your viewing the dds file is the background white ?
If thats the case i would say your alpha channel is 1 pixel to large.

Hmm, it seems right to me . .
X - is Port to Starboard
Y - is Bow to Stern

I recomend this thread:
viewtopic.php?f=23&t=5220
Most of the tutorials and other tidbits have been collected here. .


#7

No the Background is that checkerd stuff (alpha)

The image size is 512x 512

The file was made ins paint.net

oh btw is X vetical and Y horizontal? cause thats what ive been following for the modules.
Anatory Cruiser.rar (23.2 KB)


#8

I think you will find that for modules, lights, engines - everything
X - is Port to Starboard
Y - is Bow to Stern

I downloaded the file and had a look. The area around the ship is white as i expected

At a guess i would say that when your opening the file in paint.net or gimp, the program is displaying the image according to the alpha channel. (So the area around the ship would indeed be checkerd)

So if you can display the image without the alpha channel and change the background colour surrounding the ship to black, you would get something like this:
Anatory Battle Cruiser.zip (77 KB)

Hope this helps


#9

Well your version seems to be fine, you used photoshop I assume, ill get the trial of it for now.


#10

Yeah i used photoshop (because it is what i grew up with)

But Paint.net or gimp can produce the same results, you just have to learn the more advanced features :slight_smile:
In this case its displaying the entire dds graphic without using the alpha channel

BTW which graphics program were you using ?


#11

I was using paint.net,

althought I have far more experience in photoshop, just don’t currently have access to it (will be solved soon though)

also Im not sure if you could help, but in the above picture you can see that I made some turrets, anyway I decided to make this into a proper mod, so to start off I decided to get organized and make the race files for the Anatory, I used the federation race txt file and renamed what I needed, but now im getting this error “Turret mapping not found [turret_dualsteam_v1] ==> [federation]:…\crc\SIM_Race.cpp 249”

Now I solved this issue before but I was using the original federation text document (so the weapon became available for the federation) but now even though I seems correct to me in the new Anatory race text document it still produces the error.

I was able to remove all my files (all the files I edited I restored and removed all my files) and it worked (the game became vanilla) and then I put all my stuff back in yet it produced the same error.

[config]
name = “anatory”
guiname = “Anatory”
logo = “federation.jpg”
debrisstartuv = 32
debrisenduv = 64
escapepodid = 2
description = "The galactic commerce federation may not have the largest space fleet, but it remains the dominant economic force in the galaxy. Their free-market philosophy extends right up to individual spaceship captains, who are billed for every shot fired, and credited for every verified kill. Technically, the commerce federation has no navy, and it’s collection of armored spaceships merely form part of it’s ‘contract enforcement department’.
repairbotid = 1
contrailid = 1
music = federation_battle.ogg
shieldcollapseuv = 1
defaultnames = gratuitous
guiid = 10
lockable = 0
unlockcost = 0

[turrets]
turret_dualsteam_v1 = ana_dual_steam_cannon.dds,turrets_anatory.dds,0

[victory_messages]
0 = “A thoroughly profitable victory! Your market worth will rise appropriately on the federation stock market.”
1 = “Excellent work! I’m sure that your military genius will lead to substantial profits for your department!”
2 = “Not bad at all. Personally I bet my money on the opposition, but hey, it’s just business right?”
3 = “An excellent victory. And this is just the start. Think victory hats, victory mouse-mats, the works!”

[defeat_messages]
1 = “Many federation lives lost, and worse still, a huge financial loss. Those spaceships aren’t cheap you know…”
2 = “This is a disaster. How is a military defeat like this going to look on our profit projections?”
3 = “In retrospect, I’m not sure going with the lowest bidder for those spaceship hulls was such a smart move.”
4 = “Yes your fleet was pulverized, but the good news is we made a killing on the TV rights to the battle.”

[crew]
0 = “Hank”
1 = “Preston”
2 = “Shane”
3 = “Travis”
4 = “Damian”
5 = “Brandon”
6 = “Bart”
7 = “Tyler”
8 = “Ryan”
9 = “Mike”
10 = “Matt”
11 = “Ethan”
12 = “Dave”
13 = “Zack”
14 = “Caleb”
15 = “Kevin”
16 = “Milo”
17 = “Tappman”
18 = “Nately”
19 = “Snowden”
20 = “Appleby”
21 = “McWatt”
22 = “Orr”
23 = “Towser”

What Im curious about is how come it still uses federation when the file is saved as anatory and within the document I use anatory.

Obviously Im still in the proccess of getting the logo and discription written, but Im sure having it as federation logo dds and the federation description shouldn’t effect this, and I also doubt the music has anything to do with this.

oh and here is the module text.
also how do i put this stuff into a spoiler like thing on this forum

[config]
armour_penetration = 18
blasttexture = “Steam_Dual_Blast.dds”
category = “WEAPONS”
classname = “SIM_BulletWeaponModule”
color = 4
cost = 75
crew_required = 4
damage = 8
description = “Naval Officers often underestimate the power of a high quality blaster. The beam laser boys may have their fun, but more than ever, people are turning to blasters for their needs.”
fire_interval = 300
guiname = “Dual Steam Cannon”
height = 7
hitpoints = 100
icon = turret
lockable = 0
max_range = 450
min_range = 110
name = “Dual_Steam_Cannon”
optimum_range = 350
powerconsumed = 3
shield_penetration = 48
size = “CRUISER”
slot_type = TURRET
sound = data/sounds/particle_canon.ogg
soundvolume = 1.0
speed = 6
tracking_speed = 1.5
turret_sprite = “turret_dualsteam_v1”
turretsize = 10.0
uisortpos = 1090
unlockcost = 0
weight = 95
width = 1.7

[dataitems]
0 = cost,DECIMAL
1 = weight,DECIMAL
2 = hitpoints,DECIMAL
3 = powerconsumed,DECIMAL
4 = max_range,DECIMAL
5 = damage,DECIMAL
6 = fire_interval,INTEGER
7 = tracking_speed,DECIMAL
8 = shield_penetration,DECIMAL
9 = armour_penetration,DECIMAL
10 = crew_required,INTEGER
11 = optimum_range,DECIMAL
12 = min_range,DECIMAL

(disregard the current OPness of the weapon i have yet to even bother balancing yet)


#12

Could you elaborate on what you mean when you say “it still uses federation”? The race is still labeled as Federation, or are the turrets still Federation?

If the former, I haven’t a clue. Your code looks correct.

If the latter, there’s this tricky thing called turret binding that I’m not completely familiar with.

Huh. Apparently the regular tags don’t work.


#13

In the Error it has [federation] which I am assuming it is refering to the federation files, yet the turret_dualsteam_v1 is not in anything related to the federation, anyway Ill make this code from scratch again and see if that prevails, yeah I gave the traditional spoiler code a try but it failed, twas saddened greatly.


#14

I narrowed down the error greatly,

For the Dual_steam_cannon I used the cruiser_quantamblaster as a base.txt to work on.

the obvious I changed the turret sprite = “turret_auto_v1” to turret sprite = “turret_steam_v1”
now if I have the following code

turret_steam_v1 = Dual_Steam_Cannon.dds,turrets_anatory.dds,0

under [turrets] of the anatory race text document the game produces the following error

“Turret mapping not found [turret_steam_v1] ==> [federation]:…\crc\SIM_Race.cpp 249”

now if I copy this file over to the bottom of the turrets section withing the federation race text document the game does not produce the error.

however if I leave the anatory race text document in the “races” folder I get the following error upon attempting to change the hull in the ship editor

“failed to find race:…\src\SIM_Race.cpp 130”

but If I remove the anatory race text document from the “races” folder I do not get any errors at all, this makes me assume the game is failing to read my race document.

However if I go into battle screen select a battle scenario and then change race when I scroll down the anatory race is there and selectable.

now to make it even more strange, If i remove the anatory race text document I still recive the same error, when performing the same thing, so this mean that it has to do with the hulls folder.

now I removed the anatory folder in the hulls folder and moved the anatory battle cruiser file to the federation folder, this allowed me to finally access the change hull feature and my anatory battle cruiser is there to be chosen… however… upon clicking the anatory battle cruiser hull I get yet another yet strangely unrelated error.

Turret mapping not found [turret_las_v1] ==> [anatory]:…\src\SIM_Race.cpp 249

what? and Ill continue to narrow this down… if it can get any smaller…


#15

this is depressingly simple solution, I noticed that it was failing to turret map that weapon within the anatory race text document, so I copied the default turrets located within the federation race text document.

It then produced a similar error

“Turret mapping not found [turret_steam_v1] ==> [anatory]:…\crc\SIM_Race.cpp 249”

So I coppied the turret steam v1 line of code that I placed within the federation race text document into the anatory race text document, and …

no errors…

wow…

o.o

all along, all I needed todo was copy the original weapons over into the anatory race text document, apparently the race cannot go without these weapons, which is a serious dissappointment, as my intentions were to create 3 new races (anatory, disith, guild) with their unique weapons and gear that would still balance with the games original races, but without the access of each others weapons or the original weapons that come with every race (albeit asthetically different)


#16

::Standard Turrets::
You are spot on, when your building your new race, it is important to remember that they will have access to all the standard vanilla weaponry. Therefore in your race file you have to let GSB know which graphics are needed for all the common weapons.

So i would imagine your code would look something lile this for Anatory.txt

[config]
name = "anatory"
guiname = "Anatory"
logo = "federation.jpg"
debrisstartuv = 32
debrisenduv = 64
escapepodid = 2
description = "The galactic commerce federation may not have the largest space fleet, but it remains the dominant economic force in the galaxy. Their free-market philosophy extends right up to individual spaceship captains, who are billed for every shot fired, and credited for every verified kill. Technically, the commerce federation has no navy, and it's collection of armored spaceships merely form part of it's 'contract enforcement department'.
repairbotid = 1
contrailid = 1
music = federation_battle.ogg
shieldcollapseuv = 1
defaultnames = gratuitous
guiid = 10
lockable = 0
unlockcost = 0

[turrets]
turret_dualsteam_v1 = ana_dual_steam_cannon.dds,turrets_anatory.dds,0

turret_auto_v1 = fed_turret_auto_v1.dds,turrets_federation.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

[victory_messages]
0 = "A thoroughly profitable victory! Your market worth will rise appropriately on the federation stock market."
1 = "Excellent work! I'm sure that your military genius will lead to substantial profits for your department!"
2 = "Not bad at all. Personally I bet my money on the opposition, but hey, it's just business right?"
3 = "An excellent victory. And this is just the start. Think victory hats, victory mouse-mats, the works!"

[defeat_messages]
1 = "Many federation lives lost, and worse still, a huge financial loss. Those spaceships aren't cheap you know...."
2 = "This is a disaster. How is a military defeat like this going to look on our profit projections?"
3 = "In retrospect, I'm not sure going with the lowest bidder for those spaceship hulls was such a smart move."
4 = "Yes your fleet was pulverized, but the good news is we made a killing on the TV rights to the battle."

[crew]
0 = "Hank"
1 = "Preston"
2 = "Shane"
3 = "Travis"
4 = "Damian"
5 = "Brandon"
6 = "Bart"
7 = "Tyler"
8 = "Ryan"
9 = "Mike"
10 = "Matt"
11 = "Ethan"
12 = "Dave"
13 = "Zack"
14 = "Caleb"
15 = "Kevin"
16 = "Milo"
17 = "Tappman"
18 = "Nately"
19 = "Snowden"
20 = "Appleby"
21 = "McWatt"
22 = "Orr"
23 = "Towser" 

Here is the next problem you will face with your new weapons. At the end of the simulation the game will throw a wobbly with your new turrets. Something like “Turret mapping not found [turret_steam_v1] ==> [anatory]:…\crc\SIM_Race.cpp 249”

The problem exists around this line:
icon = turret.
you will have to change it to something like this
icon = ana_dual_steam_cannon.dds

Full Example:

[config]
armour_penetration = 18
blasttexture = "Steam_Dual_Blast.dds"
category = "WEAPONS"
classname = "SIM_BulletWeaponModule"
color = 4
cost = 75
crew_required = 4
damage = 8
description = "Naval Officers often underestimate the power of a high quality blaster. The beam laser boys may have their fun, but more than ever, people are turning to blasters for their needs."
fire_interval = 300
guiname = "Dual Steam Cannon"
height = 7
hitpoints = 100
icon = ana_dual_steam_cannon.dds
lockable = 0
max_range = 450
min_range = 110
name = "Dual_Steam_Cannon"
optimum_range = 350
powerconsumed = 3
shield_penetration = 48
size = "CRUISER"
slot_type = TURRET
sound = data/sounds/particle_canon.ogg
soundvolume = 1.0
speed = 6
tracking_speed = 1.5
turret_sprite = "turret_dualsteam_v1"
turretsize = 10.0
uisortpos = 1090
unlockcost = 0
weight = 95
width = 1.7

[dataitems]
0 = cost,DECIMAL
1 = weight,DECIMAL
2 = hitpoints,DECIMAL
3 = powerconsumed,DECIMAL
4 = max_range,DECIMAL
5 = damage,DECIMAL
6 = fire_interval,INTEGER
7 = tracking_speed,DECIMAL
8 = shield_penetration,DECIMAL
9 = armour_penetration,DECIMAL
10 = crew_required,INTEGER
11 = optimum_range,DECIMAL
12 = min_range,DECIMAL

This will remove the need to add in the turret mapping into federation.txt for anyone who installs this mod.

As for removing the vanilla weapons from all but the original races . . we have a solution for that as well.
It involves changing the original files but it is doable.

For more information on any of this see viewtopic.php?f=23&t=5220
Most of the tutorials and other tidbits have been collected here. .


#17

You might consider using the RVM mod linked in my sig. Some mods used that, though I’m not sure how many. The basic idea is that it restricts the official modules to the official races. This may break any mods that rely on a custom race having access to those weapons of course… (there is a solution as always, but things start getting a little complex).

Edit:
I see darkstar already alluded to my mod in his solution. Using RVM isn’t a solution to be taken lightly as take-up of it never reached the sort of “critical mass” where you can assume other mods will be happy with it.

Edit 2:
Also, RVM is a couple of minor versions behind the current GSB release, so it won’t be any good until I get around to updating it.


#18

Will this work? I should test.

Anyway, I remember when looking at the big (for example) Federation turret .dds sheet that it contained “broken” turrets as well, that is, turrets that have taken critical damage and are no longer usable. Will that still work if you just use a different .dds file for that turrent? Or do you include the “broke” graphic within the .dds file?


#19

No this wont work for you - unless you have Vorgra mod, even then you will have to place the ana_dual_steam_cannon.dds into the modules directory.

Will this work in general - Hell Yes. I developed this is the work-around for 2 reasons:
To make your modded weapons compatible with v1.50
or
Locking down a new turret without causing a conflict in Fleet HQ:
(read full destructions here)

Anyone that is planning to have a unique turret names for their mod race will need to do this.

Have a read of the GSB Modding 101 thread for full details

In summary
The icon = <> is to resolve an issue that cropped up in version 1.50 (and later) where people were using non standard turret names like turret = superduperuberturret

Since these turret name were not in federation.txt the game will crash in the Stats screen or Fleet HQ. Therefore it was required to use icon = <> to override the second component of the turret mapping in the race.txt file for these screens.