the car and the raider's base

killap

Bear Dude
Moderator
Modder
Ok, I have been working on the bug that is reported in Per's guide where if you come to the Raider's base with your car, go down the secret manhole entrance, and return back to the surface your car is mysteriously gone. (as he notes if you leave the map to the world map and come back to the well area, your map returns)

I have looked into what is causing this and I see why the car is disappearing, but I don't understand WHY it is happening. The elevation of the secret entrance area is 1 and the cliff area (the other entrance to the raider base) is elevation 0. The problem occurs only if you go down the manhole and resurface. Once you do so the elevation reported by the “dude_elevation” is 0. Hence your car disappears from the secret entrance area and is constructed on the cliff where the game thinks you are. What I don't understand is why the heck a Fallout function is sending back an incorrect elevation. When you return to the surface it should be reporting elevation of 1. Why is it doing this incorrectly? Any ideas? :D :?

Here is the code if anyone wants to take a closer look


Code:
   if (is_loading_game == 0) then begin
      if (dude_elevation == 0) then begin
         set_global_var(GVAR_COMING_FROM_INSIDE_RAIDERS, 0);
         set_global_var(GVAR_RAIDERS_CAR_ELEVATION, 0);
         if (tile_contains_pid_obj(global_var(GVAR_CAR_PLACED_TILE), CAR_RAIDERS_CAMP_ELEV_SECRET, PID_DRIVABLE_CAR) != 0) then begin
            Dest_Car(CAR_RAIDERS_CAMP_HEX_SECRET, CAR_RAIDERS_CAMP_ELEV_SECRET)
            set_global_var(GVAR_CAR_PLACED_TILE, 0);
            Create_Car(CAR_RAIDERS_CAMP_HEX_NORMAL, CAR_RAIDERS_CAMP_ELEV_NORMAL)
            if (tile_contains_pid_obj(CAR_RAIDERS_CAMP_HEX_NORMAL, CAR_RAIDERS_CAMP_ELEV_NORMAL, PID_DRIVABLE_CAR) != 0) then begin
               Create_Trunk(CAR_RAIDERS_CAMP_HEX_NORMAL, CAR_RAIDERS_CAMP_ELEV_NORMAL)
            end
         end else begin
            Check_Create_Car(CAR_RAIDERS_CAMP_HEX_NORMAL, CAR_RAIDERS_CAMP_ELEV_NORMAL)
         end
      end else begin
         set_global_var(GVAR_RAIDERS_CAR_ELEVATION, CAR_RAIDERS_CAMP_ELEV_SECRET);
         if (tile_contains_pid_obj(global_var(GVAR_CAR_PLACED_TILE), CAR_RAIDERS_CAMP_ELEV_NORMAL, PID_DRIVABLE_CAR) != 0) then begin
            Dest_Car(CAR_RAIDERS_CAMP_HEX_NORMAL, CAR_RAIDERS_CAMP_ELEV_NORMAL)
            set_global_var(GVAR_CAR_PLACED_TILE, 0);
            Create_Car(CAR_RAIDERS_CAMP_HEX_SECRET, CAR_RAIDERS_CAMP_ELEV_SECRET)
            if (tile_contains_pid_obj(CAR_RAIDERS_CAMP_HEX_SECRET, CAR_RAIDERS_CAMP_ELEV_SECRET, PID_DRIVABLE_CAR) != 0) then begin
               Create_Trunk(CAR_RAIDERS_CAMP_HEX_SECRET, CAR_RAIDERS_CAMP_ELEV_SECRET)
            end
         end else begin
            Check_Create_Car(CAR_RAIDERS_CAMP_HEX_SECRET, CAR_RAIDERS_CAMP_ELEV_SECRET)
         end
      end
   end

Thanks a million in advance for any input. I can see why the Fallout desingers left such bugs undone.....it HURTS THE MIND! :wink: :P
 
Just replace code to:

Code:
   if dude_elevation == 0 then start_hex_car:=CAR_RAIDERS_CAMP_HEX_NORMAL;
   else start_hex_car:=CAR_RAIDERS_CAMP_HEX_SECRET;

   if (is_loading_game == 0) then Check_Create_Car(start_hex_car, dude_elevation)

   if (is_loading_game == 0) then begin
      if (dude_elevation == 0) then begin
         set_global_var(GVAR_COMING_FROM_INSIDE_RAIDERS, 0);
         set_global_var(GVAR_RAIDERS_CAR_ELEVATION, 0);
      end else begin
         set_global_var(GVAR_RAIDERS_CAR_ELEVATION, CAR_RAIDERS_CAMP_ELEV_SECRET);
      end
   end

And it will be works :)
 
Awesome! Worked perfectly. Thanks a million man! All credit to you on this one!


EDIT:
Though I hate to go off topic here as well as take up more of your time Avega, but since you fixed that one bug with the car, any chance you can take a look at another one I was working on. This code SHOULD remove Myron from your party and then destroy him (making him disappear). For some reason though, he is removed from your party but never disappears. If you talk with him again it is like you just met. Any ideas? Here is the code below. Once again ignore this if you don't care, this and the car bug were the only two that I was completely clueless about and you seemed to have solved the car one so easily! 8) :P

code:

Code:
  if (Myron_In_Party) then begin 
         gfade_out(ONE_GAME_SECOND); 
         item_caps_adjust(dude_obj, 1000); 
         set_merk_status(MERK_STATUS_PLEASED); 
         if (critter_is_armed(Myron_Ptr)) then begin 
            inven_unwield(Myron_Ptr); 
         end 
         move_obj_inven_to_obj(Myron_Ptr, dude_obj); 
         // remove & destroy Myron 
         party_remove(Myron_Ptr); 
         destroy_object(Myron_Ptr); 
         gfade_in(ONE_GAME_SECOND); 
      call Node019; 
   end
 
Code:
 if (Myron_In_Party) then begin 
         gfade_out(ONE_GAME_SECOND); 
         item_caps_adjust(dude_obj, 1000); 
         set_merk_status(MERK_STATUS_PLEASED); 
         if (critter_is_armed(Myron_Ptr)) then begin 
            inven_unwield(Myron_Ptr); 
         end 
         move_obj_inven_to_obj(Myron_Ptr, dude_obj); 
         // destroy Myron. automatically remove ;)
         move_to(Myron_Ptr, 0, 0);
         critter_heal(Myron_Ptr, -10000);
         gfade_in(ONE_GAME_SECOND); 
      call Node019; 
   end

I'm sorry. My english not so perfectly as i want. It's reason for no comments.
 
Yep, works now. :D


Thanks a million on both the raider's help and this! I really appreciate it!

EDIT:
Oh, and just out of curiosity, why did my destroy_object(Myron_Ptr) not work? Should that not destroy and object?
 
After "remove_party()" pointer "Myron_Ptr" no more actually. It's just define of party_member_obj(myron_pid).

It's reason for incorrectly work of this code:
Code:
         party_remove(Myron_Ptr); 
         destroy_object(Myron_Ptr);

PS:
I use "move_to" and "critter_heal' instead of "destroy_object" because it's habit after modding Fallout 1. I just forget what in F2 command "destroy_object" work correctly :)

I'm sorry for my bad English. :(
 
Ah, yeah that makes sense. Doh, should have realized that. What is funny, is that I had actually taken that bit of code
Code:
         party_remove(Myron_Ptr); 
         destroy_object(Myron_Ptr);

from a Fallout script file made by the original Fallout dev guys. I would hope they would have realized that it would not work, but I guess not. 8)

Thanks again Avega.

P.S. Oh, and your English is fine. I understood you just fine.
 
Back
Top