Jump to content

Non-blocking delay until NPCs are not "in-use"


Lithobraker

Recommended Posts

Earlier today, I found a race condition in Tryout's "Walk of Shame" scenario and I managed to make it all of four hours before my problem-solving compulsion kicked in and began demanding I try to fix it. 

 

How the scenario works is the quest takes a set comprised of 6 Powder Ganger Bodyguards, Eddie, and Scrambler and uses them to run a train on the player character and up to 7 of her female companions.  When the Sexout Act is done, the dialog topic that was fed as an argument to SexoutActRunFull fires and eventually triggers the next of the 8 scripts (the NCRCFGangbang scripts) that make the SexoutActRunFull calls for the gangbang.  However, as presently released, the NCRCFGangbang scripts only check if there is a valid companion to use as an argument in SexoutActRunFull.  They do not check if any of the Gangers or Companions (or the player herself) carry Sexout's "in-use" flag.  If any of them are flagged as "in-use" (which almost always happens if the companions don't finish their Sexout Acts before the player does), the SexoutActRunFull call using them immediately fail as intended by SexoutNG.  If the call that was made on the player fails because the player or (more commonly) her next rapist are flagged as "in-use", the dialog topic that is supposed to trigger the next round does not fire and the critical path of the script chain is broken.  

 

Now, the easy way to fix this problem is to just check each of the Gangers until one is found that is not "in-use" (fairly likely to occur, since there are eight of them and Sunny is probably the only companion the player has during this scenario, occurring right after Ghost Town Gunfight/Run, Goodsprings, Run!).  However, this solution is sloppy, difficult to read in the GECK's godawful script editor, and still threatens a race condition should the player (somehow/for some reason) start Walk of Shame after picking up 6 more female companions. 

 

The right way to do this is put a non-blocking delay (so the game doesn't seize up and die and SexoutNG can run its cleanup routines on the actors) in before the SexoutActRunFull calls are made that isn't released until all the actors (or at the very least the player and the Ganger who's next in line) are no longer flagged as "in-use".  The problem with that is I don't actually know how to do that in...whatever language these scripts are written in.  I was looking at using NVSE's DispatchEvent and set an event for the player and next Ganger that would fire when fnSexoutActorInUse returns 0 for both of them, but I don't know how to block the rest of the script until that happens without holding up the rest of the system.  Does anyone know?  Or am I massively overthinking this and people have found a better solution to this problem?

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use