Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Petrarch of the VBB on January 03, 2003, 01:15:56 pm

Title: A FRED code request.
Post by: Petrarch of the VBB on January 03, 2003, 01:15:56 pm
Would it be pssible to edit the turrets on mulitple ships?

I mean, when you select multiple ships you can edit their primaries and secondaries in one go, but not the turrets. For instance, I might want a wing of satises to be Light Cruisers, so I had to go to each one in turn to change its weapons, and I'm too lazy.
Title: A FRED code request.
Post by: Fury on January 03, 2003, 01:20:34 pm
Also about weapons, would it be possible to have multiple capital ships of same class but different weaponry? Original FS2 only supports same weaponry for single capital ship class in a mission.
Title: A FRED code request.
Post by: Petrarch of the VBB on January 03, 2003, 01:21:53 pm
What are you on about? You can change the weapons on ships!
Title: A FRED code request.
Post by: Fury on January 03, 2003, 01:25:29 pm
Quote
Originally posted by Petrarch of the VBB
What are you on about? You can change the weapons on ships!


Yes. Example:

You have two Cains in a mission. You edit second cain's weaponry, but when you launch the mission. Both cains have same weaponry. --> FS2 does not support different weaponry for same ship class in a mission.
Title: A FRED code request.
Post by: Petrarch of the VBB on January 03, 2003, 01:28:34 pm
:wtf:

Never noticed that.
Title: A FRED code request.
Post by: Slasher on January 03, 2003, 01:29:40 pm
I think what Mr. Fury is getting at is that whenever you edit the weapons on a turret in a ship in the game, that same customized weapon information is copied over to every ship of that class in that mission.

Since that wasn't very clear at all ( :D ), lemme give an example.  Say I want to give a GTCv Deimos an Ultra-AAA beam in place of it's port side AAAf.  Well, every Deimos in that mission will feature an Ultra-AAA beam on that same turret as well.

Like Mr. Fury said, it'd be nice if we could choose whether or not this happened.  Sometimes it's a convience, sometimes it's not.

Ah, I see it's been clarified already.  Nevermind, then. :)
Title: A FRED code request.
Post by: Petrarch of the VBB on January 03, 2003, 01:31:41 pm
This is indeed odd. I'm sure I've had flak on opposite sides of ships...
Title: A FRED code request.
Post by: Fury on January 03, 2003, 01:32:27 pm
Thanks Slasher. :D
I have said it many times and I will say again, I suck in explaining things. ;)
Title: A FRED code request.
Post by: ZylonBane on January 03, 2003, 02:34:16 pm
I know for a fact that I've had ships of the same type with different weapons ingame.
Title: A FRED code request.
Post by: IceFire on January 03, 2003, 04:31:27 pm
Quote
Originally posted by ZylonBane
I know for a fact that I've had ships of the same type with different weapons ingame.

Do produce some proof because I have never ever gotten that to work.....ever! :D
Title: A FRED code request.
Post by: Fury on January 03, 2003, 04:46:12 pm
If FS2 can handle fighters and bombers of same class but different weaponry, I don't think it would be impossible to include similar support for capital ships.

Unless turrets have something to do with this...
Title: A FRED code request.
Post by: ZylonBane on January 03, 2003, 05:40:58 pm
Are we talking capital ships only, or ALL ship types? My example involved a bunch of Elysiums.
Title: A FRED code request.
Post by: DTP on January 03, 2003, 05:53:05 pm
Quote
Originally posted by Mr. Fury
If FS2 can handle fighters and bombers of same class but different weaponry, I don't think it would be impossible to include similar support for capital ships.

Unless turrets have something to do with this...


one way to test, if turrets has something to do with it, take the osiris bomber, and change their turrets.

