View Issue Details

IDProjectCategoryView StatusLast Update
0002679FSSCPphysicspublic2012-10-30 19:31
ReporterAndrewofDoom Assigned ToThe_E  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Summary0002679: Weapons fired do not inherit parent collision group.
DescriptionWhenever weapons are fired of a ship and a target ship, both of which are in the same collision group, the weapons will still hit the ship despite the ships being able to flying right through each other.
Steps To Reproduce1. Make a mission where you, the player, and a target ship are in the same collision group.
2. Shoot the ship and watch the shots impact, but you can fly through it.
TagsNo tags attached.

Activities

AndrewofDoom

2012-07-05 15:38

reporter   ~0013833

After some talk, I would think it'd be best to have this as a mod.tbl option, because Diaspora might hate my guts otherwise.

Echelon9

2012-08-19 09:19

developer   ~0013922

Isn't this less about situations where the target ship is part of the same collision group, and instead a collision just happens to occur with part of the attacker ship's collision group, on the way towards the target ship?

Echelon9

2012-08-19 09:55

developer   ~0013923

Suggested patch from The_E

The_E

2012-08-19 09:59

administrator  

weaponcolgroup.patch (2,137 bytes)   
Index: globalincs/def_files.cpp
===================================================================
--- globalincs/def_files.cpp	(revision 9123)
+++ globalincs/def_files.cpp	(working copy)
@@ -156,6 +156,9 @@
 ;; used when no ani is specified or weapon_select_3d is active			\n\
 $Default weapon select effect: FS2										\n\
 																		\n\
+;; Enable weapons to inherit their parent object's collision group setting \n\
+$Weapons inherit parent collision group: NO								\n\
+																		\n\
 #END																	\n\
 ";
 
Index: mod_table/mod_table.cpp
===================================================================
--- mod_table/mod_table.cpp	(revision 9123)
+++ mod_table/mod_table.cpp	(working copy)
@@ -22,6 +22,7 @@
 int Default_weapon_select_effect = 0;
 bool Enable_external_shaders = false;
 bool Full_color_head_anis = false;
+bool Weapons_inherit_parent_collision_group = false;
 
 
 void parse_mod_table(char *filename)
@@ -162,6 +163,12 @@
 			Default_weapon_select_effect = 0;
 	}
 
+	if (optional_string("$Weapons inherit parent collision group")) {
+		stuff_boolean(&Weapons_inherit_parent_collision_group);
+		if (Weapons_inherit_parent_collision_group)
+			mprintf(("Game Settings Table: Weapons inherit parent collision group\n"));
+	}
+
 	required_string("#END");
 
 	// close localization
Index: mod_table/mod_table.h
===================================================================
--- mod_table/mod_table.h	(revision 9123)
+++ mod_table/mod_table.h	(working copy)
@@ -19,5 +19,6 @@
 extern int Default_weapon_select_effect;
 extern bool Enable_external_shaders;
 extern bool Full_color_head_anis;
+extern bool Weapons_inherit_parent_collision_group;
 
 void mod_table_init();
Index: weapon/weapons.cpp
===================================================================
--- weapon/weapons.cpp	(revision 9123)
+++ weapon/weapons.cpp	(working copy)
@@ -5233,6 +5233,10 @@
 		wp->damage_ship_id[i] = -1;
 	}
 
+	if (Weapons_inherit_parent_collision_group) {
+		Objects[objnum].collision_group_id = Objects[parent_objnum].collision_group_id;
+	}
+
 	return objnum;
 }
 
weaponcolgroup.patch (2,137 bytes)   

iss_mneur

2012-09-11 03:50

developer   ~0013960

This patch appears fine to me. The defaults are correct, so it is question of does this work for AndrewOfDoom, otherwise it should be committed (if you require a build with this fix please say so).

The_E

2012-10-30 19:30

administrator   ~0014004

Patch committed to svn @9293

Issue History

Date Modified Username Field Change
2012-07-04 20:59 AndrewofDoom New Issue
2012-07-05 15:38 AndrewofDoom Note Added: 0013833
2012-08-19 09:19 Echelon9 Note Added: 0013922
2012-08-19 09:55 Echelon9 File Added: 2679.patch
2012-08-19 09:55 Echelon9 Note Added: 0013923
2012-08-19 09:55 Echelon9 Assigned To => Echelon9
2012-08-19 09:55 Echelon9 Status new => code review
2012-08-19 09:57 Echelon9 File Deleted: 2679.patch
2012-08-19 09:59 The_E File Added: weaponcolgroup.patch
2012-09-11 03:50 iss_mneur Note Added: 0013960
2012-09-11 03:50 iss_mneur Status code review => assigned
2012-10-29 20:27 Echelon9 Status assigned => code review
2012-10-30 19:30 The_E Note Added: 0014004
2012-10-30 19:31 The_E Assigned To Echelon9 => The_E
2012-10-30 19:31 The_E Status code review => assigned
2012-10-30 19:31 The_E Status assigned => resolved
2012-10-30 19:31 The_E Resolution open => fixed