I've updated the mod and the first post to a version 1.1I managed to set up the sewer loot missions so that even though the loot pile isn't spawned in scenario mode the job is marked complete when the player touches the maps skeleton_pile_x entity (or more specifically, when they get to within a really short range of it).
This behaviour is entirely handled by the main_script.script which is a good example of how we can effect how maps play even without access to the maps files themselves.
The script itself has 2 main parts to it. First there's:
if ( !sys.getGameStateInt("gamestateint/wasteland1/intro/dan_waitforcarentrance") ){ sys.print("^2Player never rode in Dans Buggy... probably a scenario spawn, checking maps...\n"); string thisMap = sys.getMapPath(); sys.wait(3); if ( (thisMap == "game/wasteland1/sewer_level_01/") && ($player1.isJobInProgress( @job ("jobs/wasteland1/sewer_1")))){ fixSewers("breakable/skeleton_pile_607", ( @job ("jobs/wasteland1/sewer_1" ))); }else if ( (thisMap == "game/wasteland1/sewer_level_02/") && ($player1.isJobInProgress( @job ("jobs/wasteland1/sewer_2")))){ fixSewers("breakable/skeleton_pile_614", ( @job ("jobs/wasteland1/sewer_2" ))); }else if ( (thisMap == "game/wasteland1/sewer_level_03/") && ($player1.isJobInProgress( @job ("jobs/wasteland1/sewer_3")))){ fixSewers("breakable/skeleton_pile_489", ( @job ("jobs/wasteland1/sewer_3" ))); }else if ( (thisMap == "game/wasteland1/sewer_level_04/") && ($player1.isJobInProgress( @job ("jobs/wasteland1/sewer_4")))){ fixSewers("breakable/skeleton_pile_882", ( @job ("jobs/wasteland1/sewer_4" ))); }else if ( (thisMap == "game/wasteland1/sewer_level_05/") && ($player1.isJobInProgress( @job ("jobs/wasteland1/sewer_5")))){ fixSewers("breakable/skeleton_pile_813", ( @job ("jobs/wasteland1/sewer_5" ))); }else if ( (thisMap == "game/wasteland1/sewer_level_06/") && ($player1.isJobInProgress( @job ("jobs/wasteland1/sewer_6")))){ fixSewers("breakable/skeleton_pile_582", ( @job ("jobs/wasteland1/sewer_6" ))); }else if ( (thisMap == "game/wasteland1/sewer_level_07/") && ($player1.isJobInProgress( @job ("jobs/wasteland1/sewer_7")))){ fixSewers("breakable/skeleton_pile_787", ( @job ("jobs/wasteland1/sewer_7" ))); }else if ( (thisMap == "game/wasteland2/sewer_level_08/") && ($player1.isJobInProgress( @job ("jobs/wasteland2/sewer_8")))){ fixSewers("breakable/skeleton_pile_1082", ( @job ("jobs/wasteland2/sewer_8" ))); }else if ( (thisMap == "game/wasteland2/sewer_level_09/") && ($player1.isJobInProgress( @job ("jobs/wasteland2/sewer_9")))){ fixSewers("breakable/skeleton_pile_857", ( @job ("jobs/wasteland2/sewer_9" ))); }else { sys.print("^2No Match for map AND in-progress job. Not one of the sewer scenarios, the current Map is :" + thisMap + "\n"); }}
This block is inside the script_main() function (ok, it really should be a separate function or even two functions). It checks that the gamestateint for Dans initial entrance cue is 0, during normal gameplay this should always be 1 (
I think). I've used the check as a basic "Is it a scenario load?" check.
The next block is a set of if statements checking if the loaded map and job in progress match our specific sewer level requirements and if they do it calls the function fixSewers, passing it the name of the breakable/skeleton_pile entity for the map and the loot job for the map.
The fixSewers function contains:
void fixSewers(string skullsName,decl job){entity skulls = sys.getEntity( skullsName );string jobName = sys.getDeclName(job);if (sys.isEntityValid(skulls)){ sys.println("^2Success: ^0Skulls on sticks model found " + skullsName ); if ( sys.isValidDecl( job ) ){ while( $player1.isJobInProgress( job)){ sys.wait(3); while (( $player1.distanceTo( skulls) <= 400) && ( $player1.isJobInProgress( job))){ sys.wait(0.2); if (( $player1.distanceTo( skulls) <= 75) && ( $player1.isJobInProgress( job))){ sys.println("^2Success: ^0Player touched Skulls on Sticks model \"" + skullsName +"\""); sys.print("^2Success: ^0Marking Job \""+ jobName + "\" complete"); $player1.completeJob( job ); sys.trigger( skulls, $player1); } } } } else { sys.print("^2Error: ^0Job Decl \""+ jobName + "\" not found, unable to complete job"); }}else{ sys.print("^2Error: ^0Skulls on Sticks model \""+ skullsName + "\" not found");}
This function checks that the name of the skulls on sticks model is correct and that the entity is in the map, and that the job passed is a real job. While the players distance from the skulls entity is &--#62; 400 it waits for 3 seconds then checks again, once the player gets to within 400 units of the entity the wait period between checks is decreased to 0.2 seconds. Finally once the player gets within 75 units of the entity the job is marked complete (so the player can leave the scenario map) and the entity is triggered (which triggers it's fade animation).