Author Topic: my changes to fs2 source  (Read 8866 times)

0 Members and 1 Guest are viewing this topic.

Offline phreak

  • Gun Phreak
  • 211
  • -1
my changes to fs2 source
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;
}
« Last Edit: July 26, 2002, 02:38:11 pm by 31 »
Offically approved by Ebola Virus Man :wtf:
phreakscp - gtalk
phreak317#7583 - discord

 

Offline phreak

  • Gun Phreak
  • 211
  • -1
my changes to fs2 source
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);
}
Offically approved by Ebola Virus Man :wtf:
phreakscp - gtalk
phreak317#7583 - discord

 

Offline phreak

  • Gun Phreak
  • 211
  • -1
my changes to fs2 source
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));
}
Offically approved by Ebola Virus Man :wtf:
phreakscp - gtalk
phreak317#7583 - discord

 

Offline phreak

  • Gun Phreak
  • 211
  • -1
my changes to fs2 source
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
}
Offically approved by Ebola Virus Man :wtf:
phreakscp - gtalk
phreak317#7583 - discord

 

Offline phreak

  • Gun Phreak
  • 211
  • -1
my changes to fs2 source
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);
}
}
Offically approved by Ebola Virus Man :wtf:
phreakscp - gtalk
phreak317#7583 - discord

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
my changes to fs2 source
: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
« Last Edit: July 29, 2002, 01:39:36 pm by 374 »
-C

 

Offline Tiara

  • Mrs. T, foo'!
  • 210
my changes to fs2 source
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...
I AM GOD! AND I SHALL SMITE THEE!



...because I can :drevil:

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
my changes to fs2 source
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
-C

 

Offline Stunaep

  • Thread Necrotech.... we bring the dead to life!
  • 210
my changes to fs2 source
the wireframe thing seems like a cool addition. I do hope you include it.
"Post-counts are like digital penises. That's why I don't like Shrike playing with mine." - an0n
Bah. You're an admin, you've had practice at this spanking business. - Odyssey

 

Offline Inquisitor

my changes to fs2 source
Wm's approach is right, toggling, etc.

I'm game for this to go in, so long as those conditions are met :)
No signature.

 

Offline phreak

  • Gun Phreak
  • 211
  • -1
my changes to fs2 source
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"
Offically approved by Ebola Virus Man :wtf:
phreakscp - gtalk
phreak317#7583 - discord

 

Offline Stunaep

  • Thread Necrotech.... we bring the dead to life!
  • 210
my changes to fs2 source
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.)
"Post-counts are like digital penises. That's why I don't like Shrike playing with mine." - an0n
Bah. You're an admin, you've had practice at this spanking business. - Odyssey

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
my changes to fs2 source
The old Mission Specs dialog is getting too cramped...here's my idea for a slight rearranging of it:
-C

 
my changes to fs2 source
I like it - go for it!

 

Offline Inquisitor

my changes to fs2 source
Looks solid to me, lets get it in there :)
No signature.

 

Offline penguin

  • Eudyptes codus
  • 28
  • Still alive.
my changes to fs2 source
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...
your source code slave

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
my changes to fs2 source
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;
}
}
« Last Edit: July 30, 2002, 12:37:13 pm by 374 »
-C

 

Offline Inquisitor

This is all getting committed.
No signature.

 

Offline penguin

  • Eudyptes codus
  • 28
  • Still alive.
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
your source code slave

 

Offline vyper

  • 210
  • The Sexy Scotsman
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*
"But you live, you learn.  Unless you die.  Then you're ****ed." - aldo14