fix hud comm message screwups (missing support ship, no coverme, etc) that was part :V: bug and (bigger) part Ship_types related bug

This commit is contained in:
taylor committed 2006-01-13 11:09:45 +00:00
1 parent d0f071692f
commit 5f3a6ec743
4 files changed
+78 -57

No files matched your search

+23
View File
@@ -254,6 +254,29 @@ $AI:\n\
+Turrets attack this: YES\n\
+Active docks: (\"support\")\n\
\n\
;; taylor - same as support ship above but this works with retail tables\n\
""$Name: repair_rearm\n\
$Counts for Alone: YES\n\
$Praise Destruction: YES\n\
$On Hotkey List: YES\n\
$Target as Threat: YES\n\
$Show Attack Direction: YES\n\
$Warp Pushable: YES\n\
$Max Debris Speed: 200\n\
$FF Multiplier: 1.0\n\
$EMP Multiplier: 3.5\n\
$Fog:\n\
+Start dist: 10.0\n\
+Compl dist: 500.0\n\
$AI:\n\
+Valid goals: (\"fly to ship\" \"dock\" \"undock\" \"waypoints\" \"waypoints once\" \"stay near ship\" \"keep safe dist\" \"stay still\" \"play dead\")\n\
+Accept Player Orders: YES\n\
+Player orders: (\"rearm me\" \"abort rearm\" \"stay near me\" \"stay near ship\" \"keep safe dist\" \"depart\")\n\
+Auto attacks: YES\n\
+Guards attack this: YES\n\
+Turrets attack this: YES\n\
+Active docks: (\"support\")\n\
\n\
;;WMC - Stealth ships always have another type, so this isn't used\n\
""$Name: Stealth\n\
$Counts for Alone: YES\n\
+21 -20
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Hud/HUDsquadmsg.cpp $
* $Revision: 2.22 $
* $Date: 2006-01-13 03:30:59 $
* $Author: Goober5000 $
* $Revision: 2.23 $
* $Date: 2006-01-13 11:09:45 $
* $Author: taylor $
*
* File to control sqaudmate messaging
*
* $Log: not supported by cvs2svn $
* Revision 2.22 2006/01/13 03:30:59 Goober5000
* übercommit of custom IFF stuff :)
*
* Revision 2.21 2006/01/10 18:37:46 randomtiger
* Improvements to voice recognition system.
* Also function put on -voicer launcher option.
@@ -489,32 +492,27 @@ char *type_select_str(int n)
// note: If you change this table at all, keep it in sync with version in IgnoreOrdersDlg.cpp
// Also make sure you update comm_order_menu_text below this.
// Also make sure you update MAX_SHIP_ORDERS in HUDsquadmsg.h
comm_order Comm_orders[] = {
{ "Attack ship", ATTACK_TARGET_ITEM },
{ "Disable ship", DISABLE_TARGET_ITEM },
{ "Disarm ship", DISARM_TARGET_ITEM },
{ "Attack subsys", DISABLE_SUBSYSTEM_ITEM },
{ "Disable subsys", DISABLE_SUBSYSTEM_ITEM },
{ "Guard ship", PROTECT_TARGET_ITEM },
{ "Ignore ship", IGNORE_TARGET_ITEM },
{ "Form on wing", FORMATION_ITEM },
{ "Guard me", COVER_ME_ITEM },
{ "Cover me", COVER_ME_ITEM },
{ "Attack any", ENGAGE_ENEMY_ITEM },
{ "Dock", CAPTURE_TARGET_ITEM },
{ "Rearm me", REARM_REPAIR_ME_ITEM },
{ "Abort rearm", ABORT_REARM_REPAIR_ITEM },
{ "Depart", DEPART_ITEM },
//WMC - These don't appear for some reason
//support-ship-only
{ "stay near me", STAY_NEAR_ME_ITEM},
{ "stay near ship", STAY_NEAR_TARGET_ITEM},
{ "keep safe dist", KEEP_SAFE_DIST_ITEM},
//All ships
{ "Disable subsys", DISABLE_SUBSYSTEM_ITEM},
// all ships
{ "Depart", DEPART_ITEM },
};
int Num_valid_comm_orders = 13; //WMC - Number of orders that acutally appear.
int Num_comm_orders = sizeof(Comm_orders)/sizeof(comm_order);
const int Num_comm_orders = sizeof(Comm_orders)/sizeof(comm_order);
// Text to display on the menu
// Given an index into the Comm_orders array, return the text associated with it.
@@ -537,7 +535,10 @@ char *comm_order_menu_text(int index)
case 9: return XSTR( "Capture my target", 308); break;
case 10: return XSTR( "Rearm me", 309); break;
case 11: return XSTR( "Abort rearm", 310); break;
case 12: return XSTR( "Depart", 311); break;
case 12: return XSTR( "Stay near me", -1); break;
case 13: return XSTR( "Stay near target", -1); break;
case 14: return XSTR( "Keep safe distance", -1); break;
case 15: return XSTR( "Depart", 311); break;
default:
Assert(0);
}
@@ -549,7 +550,7 @@ char *comm_order_hotkey_text( int index )
{
int i;
for (i = 0; i < Num_valid_comm_orders; i++ ) {
for (i = 0; i < Num_comm_orders; i++ ) {
if ( Comm_orders[i].def == index )
return comm_order_menu_text(i);
}
@@ -1282,11 +1283,11 @@ int hud_squadmsg_is_target_order_valid(int order, int find_order, ai_info *aip )
// find the comm_menu item for this command
if ( find_order ) {
for (i = 0; i < Num_valid_comm_orders; i++ ) {
for (i = 0; i < Num_comm_orders; i++ ) {
if ( Comm_orders[i].def == order )
break;
}
Assert( i < Num_valid_comm_orders );
Assert( i < Num_comm_orders );
order = i;
}
@@ -2360,7 +2361,7 @@ void hud_squadmsg_ship_command()
First_menu_item = 0;
Num_menu_items = 0;
for ( i = 0; i < Num_valid_comm_orders; i++ ) {
for ( i = 0; i < Num_comm_orders; i++ ) {
// check to see if the comm order should even be added to the menu -- if so, then add it
// the order will be activated if the bit is set for the ship.
if ( default_orders & Comm_orders[i].def ) {
@@ -2457,7 +2458,7 @@ void hud_squadmsg_wing_command()
Num_menu_items = 0;
orders = Ships[wingp->ship_index[0]].orders_accepted; // get the orders that the first ship in the wing will accept
for ( i = 0; i < Num_valid_comm_orders; i++ ) {
for ( i = 0; i < Num_comm_orders; i++ ) {
// add the set of default orders to the comm menu. We will currently allow all messages
// to be available in the wing.
if ( default_orders & Comm_orders[i].def ) {
@@ -2829,7 +2830,7 @@ int hud_query_order_issued(char *name, char *order, char *target)
if (target)
t = get_parse_name_index(target);
for (i=0; i<Num_valid_comm_orders; i++)
for (i=0; i<Num_comm_orders; i++)
if (!stricmp(order, comm_order_menu_text(i)) )
o = Comm_orders[i].def;
+25 -23
View File
@@ -9,13 +9,17 @@
/*
* $Logfile: /Freespace2/code/Hud/HUDsquadmsg.h $
* $Revision: 2.10 $
* $Date: 2006-01-10 18:37:46 $
* $Author: randomtiger $
* $Revision: 2.11 $
* $Date: 2006-01-13 11:09:45 $
* $Author: taylor $
*
* header file for squadmate messaging
*
* $Log: not supported by cvs2svn $
* Revision 2.10 2006/01/10 18:37:46 randomtiger
* Improvements to voice recognition system.
* Also function put on -voicer launcher option.
*
* Revision 2.9 2006/01/03 17:07:10 randomtiger
* Added voice recognition functionality for Visual C6 project only.
* Currently still a work in progress.
@@ -185,35 +189,33 @@ struct object;
// defines for messages that can be sent from the player. Defined at bitfields so that we can enable
// and disable messages on a message by message basis
#define ATTACK_TARGET_ITEM (1<<0)
#define DISABLE_TARGET_ITEM (1<<1)
#define DISARM_TARGET_ITEM (1<<2)
#define PROTECT_TARGET_ITEM (1<<3)
#define IGNORE_TARGET_ITEM (1<<4)
#define FORMATION_ITEM (1<<5)
#define COVER_ME_ITEM (1<<6)
#define ENGAGE_ENEMY_ITEM (1<<7)
#define CAPTURE_TARGET_ITEM (1<<8)
#define ATTACK_TARGET_ITEM (1<<0)
#define DISABLE_TARGET_ITEM (1<<1)
#define DISARM_TARGET_ITEM (1<<2)
#define DISABLE_SUBSYSTEM_ITEM (1<<3)
#define PROTECT_TARGET_ITEM (1<<4)
#define IGNORE_TARGET_ITEM (1<<5)
#define FORMATION_ITEM (1<<6)
#define COVER_ME_ITEM (1<<7)
#define ENGAGE_ENEMY_ITEM (1<<8)
#define CAPTURE_TARGET_ITEM (1<<9)
// the next are for the support ship only
#define REARM_REPAIR_ME_ITEM (1<<9)
#define ABORT_REARM_REPAIR_ITEM (1<<10)
#define STAY_NEAR_ME_ITEM (1<<11)
#define STAY_NEAR_TARGET_ITEM (1<<12)
#define KEEP_SAFE_DIST_ITEM (1<<13)
#define REARM_REPAIR_ME_ITEM (1<<10)
#define ABORT_REARM_REPAIR_ITEM (1<<11)
#define STAY_NEAR_ME_ITEM (1<<12)
#define STAY_NEAR_TARGET_ITEM (1<<13)
#define KEEP_SAFE_DIST_ITEM (1<<14)
// next item for all ships again -- to try to preserve relative order within the message menu
#define DEPART_ITEM (1<<14)
#define DISABLE_SUBSYSTEM_ITEM (1<<15)
#define DEPART_ITEM (1<<15)
//WMC - Just change Comm_orders.
//I hate to leave this MAX_ here, but it's easier for checking flags.
#define MAX_SHIP_ORDERS 13 // Must sync correctly with Comm_orders array in HUDsquadmsg.cpp
// data structure to hold character string of commands for comm menu
typedef flag_def_list comm_order;
extern comm_order Comm_orders[];
extern int Num_comm_orders;
extern const int Num_comm_orders;
// following defines are the set of possible commands that can be given to a ship. A mission designer
// might not allow some messages
+9 -14
View File
@@ -10,13 +10,16 @@
/*
* $Logfile: /Freespace2/code/Ship/Ship.cpp $
* $Revision: 2.293 $
* $Date: 2006-01-13 03:30:59 $
* $Author: Goober5000 $
* $Revision: 2.294 $
* $Date: 2006-01-13 11:09:45 $
* $Author: taylor $
*
* Ship (and other object) handling functions
*
* $Log: not supported by cvs2svn $
* Revision 2.293 2006/01/13 03:30:59 Goober5000
* übercommit of custom IFF stuff :)
*
* Revision 2.292 2006/01/09 04:54:14 phreak
* Remove tertiary weapons in their current form, I want something more flexable instead of what I had there.
*
@@ -3084,18 +3087,10 @@ strcpy(parse_error_text, temp_error);
{
char ship_strings[MAX_SHIP_FLAGS][NAME_LENGTH];
int num_strings = stuff_string_list(ship_strings, MAX_SHIP_FLAGS);
int new_type_idx = -1;
int last_recogged_type = -1; //So we can keep track of types
for ( i=0; i<num_strings; i++ )
{
new_type_idx = ship_type_name_lookup(ship_strings[i]);
if(new_type_idx > -1) {
//WMC - only set if this particular entry doesn't have a preceding value
if(last_recogged_type < 0) {
sip->class_type = new_type_idx;
}
//K so we know this type
last_recogged_type = i;
if (sip->class_type < 0) {
sip->class_type = ship_type_name_lookup(ship_strings[i]);
}
if (!stricmp(NOX("no_collide"), ship_strings[i]))
@@ -3166,7 +3161,7 @@ strcpy(parse_error_text, temp_error);
sip->flags2 |= SIF2_GENERATE_HUD_ICON;
else if( !stricmp( NOX("no weapon damage scaling"), ship_strings[i]))
sip->flags2 |= SIF2_DISABLE_WEAP_DAMAGE_SCALING;
else if(last_recogged_type != i)
else
Warning(LOCATION, "Bogus string in ship flags: %s\n", ship_strings[i]);
}