Author Topic: A FRED code request.  (Read 5840 times)

0 Members and 1 Guest are viewing this topic.

Offline EdrickV

  • Valued
  • 29
    • http://members.aol.com/HunterComputers
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.
Ground - "Let me help you out, you're clear to taxi any way you can, to any runway you see."

Mesh Gallery/Downloads:
http://members.aol.com/ArisKalzar/Gallery.html
Turreting 101:
http://members.aol.com/EdrickV/FS2/Turreting.html

http://members.aol.com/HunterComputers

 

Offline Joey_21

  • 28
    • http://denebsystem.cjb.net/
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.

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
[EDIT: response to EdrickV]

Oog.  I see.  I'll have to do some bug-hunting, then. :nervous:
« Last Edit: January 12, 2003, 09:05:09 am by 561 »

 

Offline DTP

  • ImPortant Coder
  • 28
    • http://www.c4-group.dk
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.
VBB member; reg aug 1999; total posts 600.
War is a lion, on whos back you fall, never to get up.
Think big. Invade Space.

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
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?

 

Offline DTP

  • ImPortant Coder
  • 28
    • http://www.c4-group.dk
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.
VBB member; reg aug 1999; total posts 600.
War is a lion, on whos back you fall, never to get up.
Think big. Invade Space.

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Okay... now where's Bobboau so we can ask him...

:p

 

Offline EdrickV

  • Valued
  • 29
    • http://members.aol.com/HunterComputers
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.)
« Last Edit: January 12, 2003, 11:50:34 pm by 657 »
Ground - "Let me help you out, you're clear to taxi any way you can, to any runway you see."

Mesh Gallery/Downloads:
http://members.aol.com/ArisKalzar/Gallery.html
Turreting 101:
http://members.aol.com/EdrickV/FS2/Turreting.html

http://members.aol.com/HunterComputers

  

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Fixed the beam whack. :)