Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: phreak on July 26, 2002, 12:07:53 pm

Title: my changes to fs2 source
Post by: phreak on July 26, 2002, 12:07:53 pm
i figured its about time to show the code changes i did

edit: changed HULL_REPAIR_RATE from .015f to .075f

SUPPORT SHIP REPAIRS HULL
starts line 6673 in ship.cpp

Code: [Select]

#define SHIELD_REPAIR_RATE 0.20f // Percent of shield repaired per second.
#define HULL_REPAIR_RATE 0.075f // Percent of hull repaired per second.
#define SUBSYS_REPAIR_RATE 0.10f // Percent of subsystems repaired per second.

// ==================================================================================
// ship_do_rearm_frame()
//
// function to rearm a ship.  This function gets called from the ai code ai_do_rearm_frame (or
// some function of a similar name).  Returns 1 when ship is fully repaired and rearmed, 0 otherwise
//

#define REARM_NUM_MISSILES_PER_BATCH 4 // how many missiles are dropped in per load sound

int ship_do_rearm_frame( object *objp, float frametime )
{
int i, banks_full, subsys_type, subsys_all_ok;
float shield_str, repair_delta, repair_allocated;
ship *shipp;
ship_weapon *swp;
ship_info *sip;
ship_subsys *ssp;
ai_info *aip;

shipp = &Ships[objp->instance];
swp = &shipp->weapons;
sip = &Ship_info[shipp->ship_info_index];
aip = &Ai_info[shipp->ai_index];

// AL 10-31-97: Add missing primary weapons to the ship.  This is required since designers
//              want to have ships that start with no primaries, but can get them through
// rearm/repair
if ( swp->num_primary_banks < sip->num_primary_banks ) {
for ( i = swp->num_primary_banks; i < sip->num_primary_banks; i++ ) {
swp->primary_bank_weapons[i] = sip->primary_bank_weapons[i];
}
swp->num_primary_banks = sip->num_primary_banks;
}

// AL 12-30-97: Repair broken warp drive
if ( shipp->flags & SF_WARP_BROKEN ) {
// TODO: maybe do something here like informing player warp is fixed?
shipp->flags &= ~SF_WARP_BROKEN;
}

// AL 1-16-97: Replenish countermeasures
shipp->cmeasure_count = sip->cmeasure_max;

// Do shield repair here
if ( !(objp->flags & OF_NO_SHIELDS) ) {
shield_str = get_shield_strength(objp);
if ( shield_str < sip->shields ) {
if ( objp == Player_obj ) {
player_maybe_start_repair_sound();
}
shield_str += sip->shields * frametime * SHIELD_REPAIR_RATE;
if ( shield_str > sip->shields ) {
shield_str = sip->shields;
}
set_shield_strength(objp, shield_str);
}
}

// Repair the ship integrity (subsystems + hull).  This works by applying the repair points
// to the subsystems.  Ships integrity is stored is objp->hull_strength, so that always is
// incremented by repair_allocated
repair_allocated = sip->initial_hull_strength * frametime * HULL_REPAIR_RATE;


//AL 11-24-97: remove increase to hull integrity
//phreak 7/26/02 - i did

objp->hull_strength += repair_allocated;
if ( objp->hull_strength > sip->initial_hull_strength ) {
repair_allocated -= ( sip->initial_hull_strength - objp->hull_strength);
objp->hull_strength = sip->initial_hull_strength;
}


// check the subsystems of the ship.
subsys_all_ok = 1;
ssp = GET_FIRST(&shipp->subsys_list);
while ( ssp != END_OF_LIST( &shipp->subsys_list ) ) {

if ( ssp->current_hits < ssp->system_info->max_hits && repair_allocated > 0 ) {
subsys_all_ok = 0;
subsys_type = ssp->system_info->type;

if ( objp == Player_obj ) {
player_maybe_start_repair_sound();
}

repair_delta = ssp->system_info->max_hits - ssp->current_hits;
if ( repair_delta > repair_allocated ) {
repair_delta = repair_allocated;
}
repair_allocated -= repair_delta;
Assert(repair_allocated >= 0.0f);

// add repair to current strength of single subsystem
ssp->current_hits += repair_delta;
if ( ssp->current_hits > ssp->system_info->max_hits ) {
ssp->current_hits = ssp->system_info->max_hits;
}

// add repair to aggregate strength of subsystems of that type
shipp->subsys_info[subsys_type].current_hits += repair_delta;
if ( shipp->subsys_info[subsys_type].current_hits > shipp->subsys_info[subsys_type].total_hits )
shipp->subsys_info[subsys_type].current_hits = shipp->subsys_info[subsys_type].total_hits;

if ( ssp->current_hits > ssp->system_info->max_hits )
ssp->current_hits = ssp->system_info->max_hits;

// check to see if this subsystem was totally non functional before -- if so, then
// reset the flags
if ( (ssp->system_info->type == SUBSYSTEM_ENGINE) && (shipp->flags & SF_DISABLED) ) {
shipp->flags &= ~SF_DISABLED;
ship_reset_disabled_physics(objp, shipp->ship_info_index);
}
break;
}
ssp = GET_NEXT( ssp );
}

// now deal with rearming the player.  All secondary weapons have a certain rate at which
// they can be rearmed.  We can rearm multiple banks at once.
banks_full = 0;
if ( subsys_all_ok ) {
for (i = 0; i < swp->num_secondary_banks; i++ ) {
if ( swp->secondary_bank_ammo[i] < swp->secondary_bank_start_ammo[i] ) {
float rearm_time;

if ( objp == Player_obj ) {
hud_gauge_popup_start(HUD_WEAPONS_GAUGE);
}

if ( timestamp_elapsed(swp->secondary_bank_rearm_time[i]) ) {

// Have to do some gymnastics to play the sound effects properly.  There is a
// one time sound effect which is the missile loading start, then for each missile
// loaded there is a sound effect.  These are only played for the player.
//
rearm_time = Weapon_info[swp->secondary_bank_weapons[i]].rearm_rate;
if ( aip->rearm_first_missile == TRUE ) {
rearm_time *= 3;
}

swp->secondary_bank_rearm_time[i] = timestamp( (int)(rearm_time * 1000.f) );

// Acutal loading of missiles is preceded by a sound effect which is the missile
// loading equipment moving into place
if ( aip->rearm_first_missile == TRUE ) {
snd_play_3d( &Snds[SND_MISSILE_START_LOAD], &objp->pos, &View_position );
aip->rearm_first_missile = FALSE;

} else {
snd_play_3d( &Snds[SND_MISSILE_LOAD], &objp->pos, &View_position );
if (objp == Player_obj)
joy_ff_play_reload_effect();

swp->secondary_bank_ammo[i] += REARM_NUM_MISSILES_PER_BATCH;
if ( swp->secondary_bank_ammo[i] > swp->secondary_bank_start_ammo[i] )
swp->secondary_bank_ammo[i] = swp->secondary_bank_start_ammo[i];
}
}

} else
banks_full++;
}
} // end if (subsys_all_ok)

if ( banks_full == swp->num_secondary_banks ) {
aip->rearm_first_missile = TRUE;
}

int shields_full = 0;
if ( (objp->flags & OF_NO_SHIELDS) ) {
shields_full = 1;
} else {
if ( get_shield_strength(objp) >= sip->shields )
shields_full = 1;
}

// return 1 if at end of subsystem list, hull damage at 0, and shields full and all secondary banks full.
if ( (subsys_all_ok)&&(objp->hull_strength == sip->initial_hull_strength)&&(shields_full) ) {
// if ( subsys_all_ok && shields_full ) {

if ( objp == Player_obj ) {
player_stop_repair_sound();
}

if (!aip->rearm_release_delay)
aip->rearm_release_delay = timestamp(1200);

if ( banks_full == swp->num_secondary_banks ) {

if ( timestamp_elapsed(aip->rearm_release_delay) )
return 1;
}
else {
aip->rearm_release_delay = timestamp(1200);
}
}

return 0;
}
Title: my changes to fs2 source
Post by: phreak on July 26, 2002, 12:12:13 pm
DRAWS SHIP AS WIREFRAME IN TARGET BOX
starts line 1201 in hudtargetbox.cpp
Code: [Select]

