I'm doing something stupid. Please debug me.

This is the place for all questions related to modding Starshatter.
User avatar
Lord QDaan
Posts: 50
Joined: Thu Apr 01, 2004 8:48 pm

I'm doing something stupid. Please debug me.

Post by Lord QDaan »

Alright, check this out. I'm trying to create a nice little textured box weapon that sits there and does nothing as the beginnings of test. My goal is to be able to place this same textured box on any ship I make, the way a weapon should be. Unfortunately, I can't get the box to show up. Ignore the odd names and random numbers, if you please. It's about 260x260x280 in magic units. The problem is that it isn't showing up. I'm certain I've seen externally racked missiles on other mod warships, so I don't know what's wrong with mine. The only realy difference between my missile and most missiles is that mine doesn't target anything or ever want to fire.

Here is the entry I'm using in my ship:

weapon: {
type: "box",
design: "Missile Weapon",
name: "Connector Beam",
group: xxx,
abrv: xxx,
loc: (0, 0, 0),
muzzle: (0, 0, 0),
size: 32,
hull_factor: 0.2
}

And here is the weapon, connectorbeam.def

WEAPON

missile: {
name: "connectorbeam",
target_type: 0x0,
value: 1,
recharge_rate: 1,
refire_delay: 3,
capacity: 1,
charge: 1,
min_charge: 1,
damage: 1,
speed: 3000,
mass: 1,
thrust: 0,
life: 3,
guided: 0,
min_range: 2,
max_range: 1,
max_track: 1,
self_aiming: false,
graphic_type: 1,
visible_stores: true,
model: "gunplatturret.mag",
scale: 3,
}
SDnet - sci-fi, science, and mockery of stupid people
http://www.stardestroyer.net

"Any job worth doing with a laser is worth doing with many, many lasers."
Khrima
User avatar
TheDeadlyShoe
Posts: 549
Joined: Tue Apr 06, 2004 3:06 pm

RE: I'm doing something stupid. Please debug me.

Post by TheDeadlyShoe »

What's the error log say?
@TheDeadlyShoe> Unless, say, you could make black holes at will.
@Razeam> I can do that but I don't want to.
User avatar
Dragonlead
Posts: 303
Joined: Sun May 16, 2004 6:25 am

RE: I'm doing something stupid. Please debug me.

Post by Dragonlead »

Also, loc: in the ship file is relative to the ship, but muzzle: is relative to the weapon. Also check your syntax (the .def files are pretty fussy about this) so double check for commas and no caitals letters, etc.

V/R
USAF Ret.
User avatar
Lord QDaan
Posts: 50
Joined: Thu Apr 01, 2004 8:48 pm

RE: I'm doing something stupid. Please debug me.

Post by Lord QDaan »

The errlog would let me know if it was something as simple as a misplaced comma, I'm just about certain that's not it. The ship ran fine without the weapon, right down to the explosions. The weapon isn't giving me any errors, as far as I can see. Hmm...I'm gonna try making it target warships and see what happens if I fire it. I don't know why I didn't think of that before.
SDnet - sci-fi, science, and mockery of stupid people
http://www.stardestroyer.net

"Any job worth doing with a laser is worth doing with many, many lasers."
Khrima
User avatar
TheDeadlyShoe
Posts: 549
Joined: Tue Apr 06, 2004 3:06 pm

RE: I'm doing something stupid. Please debug me.

Post by TheDeadlyShoe »

If you want externally racked missiles, you want to be using Hardpoints, not Weapons.

That just means use Hardpoint: instead of Weapon:, and that you can list more than one Type: parameter.

I've never done one myself, though.
@TheDeadlyShoe> Unless, say, you could make black holes at will.
@Razeam> I can do that but I don't want to.
User avatar
Lord QDaan
Posts: 50
Joined: Thu Apr 01, 2004 8:48 pm

RE: I'm doing something stupid. Please debug me.

Post by Lord QDaan »

I'm about to lose my mind here. I decided to work from scratch. First, I took Pheagey's Bailey-Class's Mass Driver and attached it to my cruiser. I changed a few details for testing purposes. Then, I edited the scale so that it was huge, too big to be missed even inside my ship. This worked perfectly. Then, I edited visible_stores so that it read true. No dice. I could have lost it there, but I kept cool. I tried changing the ship file so that it used a hardpoint instead of a weapon system. This didn't work at all, and I had no missile. So I changed the ship to Attack from Cruiser. The weapon fired fine, just like a fighter weapon should... but I still didn't have a visible model. Arrgh!

Here, check it all out.

SHIP
name: "Impervious"
display_name: "Impervious"
class: Attack
model: "funkyship1lod1.mag"
model: "funkyship2lod1.mag"
spin: (0.0, 0.0, 0.0)
spin: (0.0,1.0, 0.0)
abrv: "CA"

mass: 100e3
integrity: 55e3
vlimit: 280
agility: 42
air_factor: 0.25
roll_rate: 50
scale: 2.4
acs: 30.1
drag: 0.0035
roll_drag: 6.5
pitch_drag: 4.5
yaw_drag: 4.5
trans_x: 2000
trans_y: 2000
trans_z: 2000
CL: 1e-2
CD: 1.5e-5
stall: 0.30
explosion_scale: 0.09

