Fallout 2 mod Getting some strange issues with the sierra army klaxon script...

Discussion in 'Fallout General Modding' started by Question2, Jan 1, 2021.

  1. Question2

    Question2 It Wandered In From the Wastes

    172
    Jun 20, 2017
    This is the killap version (wsklaxon) :

    Code:
    procedure map_update_p_proc begin
       variable Item;
    
       if (global_var(GVAR_SIERRA_BASE_SECURITY) == SIERRA_SECURITY_ON) then begin
           if (obj_pid(self_obj) == PID_NS_LIGHT) then begin
               item:=create_object_sid(PID_NS_FLASHING_LIGHT,tile_num(self_obj),elevation(self_obj),SCRIPT_WSKLAXON);
               destroy_object(self_obj);
           end
           else if (obj_pid(self_obj) == PID_EW_LIGHT) then begin
               item:=create_object_sid(PID_EW_FLASHING_LIGHT,tile_num(self_obj),elevation(self_obj),SCRIPT_WSKLAXON);
               destroy_object(self_obj);
           end
       end else if (global_var(GVAR_SIERRA_BASE_SECURITY) == SIERRA_SECURITY_OFF) then begin
           if (obj_pid(self_obj) == PID_NS_FLASHING_LIGHT) then begin
               item:=create_object_sid(PID_NS_LIGHT,tile_num(self_obj),elevation(self_obj),SCRIPT_WSKLAXON);
               destroy_object(self_obj);
           end
           else if (obj_pid(self_obj) == PID_EW_FLASHING_LIGHT) then begin
               item:=create_object_sid(PID_EW_LIGHT,tile_num(self_obj),elevation(self_obj),SCRIPT_WSKLAXON);
               destroy_object(self_obj);
           end
       end
    end 
    So if the GVAR is set to security_on, it will replace the lights with flashing lights. This part works fine.

    The part that doesnt work is when the GVAR has been changed to security_off.

    The lights stay flashing. I have to use the look action on the light and wait several seconds for it to go back to the non-flashing state.

    If i save and load the game after the security has been turned off, all the lights that were still flashing have been deleted by the game.

    This is baffling.

    upload_2021-1-1_20-22-17.png

    This is what the map looks like after i saved and reloaded. The light next to the elevator has been deleted. The light to the south is still there, because it reverted to the regular state before i saved and loaded the game.

    Can someone explain what is going on here? The script updates all the lights to the flashing lights version just fine, but it starts acting weird when it tries to update them to the regular version after the security has been turned off.
     
  2. Question2

    Question2 It Wandered In From the Wastes

    172
    Jun 20, 2017
    Did more testing, if i activate the alarm, save, load the save game, then turn the alarm off, it works correctly. All the klaxons will instantly turn themselves off with no issues.

    If i activate the alarm, then turn it off, it bugs out. At this point, saving and loading the save game will cause the klaxons to dissapear and other oddities.

    What is this, an engine bug?