// -------------------------------------------------------------------------------------
// hud_render_target_ship()
//
// Render a ship to the target monitor
//
void hud_render_target_ship(object *target_objp)
{
vector obj_pos = {0.0f,0.0f,0.0f};
vector camera_eye = {0.0f,0.0f,0.0f};
matrix camera_orient = IDENTITY_MATRIX;
ship *target_shipp;
ship_info *target_sip;
vector orient_vec, up_vector;
int sx, sy;
int subsys_in_view;
float factor;

target_shipp = &Ships[target_objp->instance];
target_sip = &Ship_info[target_shipp->ship_info_index];

if ( Detail.targetview_model ) {
// take the forward orientation to be the vector from the player to the current target
vm_vec_sub(&orient_vec, &target_objp->pos, &Player_obj->pos);
vm_vec_normalize(&orient_vec);

factor = -target_sip->closeup_pos.z;

// use the player's up vector, and construct the viewers orientation matrix
up_vector = Player_obj->orient.uvec;
vm_vector_2_matrix(&camera_orient,&orient_vec,&up_vector,NULL);

// normalize the vector from the player to the current target, and scale by a factor to calculate
// the objects position
vm_vec_copy_scale(&obj_pos,&orient_vec,factor);

// set camera eye to eye of ship relative to origin
// hud_targetbox_get_eye(&camera_eye, &camera_orient, Player_obj->instance);

hud_render_target_setup(&camera_eye, &camera_orient, target_sip->closeup_zoom);
// model_clear_instance(target_sip->modelnum);
ship_model_start( target_objp );


if (target_shipp->team==Player_ship->team)
{
model_set_outline_color(0,255,0);
}
else if (((Player_ship->team==TEAM_TRAITOR) && (target_shipp->team==TEAM_FRIENDLY)) ||
(target_shipp->team==TEAM_HOSTILE) || (target_shipp->team==TEAM_NEUTRAL))
{
model_set_outline_color(255,0,0);
}
else if (target_shipp->team==TEAM_UNKNOWN)
{
model_set_outline_color(255,0,255);
}

else
{
model_set_outline_color(255,255,255);
}


if (ship_is_tagged(target_objp))
{
model_set_outline_color(255,255,0);
}
// maybe render a special hud-target-only model
//if(target_sip->modelnum_hud >= 0){
// model_render( target_sip->modelnum_hud, &target_objp->orient, &obj_pos, MR_SHOW_OUTLINE | MR_NO_POLYS | MR_NO_LIGHTING | MR_LOCK_DETAIL | MR_AUTOCENTER);
//} else {
model_render( target_sip->modelnum, &target_objp->orient, &obj_pos, MR_SHOW_OUTLINE | MR_NO_POLYS | MR_NO_LIGHTING | MR_LOCK_DETAIL | MR_AUTOCENTER);
//}
ship_model_stop( target_objp );

sx = 0;
sy = 0;
// check if subsystem target has changed
if ( Player_ai->targeted_subsys == Player_ai->last_subsys_target ) {
vector save_pos;
save_pos = target_objp->pos;
target_objp->pos = obj_pos;
subsys_in_view = hud_targetbox_subsystem_in_view(target_objp, &sx, &sy);
target_objp->pos = save_pos;

if ( subsys_in_view != -1 ) {

// AL 29-3-98: If subsystem is destroyed, draw gray brackets
if ( (Player_ai->targeted_subsys->current_hits <= 0) && (strnicmp(NOX("fighter"), Player_ai->targeted_subsys->system_info->name, 7)) ) {
gr_set_color_fast(&IFF_colors[IFF_COLOR_MESSAGE][1]);
} else {
hud_set_iff_color( target_objp, 1 );
}

if ( subsys_in_view ) {
draw_brackets_square_quick(sx - 10, sy - 10, sx + 10, sy + 10);
} else {
draw_brackets_diamond_quick(sx - 10, sy - 10, sx + 10, sy + 10);
}
}
}
hud_render_target_close();
}
HUD_reset_clip();
hud_blit_target_foreground();
hud_blit_target_integrity(0,OBJ_INDEX(target_objp));

hud_render_target_ship_info(target_objp);
hud_maybe_render_cargo_scan(target_sip);
}
Title: my changes to fs2 source
Post by: phreak on July 26, 2002, 12:14:15 pm
DRAWS DEBRIS AS WIREFRAME IN TARGET BOX
starts line 1312 in hudtargetbox.cpp
Code: [Select]

