Skip to content

Commit

Permalink
Add workaround for ghost vcconnar object in vault village, closes #314.
Browse files Browse the repository at this point in the history
  • Loading branch information
burner1024 committed Oct 11, 2024
1 parent 2af09b6 commit 942e1d1
Showing 1 changed file with 24 additions and 25 deletions.
49 changes: 24 additions & 25 deletions scripts_src/valtcity/vcconnar.ssl
Original file line number Diff line number Diff line change
Expand Up @@ -148,41 +148,40 @@ procedure Node994;


/* Local variables which do not need to be saved between map changes. */
variable Only_Once:=0;


procedure start begin
end

/* This procedure will get called each time that the map is first entered. It will
set up the Team number and AI packet for this critter. This will override the
default from the prototype, and needs to be set in scripts. */
/*procedure map_enter_p_proc begin
Only_Once:=0;
set_self_team(TEAM_VAULT_VILLAGERS);
set_self_ai(AI_COWARD);
end*/

procedure map_enter_p_proc begin
Only_Once := 0;
if is_loading_game then return;

/*
TODO: this is a temporary workaround for a ghost object in .map file.
It should be removed once the map file is fixed.
See https://github.com/BGforgeNet/Fallout2_Restoration_Project/issues/314, https://github.com/BGforgeNet/Fallout2_Restoration_Project/pull/260.
*/
if not self_obj then return;
/* end todo */

set_self_team(TEAM_VAULT_VILLAGERS);
if (is_loading_game == false) then begin
if ( (global_var(GVAR_VAULT_SERVANT) == SERVANT_FINISHED_VIOLENT) or (((game_time - global_var(GVAR_SERVANT_RAID_DATE)) >= ONE_GAME_MONTH) and (((global_var(GVAR_QUEST_VAULT_VILLAGE) < VILLAGE_QUEST_DELIVERED_GUNS) and (global_var(GVAR_QUEST_VAULT_VILLAGE) > 0)) or (global_var(GVAR_QUEST_VAULT_SERVANT) > 0) and (global_var(GVAR_VAULT_SERVANT) != SERVANT_FINISHED_DIPLOMATIC) and (global_var(GVAR_QUEST_VAULT_VILLAGE) < VILLAGE_QUEST_DELIVERED_GUNS))) ) then begin
if (cur_map_index == MAP_VAULT_VILLAGE) then begin
destroy_object(self_obj);
end
else if (cur_map_index == MAP_VAULTCITY_DOWNTOWN) then begin
set_self_visible; // go vis
critter_attempt_placement(self_obj, 13705, 0);
set_self_ai(AI_TOUGH_CITIZEN);
add_timer_event(self_obj, game_ticks(50), 1);
end
end else begin
if (cur_map_index == MAP_VAULTCITY_DOWNTOWN) then begin
set_self_invisible; // go invis
end
critter_attempt_placement(self_obj, 24911, dude_elevation);
if ( (global_var(GVAR_VAULT_SERVANT) == SERVANT_FINISHED_VIOLENT) or (((game_time - global_var(GVAR_SERVANT_RAID_DATE)) >= ONE_GAME_MONTH) and (((global_var(GVAR_QUEST_VAULT_VILLAGE) < VILLAGE_QUEST_DELIVERED_GUNS) and (global_var(GVAR_QUEST_VAULT_VILLAGE) > 0)) or (global_var(GVAR_QUEST_VAULT_SERVANT) > 0) and (global_var(GVAR_VAULT_SERVANT) != SERVANT_FINISHED_DIPLOMATIC) and (global_var(GVAR_QUEST_VAULT_VILLAGE) < VILLAGE_QUEST_DELIVERED_GUNS))) ) then begin
if (cur_map_index == MAP_VAULT_VILLAGE) then begin
destroy_object(self_obj);
end
else if (cur_map_index == MAP_VAULTCITY_DOWNTOWN) then begin
set_self_visible;
critter_attempt_placement(self_obj, 13705, 0);
set_self_ai(AI_TOUGH_CITIZEN);
add_timer_event(self_obj, game_ticks(50), 1);
end
end else begin
if (cur_map_index == MAP_VAULTCITY_DOWNTOWN) then begin
set_self_invisible;
end
critter_attempt_placement(self_obj, 24911, dude_elevation);
end
end

Expand Down

0 comments on commit 942e1d1

Please sign in to comment.