Problems editting the VertiBird MOD

I Must Be Crazy 2

First time out of the vault
Greetings, all! I've been on and off the Fallout MOD scene and this is like my first post in 17 months. How have you all been?

My post today is to address the issues I've encountered in trying to modify the Vertibird MOD for Fallout 2. Yes, that same famous Vertibird MOD, version 1.01, by the Den Baster.

I am currently running it with the 1.02d official Interplay patch. I used DATExplorer to unpack the MOD, and Datman Light v1.2 to pack the experimental MODs. I use ModRunner to test my patches.

I am trying to add a new flight option to the Vertibird for a speedier flight that uses more fuel than regular flight.

I have decompiled the scripts using int2ssl. NOID's decompiler resulted in a Tails do not match error. I editted the cesaer.ssl and cesaer.msg scripts to add new dialog options to the Vertibird, and the ziVrTrnk.ssl script to modify the fuel usage and the passage of the game clock after flight. I have also fixed a bug in both scripts when the player tries to use one kind of fuel (I do not wish to spoil this) from his inventory (via the backpack icon) on the Vertibird to "Refuel with all that was available."

Okay, and now for the gameplay errors. Everything works just fine if I run everything EXCEPT for the editted ziVrTrnk.int file except for the fuel usage and the travel time associated with the new option. However, once I run Fallout 2 with my modified ziVrTrnk.int, I notice that my car permanently disappears once I encounter the VertiBird.

Furthermore, I have used debugging messages and NOID's Fallout 2 debug patch to discover that for some reason, the procedure timed_event_p_proc (sic) (the procedure that checks if the player has set a destination course on the Vertibird) fails to run as soon as the Vertibird lands at a new location until the player exits that map and re-enters it.

Any clues as to what is causing these behaviors?
 
Well sure this is caused by Your modified files :).


Code:
Furthermore, I have used debugging messages and NOID's Fallout 2 debug patch to discover that for some reason, the procedure timed_event_p_proc (sic) (the procedure that checks if the player has set a destination course on the Vertibird) fails to run as soon as the Vertibird lands at a new location until the player exits that map and re-enters it.

That's is normal behavior, i think your script uses load_map to put player at new destination.
When new map is loading ALL calls from ALL scripts are erased(and scripts too) and then ALL scripts from new map are created.

Use LVAR or GVAR to take values from one map to another.

To help you really i need to see your scripts.
 
Here is the problem code...

jargo said:
Well sure this is caused by Your modified files :).


Code:
Furthermore, I have used debugging messages and NOID's Fallout 2 debug patch to discover that for some reason, the procedure timed_event_p_proc (sic) (the procedure that checks if the player has set a destination course on the Vertibird) fails to run as soon as the Vertibird lands at a new location until the player exits that map and re-enters it.

That's is normal behavior, i think your script uses load_map to put player at new destination.
When new map is loading ALL calls from ALL scripts are erased(and scripts too) and then ALL scripts from new map are created.

Use LVAR or GVAR to take values from one map to another.

To help you really i need to see your scripts.