// -------------------------------------------------------------------------------------
// hud_render_target_debris()
//
// Render a piece of debris on the target monitor
//
void hud_render_target_debris(object *target_objp)
{
vector obj_pos = {0.0f,0.0f,0.0f};
vector camera_eye = {0.0f,0.0f,0.0f};
matrix camera_orient = IDENTITY_MATRIX;
debris *debrisp;
vector orient_vec, up_vector;
int target_team, base_index;
float factor;

debrisp = &Debris[target_objp->instance];

//target_sip = &Ship_info[debrisp->ship_info_index];
target_team = obj_team(target_objp);


if ( Detail.targetview_model ) {
// take the forward orientation to be the vector from the player to the current target
vm_vec_sub(&orient_vec, &target_objp->pos, &Player_obj->pos);
vm_vec_normalize(&orient_vec);

factor = 2*target_objp->radius;

// use the player's up vector, and construct the viewers orientation matrix
up_vector = Player_obj->orient.uvec;
vm_vector_2_matrix(&camera_orient,&orient_vec,&up_vector,NULL);

// normalize the vector from the player to the current target, and scale by a factor to calculate
// the objects position
vm_vec_copy_scale(&obj_pos,&orient_vec,factor);

model_set_outline_color(255,255,255);
hud_render_target_setup(&camera_eye, &camera_orient, 0.5f);
model_clear_instance(debrisp->model_num);
submodel_render( debrisp->model_num, debrisp->submodel_num, &target_objp->orient, &obj_pos, MR_NO_POLYS | MR_SHOW_OUTLINE | MR_NO_LIGHTING | MR_LOCK_DETAIL );
hud_render_target_close();
}

HUD_reset_clip();
hud_blit_target_foreground();
hud_blit_target_integrity(1);
// hud_set_default_color();
hud_set_gauge_color(HUD_TARGET_MONITOR);

// take ship "copies" into account before printing out ship class information
base_index = debrisp->ship_info_index;
if ( Ship_info[base_index].flags & SIF_SHIP_COPY )
base_index = ship_info_base_lookup( debrisp->ship_info_index );

// print out ship class that debris came from
char *printable_ship_class = Ship_info[base_index].name;
if ( strstr(Ship_info[base_index].name, NOX("#")) ) {
char temp_name[NAME_LENGTH];
strcpy(temp_name, Ship_info[base_index].name);
hud_end_string_at_first_hash_symbol(temp_name);
printable_ship_class = temp_name;
}

emp_hud_string(Targetbox_coords[gr_screen.res][TBOX_CLASS][0], Targetbox_coords[gr_screen.res][TBOX_CLASS][1], EG_TBOX_CLASS, printable_ship_class);
emp_hud_string(Targetbox_coords[gr_screen.res][TBOX_NAME][0], Targetbox_coords[gr_screen.res][TBOX_NAME][1], EG_TBOX_NAME, XSTR( "debris", 348));
}
Title: my changes to fs2 source
Post by: phreak on July 26, 2002, 12:17:26 pm
DRAWS ASTEROID AS WIREFRAME IN TARGET BOX
starts line 759 in hudtargetbox.cpp
Code: [Select]

