Turret Woes - Please Help

This is the place for all questions related to modding Starshatter.
Post Reply
Dekzar
Posts: 35
Joined: Mon Apr 05, 2004 12:18 am
Contact:

Turret Woes - Please Help

Post by Dekzar »

Hi guys,

I'm having trouble getting my turrets to work. I've never dealt with them before, so I'm stuck.

I've got the turret all modeled, positioned on the ship correctly, etc. The turret rotates to face it's target and all. But here I encounter problems.

If I set it's "Graphic Type" to 2, the sprite, whenever I fire the turret it creates the correct bitmap, racing at the target. But, the bitmap is oriented towards the camera, and not the target, which looks horrible. And, for some reason there's no muzzle flash. And there's only one bitmap it creates, but in the ship DEF, I told it to use 2 muzzles...do I need to add the # of muzzles somewhere else for it to fire both? Or do turrets only support one muzzle?

However, if I set the graphic_type to 3, the turret wont fire. Here's the DEF, any help is appreciated:

Code: Select all

WEAPON
 
 primary: {
 	name:		HETurret,
 	group:		Turrets,
 	target_type:	0x0000ffff,
 	value:		1,
 
 	capacity:	100,
 	recharge_rate:	10,
 	refire_delay:	0.2,
 
 	charge:		5,
 	min_charge:	5,
 
 	damage:		5,
 	speed:		10e3,
 	life:		5,
 
 	guided:		0,
 	self_aiming:	true,
 	aim_az_max:	360,
 	aim_el_max:	0.5,
 
 	min_range:	10e3,
 	max_range:	40e3,
 
 	turret:		"HTurret.mag"
 	scale:		1,
 
 	graphic_type:	3,
 	bitmap:		"HEBolt.pcx",
 	light:		10,
 	flash:		"HEMuzzle.pcx",
 	flash:		0.25,
 }

And the DEF for the ship:

