2019-12-09 18:40 EST


View Issue Details Jump to Notes ] Related Changesets ]
IDProjectCategoryView StatusLast Update
0002999FSSCPSEXPspublic2014-07-21 21:01
ReporterDarth Geek 
Assigned ToGoober5000 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusresolvedResolutionfixed 
PlatformAllOSAllOS VersionAll
Product Version3.7.1 
Target Version3.7.2Fixed in Version3.7.2 
Summary0002999: has-docked-delay and has-undocked-delay do not detect support ship docking
DescriptionContains a better explanation and pastebinned test mission:

http://www.hard-light.net/forums/index.php?topic=86551.msg1729202#msg1729202
Steps To ReproduceUse when-argument to try to detect a support ship docking via has-docked-delay or has-undocked-delay. Events are given in the forum post.
Additional InformationFrom IRC:

<Karajorma> The issue is that support ship docking isn't written to the mission log
<Karajorma> Since it's never written there, the SEXP can't find any proof that the ships ever docked
<Karajorma> So the SEXP failed
<Karajorma> If you could mantis the issue,, I'd like to ask for Goober's opinion before I fix it.
TagsNo tags attached.
Attached Files
  • patch file icon Mantis2999-aicode.cpp.patch (1,891 bytes) 2014-07-17 23:01 -
    Index: code/ai/aicode.cpp
    ===================================================================
    --- code/ai/aicode.cpp	(revision 10924)
    +++ code/ai/aicode.cpp	(working copy)
    @@ -10845,12 +10845,17 @@
     		{
     			// call the ai_abort rearm request code
     			ai_abort_rearm_request( Pl_objp );
    +			// Goober5000 - add missionlog for support ships, per Mantis #2999
    +			mission_log_add_entry(LOG_SHIP_UNDOCKED, shipp->ship_name, goal_shipp->ship_name);
     		}
     		//	Make sure repair has not broken off.
     		else if (dist > 5.0f)	//	Oops, too far away!
     		{
    -			if ( goal_aip->ai_flags & AIF_BEING_REPAIRED )
    +			if ( goal_aip->ai_flags & AIF_BEING_REPAIRED ) {
     				ai_do_objects_repairing_stuff( goal_objp, Pl_objp, REPAIR_INFO_BROKEN);
    +				// Goober5000 - add missionlog for support ships, per Mantis #2999
    +				mission_log_add_entry(LOG_SHIP_UNDOCKED, shipp->ship_name, goal_shipp->ship_name);
    +			}
     
     			if (dist > Pl_objp->radius*2 + goal_objp->radius*2) {
     				//	Got real far away from goal, so move back a couple modes and try again.
    @@ -10864,8 +10869,11 @@
     		}
     		else
     		{
    -			if ( goal_aip->ai_flags & AIF_AWAITING_REPAIR )
    +			if ( goal_aip->ai_flags & AIF_AWAITING_REPAIR ) {
     				ai_do_objects_repairing_stuff( goal_objp, Pl_objp, REPAIR_INFO_BEGIN );
    +				// Goober5000 - add missionlog for support ships, per Mantis #2999
    +				mission_log_add_entry(LOG_SHIP_DOCKED, shipp->ship_name, goal_shipp->ship_name);
    +			}
     		}
     
     		break;
    @@ -10982,9 +10990,10 @@
     			model_anim_start_type(goal_shipp, TRIGGER_TYPE_DOCKING_STAGE_2, dockee_index, -1);
     
     			// don't add undock log entries for support ships.
    -			if ( !(sip->flags & SIF_SUPPORT) ) {
    +			// Goober5000 - add missionlog for support ships, per Mantis #2999
    +//			if ( !(sip->flags & SIF_SUPPORT) ) {
     				mission_log_add_entry(LOG_SHIP_UNDOCKED, shipp->ship_name, goal_shipp->ship_name);
    -			}
    +//			}
     		}
     		break;
     	}
    
    patch file icon Mantis2999-aicode.cpp.patch (1,891 bytes) 2014-07-17 23:01 +