// -------------------------------------------------------------------------------------
// hud_render_target_asteroid()
//
// Render a piece of asteroid on the target monitor
//
void hud_render_target_asteroid(object *target_objp)
{
#ifndef FS2_DEMO
vector obj_pos = {0.0f,0.0f,0.0f};
vector camera_eye = {0.0f,0.0f,0.0f};
matrix camera_orient = IDENTITY_MATRIX;
asteroid *asteroidp;
vector orient_vec, up_vector;
int target_team;
float time_to_impact, factor;
int subtype;

asteroidp = &Asteroids[target_objp->instance];

target_team = obj_team(target_objp);

subtype = asteroidp->asteroid_subtype;

time_to_impact = asteroid_time_to_impact(target_objp);

if ( Detail.targetview_model ) {
// take the forward orientation to be the vector from the player to the current target
vm_vec_sub(&orient_vec, &target_objp->pos, &Player_obj->pos);
vm_vec_normalize(&orient_vec);

factor = 2*target_objp->radius;

// use the player's up vector, and construct the viewers orientation matrix
up_vector = Player_obj->orient.uvec;
vm_vector_2_matrix(&camera_orient,&orient_vec,&up_vector,NULL);

// normalize the vector from the player to the current target, and scale by a factor to calculate
// the objects position
vm_vec_copy_scale(&obj_pos,&orient_vec,factor);

hud_render_target_setup(&camera_eye, &camera_orient, 0.5f);
model_clear_instance(Asteroid_info[asteroidp->type].model_num[subtype]);

if (time_to_impact>=0)
model_set_outline_color(255,255,255);
else
model_set_outline_color(64,64,0);

model_render(Asteroid_info[asteroidp->type].model_num[subtype], &target_objp->orient, &obj_pos, MR_NO_POLYS| MR_SHOW_OUTLINE|MR_NO_LIGHTING | MR_LOCK_DETAIL );
hud_render_target_close();
}

HUD_reset_clip();
hud_blit_target_foreground();
hud_blit_target_integrity(1);
// hud_set_default_color();
hud_set_gauge_color(HUD_TARGET_MONITOR);

// hud print type of Asteroid (debris)
char hud_name[64];
switch (asteroidp->type) {
case ASTEROID_TYPE_SMALL:
case ASTEROID_TYPE_MEDIUM:
case ASTEROID_TYPE_BIG:
strcpy(hud_name, NOX("asteroid"));
break;

case DEBRIS_TERRAN_SMALL:
case DEBRIS_TERRAN_MEDIUM:
case DEBRIS_TERRAN_LARGE:
strcpy(hud_name, NOX("terran debris"));
break;

case DEBRIS_VASUDAN_SMALL:
case DEBRIS_VASUDAN_MEDIUM:
case DEBRIS_VASUDAN_LARGE:
strcpy(hud_name, NOX("vasudan debris"));
break;

case DEBRIS_SHIVAN_SMALL:
case DEBRIS_SHIVAN_MEDIUM:
case DEBRIS_SHIVAN_LARGE:
strcpy(hud_name, NOX("shivan debris"));
break;

default:
Int3();
}

emp_hud_printf(Targetbox_coords[gr_screen.res][TBOX_NAME][0], Targetbox_coords[gr_screen.res][TBOX_NAME][1], EG_TBOX_NAME, hud_name);


if ( time_to_impact >= 0 ) {
emp_hud_printf(Targetbox_coords[gr_screen.res][TBOX_CLASS][0], Targetbox_coords[gr_screen.res][TBOX_CLASS][1], EG_TBOX_CLASS, NOX("impact: %.1f sec"), time_to_impact);
}
#endif
}
Title: my changes to fs2 source
Post by: phreak on July 26, 2002, 12:24:58 pm
DRAWS WEAPON AS WIREFRAME IN TARGET BOX
starts line 1379 in hudtargetbox.cpp
Code: [Select]