Code: Select all

 SHIP
 
 name:          	Thunder
 display_name:  	Thunder
 class:      	Frigate
 abrv:       	"Thunder"
 
 model:	"HRThunder.MAG"
 
 mass:       190.0
 integrity:  3e3
 vlimit:     375
 agility:    23
 air_factor: 0.25
 roll_rate:  2000
 scale:      2.00
 acs:        1.1
 detet:      50e3
 
 trans_x:    2000
 trans_y:    1500
 trans_z:    2000
 
 drag:       0.0035
 roll_drag:  10
 pitch_drag: 7.5
 yaw_drag:   7.5
 
 CL:         1e-2
 CD:         1.5e-5
 stall:      0.40
 
 prep_time:  15
 avoid_fighter: 7
 
 chase:      (0, -130, 50)
 bridge:     (0,   6,  10)
 
 power:      {
    type:    Fusion,
    max_output: 120,
    fuel_range: 0.5,
    
    loc:     (0, 0, -159),
    size:    32,
    hull_factor: 0.75
    }
 
 
 drive:      {
    type:    Red,
    thrust:  15,
    augmenter: 50,
    scale:   1,
    port:    (-8, 10, -175),
    port:    (9, 10, -175),
    port:    (0, -6, -175),
    port:    (-8, -28, -175),
    port:    (9, -28, -175),
    port:    (0, -41, -175),
 
    loc:     (0, 0, 0),
    size:    16,
    hull_factor: 0.85
    }
 
 weapon:     {
    type:             "LGauss",
    design:           "LGauss",
    name:             "Light Gauss",
    abrv:             "Gauss-1",
    loc:           ( -32, -14, 100),
    muzzle:           (  -32, -14, 153),
 
    size:             8,
    hull_factor:      0.08,
    explosion:        7
    }
 
 weapon:     {
    type:             "LGauss",
    design:           "LGauss",
    name:             "Light Gauss",
    abrv:             "Gauss-1",
    loc:           ( -22, -14, 100),
    muzzle:           (  -22, -14, 153),
 
    size:             8,
    hull_factor:      0.08,
    explosion:        7
    }
 
 weapon:     {
    type:             "LGauss",
    design:           "LGauss",
    name:             "Light Gauss",
    abrv:             "Gauss-1",
    loc:           ( 21, -14, 100),
    muzzle:           (  21, -14, 153),
 
    size:             8,
    hull_factor:      0.08,
    explosion:        7
    }
 
 weapon:     {
    type:             "LGauss",
    design:           "LGauss",
    name:             "Light Gauss",
    abrv:             "Gauss-1",
    loc:           ( 31, -14, 100),
    muzzle:           (  31, -14, 153),
 
    size:             8,
    hull_factor:      0.08,
    explosion:        7
    }
 
 weapon:     {
    type:             "HETurret",
    design:           "HETurret",
    name:             "Energy Turret",
    abrv:             "Turret-1",
    loc:           ( 44, 41, -117),
    muzzle:           (  -3, 9, 14),
    muzzle:           (  4, 9, 14),
 
    size:             8,
    hull_factor:      0.08,
    explosion:        7
    }
 
 decoy:     {
    type:    "Fighter Decoy",
    abrv:    "Decoy",
    muzzle:  ( 0, -32, 0),
 
    loc:     (0, 0, 0),
    size:    16,
    hull_factor: 0.5
    }
 
 sensor:     {
    pcs:                 25,
    active_efficiency:   2e9,
    passive_efficiency:  500,
    range:   25e3,
    range:   50e3,
    range:   75e3,
 
    loc:     (0, 0, 100),
    size:    25,
    hull_factor: 0.25
    }
 
 computer:   {
    name:    "Avionics Package",
    abrv:    "HUD",
    type:    1,
 
    loc:     (20, 0, 80),
    size:    8,
    hull_factor: 0.2
    }
 
 computer:   {
    name:    "Flight Computer",
    abrv:    "Flight",
    type:    2,
 
    loc:     (-20, 0, 80),
    size:    16,
    hull_factor: 0.5
    }
 
 
 nav:        {
    loc:     (0, 0, 60),
    size:    16,
    hull_factor: 0.1
    }
 
 death_spiral: {
    time:             0.1,
 
    explosion_type:   10,   // SMALL_EXPLOSION
    explosion_time:   1.1,
    explosion_loc:    (0, 0, -64),
 
    explosion_type:   10,   // SMALL_EXPLOSION
    explosion_time:   1.5,
    explosion_loc:    (20, 10, -20),
 
    final_type:       11,   // LARGE_EXPLOSION
    final_loc:        (0, 0, -32),
 
    final_type:       12,   // LARGE_BURST
    final_loc:        (0, 0, -32),
    }
 
 map: {
    sprite: "map0.pcx",
    sprite: "map1.pcx",
    sprite: "map2.pcx",
    sprite: "map3.pcx",
    sprite: "map4.pcx",
    sprite: "map5.pcx",
    sprite: "map6.pcx",
    sprite: "map7.pcx"
 }
 
John DiCamillo
Posts: 360
Joined: Sat Feb 28, 2004 7:02 am
Contact:

RE: Turret Woes - Please Help

Post by John DiCamillo »

The reason you can't see the bolts being fired is because you haven't specified the width and length of the shot. Try adding the following lines to the weapon design file:

Code: Select all

   graphic_type:     3,	// blob
    width:            3,
    length:           60,

Yes, turrets can have multiple barrels. I'm not totally sure what the problem is there.

By the way, I've changed the code related to turret muzzle placement in the final 4.0.0 version. There is a bug in all prior versions of the game that the muzzle points were multiplied by the ship scale, even though the turret itself was not. To get around this, you need to use a bit of trial and error to find proper placements of the muzzle points in 3.9.0. In the final version, you can just read the proper muzzle points directly off the turret model in Magic.
User avatar
TheDeadlyShoe
Posts: 549
Joined: Tue Apr 06, 2004 3:06 pm

RE: Turret Woes - Please Help

Post by TheDeadlyShoe »

Oh, that explains why the Fortress PDB muzzles were so whacked out. *g*

A Sprite will always show directly at the camera, that's the definition of a sprite, basically. Generally, you only want to use with weapons that shoot small, spherical bolts....

If your blobs still look weird after you do what Milo said, then try rotating the shot texture 90 degrees. (in the texture itself w/ a graphics editor- you can't in the game AFAIK).
@TheDeadlyShoe> Unless, say, you could make black holes at will.
@Razeam> I can do that but I don't want to.
Post Reply

Return to “Starshatter Modding Forum”