View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002999 | FSSCP | SEXPs | public | 2014-01-12 04:53 | 2014-07-22 01:01 |
Reporter | Darth Geek | Assigned To | Goober5000 | ||
Priority | normal | Severity | minor | Reproducibility | have not tried |
Status | resolved | Resolution | fixed | ||
Platform | All | OS | All | OS Version | All |
Product Version | 3.7.1 | ||||
Target Version | 3.7.2 | Fixed in Version | 3.7.2 | ||
Summary | 0002999: has-docked-delay and has-undocked-delay do not detect support ship docking | ||||
Description | Contains a better explanation and pastebinned test mission: http://www.hard-light.net/forums/index.php?topic=86551.msg1729202#msg1729202 | ||||
Steps To Reproduce | Use 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 Information | From 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. | ||||
Tags | No tags attached. | ||||
|
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. |
|
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. |
|
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. |
|
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. |
|
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. |
|
Mantis2999-aicode.cpp.patch (1,891 bytes)
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; } |
|
Bleh. I didn't think that part was necessary but maybe it is. Patch modified. |
|
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. |
|
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. |
Date Modified | Username | Field | Change |
---|---|---|---|
2014-01-12 04:53 | Darth Geek | New Issue | |
2014-01-26 19:14 | Goober5000 | Assigned To | => Goober5000 |
2014-01-26 19:14 | Goober5000 | Status | new => assigned |
2014-01-26 19:38 | Goober5000 | Note Added: 0015580 | |
2014-02-04 04:06 | Darth Geek | Note Added: 0015588 | |
2014-05-02 03:45 | Goober5000 | Note Added: 0015720 | |
2014-06-29 23:13 | Goober5000 | Target Version | => 3.7.2 |
2014-07-07 03:53 | Goober5000 | File Added: Mantis2999-aicode.cpp.patch | |
2014-07-07 03:58 | Goober5000 | File Deleted: Mantis2999-aicode.cpp.patch | |
2014-07-07 03:58 | Goober5000 | File Added: Mantis2999-aicode.cpp.patch | |
2014-07-07 03:59 | Goober5000 | Note Added: 0016030 | |
2014-07-07 03:59 | Goober5000 | Status | assigned => code review |
2014-07-17 03:52 | Darth Geek | Note Added: 0016083 | |
2014-07-18 03:00 | Goober5000 | File Deleted: Mantis2999-aicode.cpp.patch | |
2014-07-18 03:01 | Goober5000 | File Added: Mantis2999-aicode.cpp.patch | |
2014-07-18 03:02 | Goober5000 | Note Added: 0016093 | |
2014-07-20 18:08 | The_E | Note Added: 0016101 | |
2014-07-22 01:00 | Goober5000 | Note Added: 0016114 | |
2014-07-22 01:01 | Goober5000 | Changeset attached | => fs2open trunk r10930 |
2014-07-22 01:01 | Goober5000 | Status | code review => resolved |
2014-07-22 01:01 | Goober5000 | Resolution | open => fixed |
2014-07-22 01:01 | Goober5000 | Fixed in Version | => 3.7.2 |