// -------------------------------------------------------------------------------------
// hud_render_target_weapon()
//
// Render a missile or a missile view to the target monitor
//
void hud_render_target_weapon(object *target_objp)
{
vector obj_pos = {0.0f,0.0f,0.0f};
vector camera_eye = {0.0f,0.0f,0.0f};
matrix camera_orient = IDENTITY_MATRIX;
vector orient_vec, up_vector;
weapon_info *target_wip = NULL;
weapon *wp = NULL;
object *viewer_obj, *viewed_obj;
int target_team, is_homing, is_player_missile, missile_view, viewed_model_num, w, h;
float factor;
char outstr[100]; // temp buffer

target_team = obj_team(target_objp);

wp = &Weapons[target_objp->instance];
target_wip = &Weapon_info[wp->weapon_info_index];

is_homing = FALSE;
if ( target_wip->wi_flags & WIF_HOMING && wp->homing_object != &obj_used_list )
is_homing = TRUE;

is_player_missile = FALSE;
if ( target_objp->parent_sig == Player_obj->signature ) {
is_player_missile = TRUE;
}

if ( Detail.targetview_model ) {

viewer_obj = Player_obj;
viewed_obj = target_objp;
missile_view = FALSE;
viewed_model_num = target_wip->model_num;
if ( is_homing && is_player_missile ) {
viewer_obj = target_objp;
viewed_obj = wp->homing_object;
missile_view = TRUE;
viewed_model_num = Ships[wp->homing_object->instance].modelnum;
}

if (target_team==Player_ship->team)
{
model_set_outline_color(0,255,0);
}
else if (((Player_ship->team==TEAM_TRAITOR) && (target_team==TEAM_FRIENDLY)) ||
(target_team==TEAM_HOSTILE) || (target_team==TEAM_NEUTRAL))
{
model_set_outline_color(128,128,0);
}
else if (target_team==TEAM_UNKNOWN)
{
model_set_outline_color(255,0,255);
}
else
{
model_set_outline_color(255,255,255);
}


// take the forward orientation to be the vector from the player to the current target
vm_vec_sub(&orient_vec, &viewed_obj->pos, &viewer_obj->pos);
vm_vec_normalize(&orient_vec);

if ( missile_view == FALSE )
factor = 2*target_objp->radius;
else
factor = vm_vec_dist_quick(&viewer_obj->pos, &viewed_obj->pos);

// use the viewer's up vector, and construct the viewers orientation matrix
up_vector = viewer_obj->orient.uvec;
vm_vector_2_matrix(&camera_orient,&orient_vec,&up_vector,NULL);

// normalize the vector from the viewer to the viwed target, and scale by a factor to calculate
// the objects position
vm_vec_copy_scale(&obj_pos,&orient_vec,factor);

hud_render_target_setup(&camera_eye, &camera_orient, View_zoom/3);
model_clear_instance(viewed_model_num);

model_render( viewed_model_num, &viewed_obj->orient, &obj_pos, MR_NO_POLYS | MR_SHOW_OUTLINE | MR_NO_LIGHTING | MR_LOCK_DETAIL | MR_AUTOCENTER);
hud_render_target_close();
}

HUD_reset_clip();
if ( is_homing == TRUE ) {
hud_blit_target_foreground();
} else {
hud_blit_target_foreground();
}

hud_blit_target_integrity(1);
// hud_set_default_color();
hud_set_gauge_color(HUD_TARGET_MONITOR);

// print out the weapon class name
sprintf( outstr,"%s", target_wip->name );
gr_get_string_size(&w,&h,outstr);

// drop name past the # sign
if ( strstr(outstr, NOX("#")) ) {
hud_end_string_at_first_hash_symbol(outstr);
}
emp_hud_string(Targetbox_coords[gr_screen.res][TBOX_NAME][0], Targetbox_coords[gr_screen.res][TBOX_NAME][1], EG_TBOX_NAME, outstr);

// If a homing weapon, show time to impact
if ( is_homing ) {
float dist, speed;

dist = vm_vec_dist(&target_objp->pos, &wp->homing_object->pos);
speed = vm_vec_mag(&target_objp->phys_info.vel);
if ( speed > 0 ) {
sprintf(outstr, NOX("impact: %.1f sec"), dist/speed);
} else {
sprintf(outstr, XSTR( "unknown", 349));
}

emp_hud_string(Targetbox_coords[gr_screen.res][TBOX_CLASS][0], Targetbox_coords[gr_screen.res][TBOX_CLASS][1], EG_TBOX_CLASS, outstr);
}
}
Title: my changes to fs2 source
Post by: WMCoolmon on July 29, 2002, 01:35:37 pm
:bump:
These look like they should be tossed in the source code... I can make an option to turn the support ship option on and off, if we're worried about game balance :nod:
The modifications to view things as wireframes should probably be set up so they can be toggled with a keystroke, as there may be some people who want to look at the picture instead :D
Title: my changes to fs2 source
Post by: Tiara on July 29, 2002, 01:38:04 pm
This is just like TCO's work... It freaks me out to see so much code... He always has about 16-20 pages of code on his computer with wich he works....