chase: (0, -1500, 0)
bridge: (0, 50, 40)

power: {
type: Fusion,
design: "Fusion Reactor",
max_output: 1e10,
loc: (0, 85, 15),
size: 10,
hull_factor: 1,
explosion: 7
}

drive: {
type: Plasma,
name: "Plasma Drive",
design: "Plasma Drive",
thrust: 40e3,
loc: (0, 20, -15),
size: 20,
hull_factor: 1,
explosion: 7,
augmenter: 1
}

thruster: {
design: Thruster,
scale: 2.5,
port_aft: (0, 7, 0),
loc: (0, 0, 9),
size: 7,
hull_factor: 1
}

hardpoint:{
type: "connectorbeam",
muzzle: ( 0, 0, 300),
}

loadout: {
name: "Standard",
stations: (0)
}

weapon: {
type: "XRay Laser",
design: "Beam Weapon",
name: "XRay Laser 2",
abrv: "Laser-2",
muzzle: ( 128, -50, 360),
muzzle: (-128, -50, 300),

size: 32,
hull_factor: 0.2,
explosion: 7
}

sensor: {
design: Sensor,
pcs: 20,
active_efficiency: 2e6,
passive_efficiency: 20e3,
range: 20e3,
range: 50e3,
range: 100e3,
loc: (0, -21, 32),
size: 16,
hull_factor: 1
}
computer: {
name: "Avionics Package",
abrv: "HUD",
type: 1,
design: Computer,
loc: (0, 25, 130),
size: 8,
hull_factor: 1
}
computer: {
name: "Flight Computer",
abrv: "Flight",
type: 2,
design: Computer,
loc: (15, 10, 80),
size: 8,
hull_factor: 1
}
nav: {
loc: (-15, 10, 70),
design: Computer,
size: 16,
hull_factor: 1
}

death_spiral: {
time: 2.3,
explosion_scale: 4

explosion_type: 8, // SMOKE_TRAIL
explosion_time: 1,
explosion_loc: (20, 0, -100),

explosion_type: 4, // SMALL_EXPLOSION
explosion_time: 1.3,
explosion_loc: (20, 0, -100),

final_type: 13,
final_loc: (0, 0, -60),
}

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

WEAPON
//ok this works, no we need to fix the firing arch and velocity
missile:{
name: "connectorbeam",
scale: 25,
target_type: 0xffffffff, //once I get a target weapon will not fire this is set like this.
value: 3, //whats higher? 1 or 5?
ammo: 25, //testing, will have 14
refire_delay: 10.0, //testing, will be 27 sec.
salvo_delay: 5.0, //extra delay for AI
damage: 50000, //25 should kill station1
speed: 2000, //m. per sec.
charge: 1, //missile-drone should be 1
min_charge: 1, //missile-drone should be 1
life: 120, //life of shot in sec.
carry_mass: 0.25, //mass on ship
carry_resist: 0.1, //man. ability lost while sho is onboard ship
mass: 0.25, //mass in flight
thrust: 500, //will be streight flying shot. all this should be very low
drag: 1,
roll_rate: 0.0,
pitch_rate: 0.0,
yaw_rate: 0.0,
roll_drag: 0.0,
pitch_drag: 0.0,
yaw_drag: 0.0,
min_range: 1000,
max_range: 100000,
max_track: 100000,
guided: 1, //0=no guidance, 1=self guidance, 2=??, 3
self_aiming: true,
aim_az_max: 0.05,
aim_el_max: 0.05,
visible_stores: true,
graphic_type: 1, //1=solid, 2=sprite, 3=blob.
model: "baileyclassmassdriverrock.MAG",
trail: "baileyclassmassdrivertrail.pcx",
trail_width: 2,
flare: "baileyclassmassdriverflare.pcx",
flare_scale: 1,
}
SDnet - sci-fi, science, and mockery of stupid people
http://www.stardestroyer.net

"Any job worth doing with a laser is worth doing with many, many lasers."
Khrima
User avatar
Lord QDaan
Posts: 50
Joined: Thu Apr 01, 2004 8:48 pm

RE: I'm doing something stupid. Please debug me.

Post by Lord QDaan »

Oh, and ignore the comments in the .def file. That's mostly left over from whatever ancient version of the Bailey that I happen to have.
SDnet - sci-fi, science, and mockery of stupid people
http://www.stardestroyer.net

"Any job worth doing with a laser is worth doing with many, many lasers."
Khrima
User avatar
TheDeadlyShoe
Posts: 549
Joined: Tue Apr 06, 2004 3:06 pm

RE: I'm doing something stupid. Please debug me.

Post by TheDeadlyShoe »

With a Hardpoint, you still need Loc and all the other parameters that you use in a weapon.
@TheDeadlyShoe> Unless, say, you could make black holes at will.
@Razeam> I can do that but I don't want to.
User avatar
Lord QDaan
Posts: 50
Joined: Thu Apr 01, 2004 8:48 pm