Ok, pal, you asked for it :) By the way, thank you for the reply.
Here is the procedure in my ziVrTrnk.ssl file (scripted for NOID's compiler 1.01) that is causing problems:

Code:
procedure map_enter_p_proc
begin
  /* This section determines where on the town map the vertibird will be placed */
  /* It also attempts to place the player close to the vertibird on landing */
  if (op_cur_map_index() == 7) then
  begin
    op_move_to(op_self_obj(), (107 * 200) + 68, 0);
    stab := (((op_tile_num(op_self_obj()) / 200) - 6) * 200) + ((op_tile_num(op_self_obj()) % 200) + 6);
    if (op_party_member_obj(532) > 0) then
      op_move_to(op_dude_obj(), stab, op_elevation(op_self_obj()));
  end
  if (op_cur_map_index() == 15) then
  begin
    op_move_to(op_self_obj(), (96 * 200) + 124, 0);
    stab := (((op_tile_num(op_self_obj()) / 200) - 5) * 200) + ((op_tile_num(op_self_obj()) % 200) - 4);
    if (op_party_member_obj(532) > 0) then
      op_move_to(op_dude_obj(), stab, op_elevation(op_self_obj()));
  end
  if (op_cur_map_index() == 4) then
    op_move_to(op_self_obj(), (80 * 200) + 98, 0);
  if (op_cur_map_index() == 10) then
  begin
    op_move_to(op_self_obj(), (134 * 200) + 126, 0);
    stab := (((op_tile_num(op_self_obj()) / 200) - 6) * 200) + ((op_tile_num(op_self_obj()) % 200) + 2);
    if (op_party_member_obj(532) > 0) then
      op_move_to(op_dude_obj(), stab, op_elevation(op_self_obj()));
  end
  if (op_cur_map_index() == 79) then
  begin
    op_move_to(op_self_obj(), (63 * 200) + 124, 0);
    if (op_party_member_obj(532) > 0) then
      op_move_to(op_dude_obj(), (72 * 200) + 119, op_elevation(op_self_obj()));
  end
  if (op_cur_map_index() == 109) then
  begin
    if (op_party_member_obj(532) > 0) then
      op_set_global_var(511, 1);
    op_move_to(op_self_obj(), (83 * 200) + 122, 2);
    stab := (((op_tile_num(op_self_obj()) / 200) - 7) * 200) + ((op_tile_num(op_self_obj()) % 200) + 1);
    if (op_party_member_obj(532) > 0) then
      op_move_to(op_dude_obj(), stab, op_elevation(op_self_obj()));
  end
  if (op_cur_map_index() == 54) then
    op_move_to(op_self_obj(), (139 * 200) + 104, 0);
  if (op_cur_map_index() == 31) then
    op_move_to(op_self_obj(), (118 * 200) + 100, 0);
  if (op_cur_map_index() == 18) then
    op_move_to(op_self_obj(), (124 * 200) + 120, 0);
  if (op_cur_map_index() == 64) then
    op_move_to(op_self_obj(), (114 * 200) + 66, 0);
  if (op_cur_map_index() == 137) then
    op_move_to(op_self_obj(), (123 * 200) + 104, 0);
  if (op_cur_map_index() == 46) then
  begin
    op_move_to(op_self_obj(), (95 * 200) + 64, 0);
    if (op_party_member_obj(532) > 0) then
      op_move_to(op_dude_obj(), (104 * 200) + 75, op_elevation(op_self_obj()));
  end
  if (op_cur_map_index() == 51) then
    op_move_to(op_self_obj(), (78 * 200) + 122, 0);
  /* End of Vertibird & Player placement section */

  if (op_party_member_obj(532) > 0) then
  begin
    if (op_global_var(641) == 0) then  /* flight efficiency flag */
      op_set_global_var(640, op_global_var(640) - op_random(2, 4));
    else
      op_set_global_var(640, op_global_var(640) - op_random(8, 10)); /* flight efficiency modification */
    if (op_global_var(640) < 0) then
      op_set_global_var(640, 0);
    call create();      /* This seems to be causing problems */
    op_party_remove(op_self_obj());
    if (op_global_var(641) == 0) then
      op_game_time_advance(op_random(300000, 900000));
    else
      op_game_time_advance(op_random(30000, 39000));  /* flight efficiency modification */
    op_gfade_in(600);
  end
  op_debug_msg("ziVrTrnk: Touchdown " + op_global_var(635));
  op_add_timer_event(op_self_obj(), 10, 1);
  op_debug_msg("ZiVrTrnk: On foot at " + op_global_var(635));
end

And again, here is the debug output for this part of the script whenever the VertiBird lands at another location:

Code:
ziVrTrnk: start
ziVrTrnk: start
trunk: map_enter_p_proc
   Trunk_In_Party: start
   GVAR_CAR_PLACED_TILE == 9509
  trying to hide trunk
   Trunk_In_Party: end
map_enter_p_proc
ziVrTrnk: create
trunk: map_update_p_proc
   Trunk_In_Party: start
   GVAR_CAR_PLACED_TILE == 9509
  trying to hide trunk
   Trunk_In_Party: end
ziVrTrnk: map_update_p_proc
ziVrTrnk: Touchdown 10
ZiVrTrnk: On foot at 10
Error during execution: 
Stack underflow short.
Current script: scripts\zivrtrnk.int, procedure map_enter_p_proc
karl: map_enter_p_proc
   karl_in_modoc
...


Currently, op_global_var(644) is being used for Vertibird trunk & body placement whereas op_global_var(633) is being used for the car's placement. This seems to have solved the problem where the car disappears as soon as the Vertibird appears in the game.

op_global_var(640) (introduced by Den Baster) represents the amount of fuel left in the Vertibird.

op_global_var(641) (introduced by myself) refers to a special flag corresponding to a flight option that will immensely decrease flying time but use up a lot more fuel.

Here is another observation I have made. I only seem to get the stack underflow short error whenever map_enter_p_proc needs to call the procedure create. If it doesn't, everything seems to run fine with the script as is.
 
It looks like the problem is in this "create" procedure You mentioned. Post it contents here.
 
the create procedure

jargo said:
It looks like the problem is in this "create" procedure You mentioned. Post it contents here.

Okay, here it is, the create procedure from zivrtrnk.ssl:

Code:
procedure create
begin
  op_debug_msg("ziVrTrnk: create");
  op_add_timer_event(op_self_obj(), 10, 1);
  op_set_global_var(644, op_tile_contains_pid_object(op_tile_num(op_self_obj()), op_elevation(op_self_obj()), 532));
  lcx := (op_tile_num(op_self_obj()) % 200) + 1;
  lcy := (op_tile_num(op_self_obj()) / 200) + 7;
  restock_obj := op_create_object(33554432 + 1852, 0, 0, 1305);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := op_tile_num(op_self_obj()) % 200;
  lcy := (op_tile_num(op_self_obj()) / 200) - 6;
  restock_obj := op_create_object(33554432 + 1688, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := (op_tile_num(op_self_obj()) % 200) + 8;
  lcy := (op_tile_num(op_self_obj()) / 200) + 2;
  restock_obj := op_create_object(33554432 + 1691, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := (op_tile_num(op_self_obj()) % 200) - 5;
  lcy := (op_tile_num(op_self_obj()) / 200) + 3;
  restock_obj := op_create_object(33554432 + 1692, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := (op_tile_num(op_self_obj()) % 200) - 6;
  lcy := (op_tile_num(op_self_obj()) / 200) + 2;
  restock_obj := op_create_object(33554432 + 1696, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := (op_tile_num(op_self_obj()) % 200) + 5;
  lcy := (op_tile_num(op_self_obj()) / 200) + 1;
  restock_obj := op_create_object(33554432 + 1694, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := (op_tile_num(op_self_obj()) % 200) + 3;
  lcy := (op_tile_num(op_self_obj()) / 200) + 7;
  restock_obj := op_create_object(33554432 + 1695, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := (op_tile_num(op_self_obj()) % 200) + 1;
  lcy := (op_tile_num(op_self_obj()) / 200) - 6;
  restock_obj := op_create_object(33554432 + 1693, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := op_tile_num(op_self_obj()) % 200;
  lcy := (op_tile_num(op_self_obj()) / 200) - 8;
  restock_obj := op_create_object(33554499, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := op_tile_num(op_self_obj()) % 200;
  lcy := (op_tile_num(op_self_obj()) / 200) - 7;
  restock_obj := op_create_object(33554499, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := (op_tile_num(op_self_obj()) % 200) + 1;
  lcy := (op_tile_num(op_self_obj()) / 200) - 7;
  restock_obj := op_create_object(33554499, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := (op_tile_num(op_self_obj()) % 200) + 2;
  lcy := (op_tile_num(op_self_obj()) / 200) - 7;
  restock_obj := op_create_object(33554499, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := (op_tile_num(op_self_obj()) % 200) - 2;
  lcy := (op_tile_num(op_self_obj()) / 200) - 7;
  restock_obj := op_create_object(33554499, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := (op_tile_num(op_self_obj()) % 200) - 2;
  lcy := (op_tile_num(op_self_obj()) / 200) - 5;
  restock_obj := op_create_object(33554499, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := (op_tile_num(op_self_obj()) % 200) + 3;
  lcy := (op_tile_num(op_self_obj()) / 200) - 6;
  restock_obj := op_create_object(33554499, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := (op_tile_num(op_self_obj()) % 200) - 1;
  lcy := (op_tile_num(op_self_obj()) / 200) - 5;
  restock_obj := op_create_object(33554499, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := (op_tile_num(op_self_obj()) % 200) + 1;
  lcy := (op_tile_num(op_self_obj()) / 200) - 5;
  restock_obj := op_create_object(33554499, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := (op_tile_num(op_self_obj()) % 200) - 1;
  lcy := (op_tile_num(op_self_obj()) / 200) - 4;
  restock_obj := op_create_object(33554499, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := (op_tile_num(op_self_obj()) % 200) + 1;
  lcy := (op_tile_num(op_self_obj()) / 200) + 1;
  restock_obj := op_create_object(33554499, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := op_tile_num(op_self_obj()) % 200;
  lcy := op_tile_num(op_self_obj()) / 200;
  restock_obj := op_create_object(33554499, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := (op_tile_num(op_self_obj()) % 200) + 1;
  lcy := op_tile_num(op_self_obj()) / 200;
  restock_obj := op_create_object(33554499, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := (op_tile_num(op_self_obj()) % 200) + 1;
  lcy := (op_tile_num(op_self_obj()) / 200) - 3;
  restock_obj := op_create_object(33554499, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := (op_tile_num(op_self_obj()) % 200) - 1;
  lcy := op_tile_num(op_self_obj()) / 200;
  restock_obj := op_create_object(33554499, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := (op_tile_num(op_self_obj()) % 200) + 1;
  lcy := (op_tile_num(op_self_obj()) / 200) - 2;
  restock_obj := op_create_object(33554499, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := (op_tile_num(op_self_obj()) % 200) + 2;
  lcy := (op_tile_num(op_self_obj()) / 200) - 2;
  restock_obj := op_create_object(33554499, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := (op_tile_num(op_self_obj()) % 200) - 2;
  lcy := (op_tile_num(op_self_obj()) / 200) - 1;
  restock_obj := op_create_object(33554499, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := (op_tile_num(op_self_obj()) % 200) + 2;
  lcy := (op_tile_num(op_self_obj()) / 200) - 1;
  restock_obj := op_create_object(33554499, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := (op_tile_num(op_self_obj()) % 200) - 2;
  lcy := op_tile_num(op_self_obj()) / 200;
  restock_obj := op_create_object(33554499, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := (op_tile_num(op_self_obj()) % 200) + 3;
  lcy := op_tile_num(op_self_obj()) / 200;
  restock_obj := op_create_object(33554499, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := (op_tile_num(op_self_obj()) % 200) - 2;
  lcy := (op_tile_num(op_self_obj()) / 200) + 1;
  restock_obj := op_create_object(33554499, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := (op_tile_num(op_self_obj()) % 200) + 3;
  lcy := (op_tile_num(op_self_obj()) / 200) + 1;
  restock_obj := op_create_object(33554499, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := (op_tile_num(op_self_obj()) % 200) + 4;
  lcy := (op_tile_num(op_self_obj()) / 200) + 1;
  restock_obj := op_create_object(33554499, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := (op_tile_num(op_self_obj()) % 200) + 2;
  lcy := (op_tile_num(op_self_obj()) / 200) + 2;
  restock_obj := op_create_object(33554499, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := (op_tile_num(op_self_obj()) % 200) + 3;
  lcy := (op_tile_num(op_self_obj()) / 200) + 2;
  restock_obj := op_create_object(33554499, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := (op_tile_num(op_self_obj()) % 200) + 5;
  lcy := (op_tile_num(op_self_obj()) / 200) + 2;
  restock_obj := op_create_object(33554499, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := (op_tile_num(op_self_obj()) % 200) + 6;
  lcy := (op_tile_num(op_self_obj()) / 200) + 2;
  restock_obj := op_create_object(33554499, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := (op_tile_num(op_self_obj()) % 200) + 2;
  lcy := (op_tile_num(op_self_obj()) / 200) + 3;
  restock_obj := op_create_object(33554499, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := (op_tile_num(op_self_obj()) % 200) + 3;
  lcy := (op_tile_num(op_self_obj()) / 200) + 4;
  restock_obj := op_create_object(33554499, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := (op_tile_num(op_self_obj()) % 200) + 4;
  lcy := (op_tile_num(op_self_obj()) / 200) + 4;
  restock_obj := op_create_object(33554499, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := (op_tile_num(op_self_obj()) % 200) + 3;
  lcy := (op_tile_num(op_self_obj()) / 200) + 5;
  restock_obj := op_create_object(33554499, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := (op_tile_num(op_self_obj()) % 200) + 5;
  lcy := (op_tile_num(op_self_obj()) / 200) + 5;
  restock_obj := op_create_object(33554499, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := (op_tile_num(op_self_obj()) % 200) + 6;
  lcy := (op_tile_num(op_self_obj()) / 200) + 5;
  restock_obj := op_create_object(33554499, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := (op_tile_num(op_self_obj()) % 200) + 3;
  lcy := (op_tile_num(op_self_obj()) / 200) + 6;
  restock_obj := op_create_object(33554499, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := (op_tile_num(op_self_obj()) % 200) + 1;
  lcy := (op_tile_num(op_self_obj()) / 200) + 6;
  restock_obj := op_create_object(33554499, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := (op_tile_num(op_self_obj()) % 200) + 4;
  lcy := (op_tile_num(op_self_obj()) / 200) + 7;
  restock_obj := op_create_object(33554499, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := (op_tile_num(op_self_obj()) % 200) + 3;
  lcy := (op_tile_num(op_self_obj()) / 200) + 8;
  restock_obj := op_create_object(33554499, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := (op_tile_num(op_self_obj()) % 200) + 5;
  lcy := (op_tile_num(op_self_obj()) / 200) + 8;
  restock_obj := op_create_object(33554499, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := (op_tile_num(op_self_obj()) % 200) + 6;
  lcy := (op_tile_num(op_self_obj()) / 200) + 8;
  restock_obj := op_create_object(33554499, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := (op_tile_num(op_self_obj()) % 200) + 2;
  lcy := (op_tile_num(op_self_obj()) / 200) + 7;
  restock_obj := op_create_object(33554499, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := (op_tile_num(op_self_obj()) % 200) - 1;
  lcy := (op_tile_num(op_self_obj()) / 200) + 2;
  restock_obj := op_create_object(33554499, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := (op_tile_num(op_self_obj()) % 200) + 1;
  lcy := (op_tile_num(op_self_obj()) / 200) + 3;
  restock_obj := op_create_object(33554499, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := op_tile_num(op_self_obj()) % 200;
  lcy := (op_tile_num(op_self_obj()) / 200) + 2;
  restock_obj := op_create_object(33554499, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := (op_tile_num(op_self_obj()) % 200) + 1;
  lcy := (op_tile_num(op_self_obj()) / 200) + 8;
  restock_obj := op_create_object(33554499, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
  lcx := (op_tile_num(op_self_obj()) % 200) + 1;
  lcy := (op_tile_num(op_self_obj()) / 200) - 4;
  restock_obj := op_create_object(33554499, 0, 0, -1);
  op_critter_attempt_placement(restock_obj, (lcy * 200) + lcx, op_elevation(op_global_var(644)));
end

This procedure is responsible for drawing the Vertibird graphics in the town that it enters. I think that op_global_var(644) (introduced by myself) tells the program where the Vertibird is in the game,
 
It's fallout2 scripting language :)
But you must prepare this with preprocessor before compile.

Was tested in the F2: Alternative Life mod ;)
 
Thanks a lot buddy, that sure solved the stack underflow short problem! :)

Now, armed with these new codes, I am trying to solve the problem with the player getting stuck in Klamath and Vault City after 6 trips to those locations by Vertibird. I am attempting to do so by modifying the pieces of code that look like this:

Code:
        // this code corresponds to the Klamath mall area
	if (cur_map_index == 10) then begin
		move_to(self_obj, (134 * 200) + 126, 0);
		stab := (((tile_num(self_obj) / 200) - 6) * 200) + ((tile_num(self_obj) % 200) + 2);
		if (party_member_obj(532) > 0) then begin
			move_to(dude_obj, stab, elevation(self_obj));
		end
	end

and this:

Code:
        // this code corresponds to Vault City
	if (cur_map_index == 15) then begin
		move_to(self_obj, (96 * 200) + 124, 0);
		stab := (((tile_num(self_obj) / 200) - 7) * 200) + ((tile_num(self_obj) % 200) - 4);
		if (party_member_obj(532) > 0) then begin
			move_to(dude_obj, stab, elevation(self_obj));
		end
	end

So far, I have come up with the following replacement lines for Klamath:

Code:
stab := (((tile_num(self_obj) / 200) - 6) * 200) + ((tile_num(self_obj) % 200) - 3);

and for Vault City:

Code:
stab := (((tile_num(self_obj) / 200) + 1) * 200) + ((tile_num(self_obj) % 200) - 7);

What I seem to have noticed is that as the player continues to fly to Vault City and Klamath, more and more tiles of those maps around the Vertibird become impassable to the player (even though there are no Vertibird graphics there), causing him/her to get stuck after several flights to those locations. These modified codes seem to solve the problem with the player getting stuck in those cities, but the trunk eventually becomes inaccessible after a few flights to those cities due to this anomaly. My guess is that there is some issue with the destroy_vertibird procedure in which some tiles are not properly being marked passable upon erasing the Vertibird 'scenery'.

Anyway, thanks again Avega! :rockon:
 
Back
Top