And I haven't even seen the full code of this...
Title: my changes to fs2 source
Post by: WMCoolmon on July 29, 2002, 01:41:22 pm
Quote
Copyright (C) Volition, Inc. 1999.  All rights reserved.

All source code herein is the property of Volition, Inc. You may not sell
or otherwise commercially exploit the source or things you created based on the
source.

Counts for various words in the code
------------------------------------

fixed        :  2169

bogus        :  350
hack         :  157
whee         :  145
cool         :  76
stupid       :  57
tweak        :  43
broken       :  41
dumb         :  28
fish         :  25
broke        :  22
nasty        :  21
yay          :  21
efficient    :  20
complex      :  20
ugly         :  13
nicely       :  13
great        :  11
silly        :  9
fixme        :  9
smart        :  8
ugh          :  7
confused     :  6
insane       :  5
whoops       :  4
awesome      :  3
fancy        :  2
horrible     :  2
brute force  :  2
sucks        :  2
hateful      :  1
speedy       :  1
badly        :  1
painful      :  1
intense      :  1

Total lines of source :

.cpp files  :  394,813
.h files    :  64,187
total       :  459,000


Total lines of source, not counting comments :

.cpp files  :  287,553
.h files    :  36,163
total       :  323,716
Title: my changes to fs2 source
Post by: Stunaep on July 29, 2002, 01:49:53 pm
the wireframe thing seems like a cool addition. I do hope you include it.
Title: my changes to fs2 source
Post by: Inquisitor on July 29, 2002, 01:58:20 pm
Wm's approach is right, toggling, etc.