same deal?, no, then it is not turrets. But i will look into it, when i find the time.
Title: A FRED code request.
Post by: Petrarch of the VBB on January 04, 2003, 06:12:11 am
I tried it with a pair of fenrises this morning. I gave one all flak and the other all subachs, and both had all subachs!
Title: A FRED code request.
Post by: SKYNET-011 on January 11, 2003, 02:48:56 pm
Oh great, that really ruined the game for me. :mad:
Title: A FRED code request.
Post by: LAW ENFORCER on January 11, 2003, 07:06:51 pm
oh yeah THAT bug! I hated that! Fix it please! What's skynet say?
Title: A FRED code request.
Post by: SKYNET-011 on January 11, 2003, 09:10:33 pm
Seriously, that could really screw up a campaign.
Title: A FRED code request.
Post by: SKYNET-011 on January 11, 2003, 09:48:31 pm
Hey guys, I noticed something about turrets. In a mission, Fighters can have different weapons, yet capital ships can not. BUT if any bombers have turrets, the turrets can't have different weapons. I think the turrets are responsible for this.
Title: A FRED code request.
Post by: EdrickV on January 11, 2003, 10:49:20 pm
This is just a 5 second guess on what may be at the root of this problem, but I think it is probably happening for turrets on ships because the turret data for all ships of a particular type is stored in (or set from) the entry in the Ship_info structure, and that structure has 1 entry for every type of ship. That means there's only one Fenris entry, one Orion entry, etc. I haven't actually seen this bug in practice, at least that I can remember. I think it would be a hard thing to fix without some major internal changes in multiple functions. A workaround: If you really want 2 ships of the same type with different turret weapons, make a seperate table entry for each one. (If you had the Bastion Orion and a regular Orion in the same mission, the Basion ought to be able to have different weapons then the regular Orion. Again, this is untested but ought to work. You can, IIRC, change what "class" name appears in game via the ship editor's Alt Name box.)
Title: A FRED code request.
Post by: Goober5000 on January 12, 2003, 01:43:32 am
Ship_info has one entry for every type of ship, yes, but it also has one entry for every instance of a ship.  If this is indeed the root of the problem, the very easy fix would be to change the lookup function from a class lookup to a ship instance lookup.
Title: A FRED code request.
Post by: EdrickV on January 12, 2003, 03:48:18 am
Quote
Originally posted by Goober5000
Ship_info has one entry for every type of ship, yes, but it also has one entry for every instance of a ship.  If this is indeed the root of the problem, the very easy fix would be to change the lookup function from a class lookup to a ship instance lookup.


The individual ships I believe are in the Ships array, not the Ship_info array. Ship_info has room for 130 ships, and has been kept at 130 because raising it any higher breaks other code. (MAX_SHIP_TYPES) On the other hand, Ships has room, currently, for 400 ships. (Originally 100.) Ships, an array of ship structures, is where all the ship specific info is stored. For instance: Escort priority, score, AI type info, alt name info, what kinds of orders are accepted, and much much much more. It's huge compared to the ship_info structure. The latter contains data the game gets from the table files as modified by the mission. The definitions of the two global arrays are below and show that the two are of different sizes, one to hold a list of all the ships and one to hold a list of the ship types.

ship   Ships[MAX_SHIPS];
ship_info      Ship_info[MAX_SHIP_TYPES];

There are a bunch of other arrays that are used as well, since I believe the ship and ship_info structures don't contain the polymodel data.
Title: A FRED code request.
Post by: Joey_21 on January 12, 2003, 08:58:45 am
Quote
Originally posted by EdrickV
A workaround: If you really want 2 ships of the same type with different turret weapons, make a seperate table entry for each one. (If you had the Bastion Orion and a regular Orion in the same mission, the Basion ought to be able to have different weapons then the regular Orion. Again, this is untested but ought to work. You can, IIRC, change what "class" name appears in game via the ship editor's Alt Name box.)


:nod: :nod:

This would be the answer. I had this problem quite a few months ago.
Title: A FRED code request.
Post by: Goober5000 on January 12, 2003, 08:59:24 am
[EDIT: response to EdrickV]

Oog.  I see.  I'll have to do some bug-hunting, then. :nervous:
Title: A FRED code request.
Post by: DTP on January 12, 2003, 10:33:12 am
Quote
Originally posted by Goober5000
[EDIT: response to EdrickV]

Oog.  I see.  I'll have to do some bug-hunting, then. :nervous:


good luck :D. i located the Beam/shield problem by adding some mprints, only to Zap in and out of freespace2 to read the debug spew, since debug fails for me in a window.

(note:Ofcourse in retrospect it is easy to say that was the bug, but i did not take it for granted that Bobboau´s Code where responsible for that).

Now this is a bug the code was born with, maybe subsys_list or whatever it was that i bumped to 2100.

BTW the lack of Commits, or work from me is because i am trying to make an TBL SHIP/WEAPON file checker.

Not having any experience in opening files, this is a hole new battleground for me.
Title: A FRED code request.
Post by: Goober5000 on January 12, 2003, 11:22:05 am
There should be a few decent file reading routines built into the code; in any case, most parsing functions call stuff from parselo.cpp - so that ought to have what you need.

IceFire says that another bug was introduced somewhere along the line - AAAf beams do not have the mass effect that they used to.  Any idea on that?
Title: A FRED code request.
Post by: DTP on January 12, 2003, 02:17:18 pm
Quote
Originally posted by Goober5000
There should be a few decent file reading routines built into the code; in any case, most parsing functions call stuff from parselo.cpp - so that ought to have what you need.

IceFire says that another bug was introduced somewhere along the line - AAAf beams do not have the mass effect that they used to.  Any idea on that?


maybe, since it was introduced and the only thing that has been added that could break it, is the fighterbeam code.

type 3 beams are AAAf, what did Bobboau call his fighterbeam, Type 5 ?.

OR

not having studied the parser much, but i ought to, The mass value is being read and then thrown away. and if the mass value segfaults to 0 then the beams would have no mass.
Title: A FRED code request.
Post by: Goober5000 on January 12, 2003, 08:06:13 pm
Okay... now where's Bobboau so we can ask him...

:p
Title: A FRED code request.
Post by: EdrickV on January 12, 2003, 11:28:23 pm
Ok, I just did a test with two Deimos class corvettes firing different beams from turret23 at the same ship. Under both the original exe and fs2_open 3.3 the ships fired different beams. Maybe the problem doesn't affect beam turrets or maybe it's something introduced in 3.4? (The 3.4 I tried, one I think I compiled myself, crashed on trying to enter the mission with no error messages, but that might not be related to that mission.)

Update: Tried the official 3.4 using the same mission, the ships had the right weapons. Whatever the problem is, it must not be affecting beam turrets. (Maybe the problem is not in FS2 but in FRED2? I used the original FRED2 to make the mission.)
Title: A FRED code request.
Post by: Goober5000 on January 13, 2003, 04:24:51 pm
Fixed the beam whack. :)