-Relationships
+Relationships

-Notes

~0015580

Goober5000 (administrator)

My explanation is here:
http://www.hard-light.net/forums/index.php?topic=86551.msg1729225#msg1729225

Though now I've noticed a new complication in the undock code.

I've uploaded a test build here:
http://scp.indiegames.us/builds/temp/Mantis2999.zip

Please check it out and see if it behaves the way you'd expect. In particular, see if there's an undock entry added if the player ship moves too fast and causes rearm to abort.

~0015588

Darth Geek (reporter)

Sorry for the delay. I tested it in several conditions -

Aborting rearm via c-6 before the dock sound plays but after the support ship is in the dockpoint's path does not trigger either has-docked or has-undocked.

Aborting rearm by hitting afterburners after the dock sound plays but before the "rearming complete" message triggers has-docked, but not has-undocked. IMO this is correct but some FREDders may differ.

has-undocked is triggered as soon as the "rearming complete" message plays.

~0015720

Goober5000 (administrator)

Well, now I'm thinking that maybe the mission log should be updated in the "break off" case as well. I've asked Shivan Hunter to comment.

~0016030

Goober5000 (administrator)

I've uploaded a patch that should add docking and undocking mission logs to the appropriate places. Please also check the "support ship broken off" case.

I'm still wondering why support ships were never logged in the first place, but I haven't thought of any situation where adding the log entry would do any harm.

~0016083

Darth Geek (reporter)

Events appear to work in every case now except when a rearm is aborted (e.g. by hitting afterburners), which does not trigger has-undocked-delay.

~0016093

Goober5000 (administrator)

Bleh. I didn't think that part was necessary but maybe it is. Patch modified.

~0016101

The_E (administrator)

Only one stylistic thing I think should be changed here; You're commenting out code in the last part of the patch, and I believe that those lines should be outright removed instead.

~0016114

Goober5000 (administrator)

I talked with Darth Geek over IRC and the patch satisfies all use cases we could think of, so I'll commit it with The E's suggested tweak.
+Notes

+Related Changesets

-Issue History
Date Modified Username Field Change
2014-01-11 23:53 Darth Geek New Issue
2014-01-26 14:14 Goober5000 Assigned To => Goober5000
2014-01-26 14:14 Goober5000 Status new => assigned
2014-01-26 14:38 Goober5000 Note Added: 0015580
2014-02-03 23:06 Darth Geek Note Added: 0015588
2014-05-01 23:45 Goober5000 Note Added: 0015720
2014-06-29 19:13 Goober5000 Target Version => 3.7.2
2014-07-06 23:53 Goober5000 File Added: Mantis2999-aicode.cpp.patch
2014-07-06 23:58 Goober5000 File Deleted: Mantis2999-aicode.cpp.patch
2014-07-06 23:58 Goober5000 File Added: Mantis2999-aicode.cpp.patch
2014-07-06 23:59 Goober5000 Note Added: 0016030
2014-07-06 23:59 Goober5000 Status assigned => code review
2014-07-16 23:52 Darth Geek Note Added: 0016083
2014-07-17 23:00 Goober5000 File Deleted: Mantis2999-aicode.cpp.patch
2014-07-17 23:01 Goober5000 File Added: Mantis2999-aicode.cpp.patch
2014-07-17 23:02 Goober5000 Note Added: 0016093
2014-07-20 14:08 The_E Note Added: 0016101
2014-07-21 21:00 Goober5000 Note Added: 0016114
2014-07-21 21:01 Goober5000 Changeset attached => fs2open trunk r10930
2014-07-21 21:01 Goober5000 Status code review => resolved
2014-07-21 21:01 Goober5000 Resolution open => fixed
2014-07-21 21:01 Goober5000 Fixed in Version => 3.7.2
+Issue History