I'm game for this to go in, so long as those conditions are met :)
Title: my changes to fs2 source
Post by: phreak on July 29, 2002, 02:19:04 pm
Quote
Originally posted by WMCoolmon
I can make an option to turn the support ship option on and off, if we're worried about game balance :nod:


Lets just say it saved me more than once when i was at 1% health

maybe we could turn this on/off via:

1. FRED option (like disable support)
2. Tables - add "$repair:" entry in ships table if its a support ship
3. Command line argument "-ssrepair"
Title: my changes to fs2 source
Post by: Stunaep on July 29, 2002, 02:34:25 pm
FRED option looks best -  that way the hull repairing sup ship can be used fairly well in a campaign (like having a part of the campaign without hull repair, then bringing it in as a revolution in ship repairs.)
Title: my changes to fs2 source
Post by: WMCoolmon on July 29, 2002, 06:10:47 pm
The old Mission Specs dialog is getting too cramped...here's my idea for a slight rearranging of it:
(http://members.cox.net/~wmcoolmon/images/misspec.gif)
Title: my changes to fs2 source
Post by: ##UnknownPlayer## on July 30, 2002, 09:11:58 am
I like it - go for it!
Title: my changes to fs2 source
Post by: Inquisitor on July 30, 2002, 09:18:11 am
Looks solid to me, lets get it in there :)
Title: my changes to fs2 source
Post by: penguin on July 30, 2002, 11:11:29 am
Has the mission parser code been updated to handle the new tags?  Will the current (commercially released) Freespace break if it gets an unknown tag in the mission file?

just curious...
Title: my changes to fs2 source
Post by: WMCoolmon on July 30, 2002, 12:29:05 pm
Quote
Has the mission parser code been updated to handle the new tags?

Not yet, but it's easy enough (Add a new define, that's pretty much it)
EDIT: Reread penguin's post- To clarify, ship trails have been added, and the support ship flag has just been added.

Quote
Will the current (commercially released) Freespace break if it gets an unknown tag in the mission file?

It shouldn't, because the mission parser loads the ship flags variable, but the actual function determines what to do. For example, assuming the #define is set, the code would be rewritten as this:
Code: [Select]

if(The_mission.flags & MISSION_FLAG_SUPPORT_REPAIR){
objp->hull_strength += repair_allocated;
if ( objp->hull_strength > sip->initial_hull_strength ) {
repair_allocated -= ( sip->initial_hull_strength - objp->hull_strength);
objp->hull_strength = sip->initial_hull_strength;
}
}
Title: my changes to fs2 source
Post by: Inquisitor on August 03, 2002, 12:21:38 pm
This is all getting committed.
Title: my changes to fs2 source
Post by: penguin on August 03, 2002, 05:25:03 pm
Cool.  I just now realized you were changing the flags, which is a numeric value... I thought you were adding something like
Code: [Select]
$SupportShipRepairsHull: 1
$EnableContrails: 1
which would probably break something...

Can I mention (yet again) how much I hate the FS2 tbl "structure" ? :mad:  One of these days I'll rewrite it all in XML :devilidea
Title: my changes to fs2 source
Post by: vyper on August 03, 2002, 05:47:08 pm
Quote
Originally posted by penguin
Cool.  I just now realized you were changing the flags, which is a numeric value... I thought you were adding something like
Code: [Select]
$SupportShipRepairsHull: 1
$EnableContrails: 1
which would probably break something...

Can I mention (yet again) how much I hate the FS2 tbl "structure" ? :mad:  One of these days I'll rewrite it all in XML :devilidea [/B]



