editted building not on list

This forum is for outdated or irrelevant Modding Information that may or may not be 3 months old.

Moderator: thunderchero

Post Reply
User avatar
robert_defore
Lieutenant-Commander
Lieutenant-Commander
Posts: 141
Joined: Tue Jul 15, 2008 2:00 am

editted building not on list

Post by robert_defore »

I changed the tech requirements for some buildings with UE and I can see them in the research windows but they will not appear on construction list. Anyone else encounter this and how can it be fixed. Thnx
User avatar
Peter1981
Rear-Admiral
Rear-Admiral
Posts: 1118
Joined: Tue May 06, 2008 2:00 am
Location: England

Post by Peter1981 »

Having edited the building stats you did you

in UE with Stbof.res open select

EDiT -> STARTING CONDITIONS -> STARTING TECHNOLOGY

and click 'Auto-Set All' then

FILE -> SAVE

if asked to update trek.exe do so (i.e. select yes)

Reasoning:
Within the edifice.bst the first half is a mapping of all the building with respect to technology and race so if you change the tech values you'll need to up date these table. Thanks to my work on adding buildings DCER was able to add the button above (which is a rare 'one-click' solution).

Code: Select all

Offset 0x0000 to 0x0003 number of buildings 
		
=================================================

Offset 0x0004 to 0x0007 address of the buildings address map (file offset)

=================================================

Offset 0x0008 to 0x01F3 tech map (496 bytes)

Offset 0x0008 to 0x0009 number of buildings with biotech requirement
Offset 0x000A to 0x000B number of buildings with computer requirement 
Offset 0x000C to 0x000D number of buildings with construction requirement 
Offset 0x000E to 0x000F number of buildings with energy requirement 
Offset 0x0010 to 0x0011 number of buildings with propulsion requirement 
Offset 0x0012 to 0x0013 number of buildings with weapons requirement 
Offset 0x0014 to 0x0015 number of buildings with All techs requirement 
Offset 0x0016 to 0x0017 0x0000 (separator?)

=================================================

Followed by: (offset 0x0018 to 0x01F3 - 476 bytes) 

For each tech requirement (7) 
For each tech level (10) 
address (4 bytes) of the first building with given tech req. and level 

0x00000000 separator? (4 bytes) 

For each tech level (10) (0-09?)
number of buildings with given tech req. and level (2 bytes) 

0x00000000 separator? (4 bytes)

=================================================

Offset 0x01F4 to 0x02E3 ignore list (240 bytes) 

For each empire (5) 
bit mask of all the buildings (48 bytes == 384 bits) 
 
=================================================

Offset 0x02E4 to 0x84DD building data (n * 176 bytes)

Building data 

Each building takes up 176 bytes. The listed building need to be sorted by tech requirement and tech level. 

Each building consists of: 

Offset 0x0000 to 0x0027 Singular name (40 bytes) 
Offset 0x0028 to 0x004F Plural name (40 bytes) 
Offset 0x0050 to 0x0051 ID (2 bytes) 
Offset 0x0052 to 0x0053 Upgrade For ID (2 bytes) 
Offset 0x0054 to 0x0057 Unknown (4 bytes) 
Offset 0x0058 to 0x005F Image prefix (8 bytes) 
Offset 0x0060 to 0x0064 Unknown (5 bytes) 
Offset 0x0065 to 0x0065 Tech req. type (1 byte) 
Offset 0x0066 to 0x0066 Tech level (1 byte) 
Offset 0x0067 to 0x0067 Excluded empires mask (bit set to 1 means cannot by built by said empire) 
Offset 0x0068 to 0x006F Race requirement (1 means race required) 
Offset 0x0070 to 0x0070 Politic requirement (1 byte) 
Offset 0x0071 to 0x0071 System requirement (1 byte) 
Offset 0x0072 to 0x0072 bonus type (index from edifbnft.bst) 
Offset 0x0073 to 0x0073 build limit 
Offset 0x0074 to 0x0074 group 
Offset 0x0075 to 0x0075 Category 
Offset 0x0076 to 0x0077 unknown (2 bytes) 
Offset 0x0078 to 0x0079 build cost (2 bytes) 
Offset 0x007A to 0x007B unknown (2 bytes) 
Offset 0x007C to 0x007D energy cost (2 bytes) 
Offset 0x007E to 0x007F unknown (2 bytes) 
Offset 0x0080 to 0x0081 population cost (2 bytes) - either 00 or 0A 
Offset 0x0082 to 0x0083 morale bonus (2 bytes) 
Offset 0x0084 to 0x0085 unknown (2 bytes) 
Offset 0x0086 to 0x0087 Cardassian bonus (2 bytes) 
Offset 0x0088 to 0x0089 Federation bonus (2 bytes) 
Offset 0x008A to 0x008B Ferengi bonus (2 bytes) 
Offset 0x008C to 0x008D Klingon bonus (2 bytes) 
Offset 0x008E to 0x008F Romulan bonus (2 bytes) 
Offset 0x0090 to 0x0091 neutral bonus (2 bytes) 
Offset 0x0092 to 0x0093 Cardassian unrest bonus ? (2 bytes) 
Offset 0x0094 to 0x0095 Federation unrest bonus ? (2 bytes) 
Offset 0x0096 to 0x0097 Ferengi unrest bonus ? (2 bytes) 
Offset 0x0098 to 0x0099 Klingon unrest bonus ? (2 bytes) 
Offset 0x009A to 0x009B Romulan unrest bonus ? (2 bytes) 
Offset 0x009C to 0x009D neutral unrest bonus ? (2 bytes) 
Offset 0x009E to 0x00AB unknown (14 bytes) 
Offset 0x00AC to 0x00AF description address 
All strings need to end with a 0x00 byte.

=================================================

Consists of 4 byte addresses (file offsets) pointing to the start of a building's data entry. Addresses are sorted by building id. 

To get the file offset of building with ID 0, you would look at the first address, for building with ID 30, you'd look at the 31st address.

=================================================
User avatar
robert_defore
Lieutenant-Commander
Lieutenant-Commander
Posts: 141
Joined: Tue Jul 15, 2008 2:00 am

Post by robert_defore »

Thanks the problem was fixed by your solution however the correct levels still don't show in my save game. So I just upped them all by one level and on tech up Coils. On the list
User avatar
Peter1981
Rear-Admiral
Rear-Admiral
Posts: 1118
Joined: Tue May 06, 2008 2:00 am
Location: England

Post by Peter1981 »

yep the solution only works for new games. Sorry robert_defore most solutions are intended on this site to work with new games -- still I shouldn't have assumed that you knew.
Post Reply

Return to “Modding Information Archive”