RE: I'm doing something stupid. Please debug me.

Post by Lord QDaan »

Huh, yeah, missed that. Oh well, it was late. Of course I'll try it, but I have my doubts, considering that it fires just fine, but just doesn't show up when it isn't being fired.

EDIT: Yeah, no change.
SDnet - sci-fi, science, and mockery of stupid people
http://www.stardestroyer.net

"Any job worth doing with a laser is worth doing with many, many lasers."
Khrima
Necromancer
Posts: 54
Joined: Wed Jun 16, 2004 6:53 pm

RE: I'm doing something stupid. Please debug me.

Post by Necromancer »

Ok,

I've done externally racked missiles before and had no problems, I guess the first thing I need to clear up is do you want this to be a turret or just a static missile emplacement? I've done it both ways and had no troubles...
User avatar
Lord QDaan
Posts: 50
Joined: Thu Apr 01, 2004 8:48 pm

RE: I'm doing something stupid. Please debug me.

Post by Lord QDaan »

Static. The final version isn't even supposed to fire. It just sits there looking pretty.
SDnet - sci-fi, science, and mockery of stupid people
http://www.stardestroyer.net

"Any job worth doing with a laser is worth doing with many, many lasers."
Khrima
Mehrunes
Posts: 257
Joined: Wed Mar 31, 2004 6:56 am
Contact:

RE: I'm doing something stupid. Please debug me.

Post by Mehrunes »

Your hardpoint is missing a design parameter but you don't need a hardpoint. Location isn't needed, it defaults to the ship's origin and non-turreted weapons are placed at the muzzle, but the weapon won't load without a design. Your first weapon was type "box" but the file for it is connectorbeam, that's why it didn't work to begin with.
User avatar
Lord QDaan
Posts: 50
Joined: Thu Apr 01, 2004 8:48 pm

RE: I'm doing something stupid. Please debug me.

Post by Lord QDaan »

That was just an editing error in the post. I always tripple-check that sort of thing in the actual file. I have the same problem if i change my current files back to a cruiser with a weapon rather than an attack with a hardpoint. No matter what, the weapon loads fine, fires fine, etc., but visible_stores just doesn't work.
SDnet - sci-fi, science, and mockery of stupid people
http://www.stardestroyer.net

"Any job worth doing with a laser is worth doing with many, many lasers."
Khrima
Mehrunes
Posts: 257
Joined: Wed Mar 31, 2004 6:56 am
Contact:

RE: I'm doing something stupid. Please debug me.

Post by Mehrunes »

Try setting ammo to 1 then.
User avatar
Lord QDaan
Posts: 50
Joined: Thu Apr 01, 2004 8:48 pm

RE: I'm doing something stupid. Please debug me.

Post by Lord QDaan »

[X(]
...
[&o]
...
I guess I'll have to create multiple missile systems if I want visible_stores and ammo>1, then. Not that you usually need such a thing anyway, I just wouldn't know why the coding acts the way it does here.
SDnet - sci-fi, science, and mockery of stupid people
http://www.stardestroyer.net

"Any job worth doing with a laser is worth doing with many, many lasers."
Khrima
Mehrunes
Posts: 257
Joined: Wed Mar 31, 2004 6:56 am
Contact:

RE: I'm doing something stupid. Please debug me.

Post by Mehrunes »

You could try adding more muzzles, I don't know how that works. Multiple warheads don't work with hardpoints either.
User avatar
Lord QDaan
Posts: 50
Joined: Thu Apr 01, 2004 8:48 pm

RE: I'm doing something stupid. Please debug me.

Post by Lord QDaan »

Hmm, oh well. Guess sprites and blobs don't work for visible_stores. Once again I demonstrate my ignorance of programming by failing to understand why it doesn't work.
SDnet - sci-fi, science, and mockery of stupid people
http://www.stardestroyer.net

"Any job worth doing with a laser is worth doing with many, many lasers."
Khrima
User avatar
TheDeadlyShoe
Posts: 549
Joined: Tue Apr 06, 2004 3:06 pm

RE: I'm doing something stupid. Please debug me.

Post by TheDeadlyShoe »

Are you sure, Mehrunes? The stock SRMs are two to a hardpoint.
@TheDeadlyShoe> Unless, say, you could make black holes at will.
@Razeam> I can do that but I don't want to.
Mehrunes
Posts: 257
Joined: Wed Mar 31, 2004 6:56 am
Contact:

RE: I'm doing something stupid. Please debug me.

Post by Mehrunes »

I meant multiple muzzles don't work normally with hardpoints. I don't know how to have a variable number of visible stores on a hardpoint.
User avatar
TheDeadlyShoe
Posts: 549
Joined: Tue Apr 06, 2004 3:06 pm

RE: I'm doing something stupid. Please debug me.

Post by TheDeadlyShoe »

I haven't tested it, but I'm thinking maybe it's an ammo of 2 inthe weapon DEF + 2 muzzles. Dunno.
@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”