*Gains sudden nervous twitch*
Title: my changes to fs2 source
Post by: penguin on August 03, 2002, 06:03:01 pm
Quote
Originally posted by vyper
*Gains sudden nervous twitch*
I didn't say I was going to do it today... ;)
Title: my changes to fs2 source
Post by: WMCoolmon on August 03, 2002, 08:02:57 pm
The flag tells whether the support ship repairs the hull or not, the variable in the TBL file would specify how much it repairs per unit of time-assuming it's implemented. :yes:
Title: my changes to fs2 source
Post by: phreak on August 04, 2002, 10:29:21 pm
it toggles!  use CTRL-SHIFT-Q
(CTRL-SHIFT-W was a wingman command)

(http://xphr34kx.tripod.com/no_wire.txt)
(http://xphr34kx.tripod.com/wire.txt)

WM: if you can get the mission parse file up, i could finish off the support ship real quick
Title: my changes to fs2 source
Post by: Doc Oc on August 05, 2002, 10:21:25 am
Quote
Originally posted by WMCoolmon
The old Mission Specs dialog is getting too cramped...here's my idea for a slight rearranging of it:
(http://members.cox.net/~wmcoolmon/images/misspec.gif)

With the amount of options likely to be added over time, I think this calls for a scrollable checklist control, or a property list (the stringgrid thingie where the right column turns into an edit or a combobox when it gets focus).

This avoids having to re-design the options dialog over and over again.


What would probably be even better is the more recent development in dialog box design where you have a tree control on the left, and a multi-page dialog as a main area. Selecting a category in the tree opens the corresponding dialog page.

Of course, someone will have to go in and code it :).
Title: my changes to fs2 source
Post by: Bobboau on August 05, 2002, 10:45:26 am
can you get a wire frame overlay and a normal model render
Title: my changes to fs2 source
Post by: Doc Oc on August 05, 2002, 10:53:23 am
Quote
Originally posted by Bobboau
can you get a wire frame overlay and a normal model render

You mean a textured model with fatter wires? That could be pretty cool indeed :).
Title: my changes to fs2 source
Post by: phreak on August 05, 2002, 12:08:39 pm
Quote
Originally posted by Bobboau
can you get a wire frame overlay and a normal model render


(http://xphr34kx.tripod.com/tex_wire.txt)
Title: my changes to fs2 source
Post by: Fineus on August 05, 2002, 12:20:15 pm
Now that looks really sweet! (Make it an option in the options menu though?).
Title: my changes to fs2 source
Post by: phreak on August 05, 2002, 12:22:45 pm
we're planning on doing an options menu thing long-term.  Right now its CTRL+SHIFT+Q
Title: my changes to fs2 source
Post by: WMCoolmon on August 05, 2002, 01:24:42 pm
Quote
Originally posted by Doc Oc
scrollable checklist control

:confused:
Quote
a property list (the stringgrid thingie where the right column turns into an edit or a combobox when it gets focus).

semi-:confused:

Screenshots? Better description?
Title: my changes to fs2 source
Post by: Doc Oc on August 05, 2002, 01:52:49 pm
Checklist:
(http://www.planethalflife.com/whiplash/misc/checklist.gif)
As the list of items grows, a vertical scrollbar will apear. Infinitely expandable, without having to constantly re-design the form.

Property list:
(http://www.planethalflife.com/whiplash/misc/propertylist.gif)
Here's the Object Inspector from Delphi 6, to illustrate the idea. Depending on the datatype, the data entry box will be a n edit control, a combobox or a button to launch a dialog box.

On second thought, for use in Fred, the propertylist probably isn't a good idea. The treeview/multipage dialog that I described would work a lot better I think.
Title: my changes to fs2 source
Post by: phreak on August 06, 2002, 11:54:17 am
changes committed.. have fun
Title: my changes to fs2 source
Post by: phreak on September 01, 2002, 08:15:14 pm
i added another feature that probably doesn't deserve its own thread so put it here.

if you're using dumbfire missiles, a lead indicator is now displayed for them as a triangle leaving the primaries to use a circle.

only really useful if the dumbfire and laser have totally different speeds.

right now its showing a kayser and tempest which have ~300m/s velocity difference at a range of 128m

(http://xphr34kx.tripod.com/LIDF.txt)
Title: my changes to fs2 source
Post by: Bobboau on September 01, 2002, 08:48:10 pm
oh yes, I was planing to try something like this, what were the code changes
we need a drool smilie

what is the diferen't code changes for wire fram and wireframe+textured