Start hex overriding exit grid destination.

Sirren67

Look, Ma! Two Heads!
I've this problem with a map: the first time I enter it all is fine, the second time the start hex overrides the exit grid destination. The third time the game crashes. This happens in game and only started lately. I haven't tinkered with this map for a while (months, actually) and this trouble is new to me... What's wrong? Map script? Starting hex (is there a way to get rid of it?)?
 
Well it is like this:

1)Start hex i a default position.
2)When teleporting using hex grid it always override start hex.
3)In map script you can use override_map_start function to set new position on map enter.
In map script before using override_map_start you use global variable GVAR_LOAD_MAP_INDEX to determine from what map player come (worldmap = 0 ,values above 0 is map number).

So in your case problem my be in map script since only he can override hex grid.
 
Apparently there's more...
This is my map script:

#include "..\headers\define.h"
#include "..\headers\FLOFFICE.h"
#include "..\headers\updatmap.h"
#define NAME SCRIPT_FLOFFICE
#include "..\headers\command.h"

procedure start;
procedure map_enter_p_proc;
procedure map_update_p_proc;

export variable generic_temp_box;
export variable po_luke_box_obj;
export variable luke_obj;

procedure start begin
end

procedure map_enter_p_proc begin
variable critter;

if ((global_var(GVAR_TALKED_KATHY) == 0) or (global_var(GVAR_HELP_KATHY) == 0)) then begin
Critter:=create_object_sid(PID_BOOTLEGGER_FEMALE,0,0,SCRIPT_FCMCUL3);
critter_attempt_placement(Critter,20308,0);
end

if (is_loading_game == false) then begin
if (map_first_run) then begin
display_msg(mstr(100));
end
end

if (elevation(dude_obj) == 0) then begin
Lighting;
end
else begin
Full_Light;
end

set_global_var(GVAR_LOAD_MAP_INDEX,0);

end

procedure map_update_p_proc begin

if (elevation(dude_obj) == 0) then begin
Lighting;
end
else begin
Full_Light;
end
end

It already contained GVAR_LOAD_MAP, I tinkered with it for a while (I also completely erased it) to no avail. I checked the spawned critter script, it didn't set the gvars on 1+, edited it, I also got rid of it... No luck.
In this current form the map behaves as follows:
First time I enter all is fine, I get the "first time enter" msg, the critter is spawned.
From the second time on: I get the "first time enter" msg, the critter is not spawned, Pc is spawned according to the start hex, not according the exit grid. After I enter the map some 1/4 more times then the game crashes.
It seems that somehow I replicated the well known Den bug of unofficial patch 1.4. Actually I already had such a problem with my artemple map (map entered for the first time many times), but it didn't crash the game. It also simply ceased to happen in a week or so, and never happened anymore. Do you see a mistake in my map script, or odds are there's something in another script?
 
Your script is ok.
The set_global_var(GVAR_LOAD_MAP_INDEX,0); is used to set map index to 0 for another use(it should be no problems with that).

The problem must be in map.
Well i have problems with maps before for 3 reasons:

1) Every map need to have start hex and map script.

2) Map must be registered in maps.txt

3) No funky names for maps like 1ssdww.map or map.2.0.map
 
I set a new start hex, and now I get a message stating that "There was a mistake in savinf FLOFFICE.SAV". When i renter that map only tiles are saved... Map's next to empty...
I think I'm getting a 12 hours... Can't afford more ;)

EDIT 2\2\06

Problem solved. I had messed up item protos. I rebuilt them and everyting went right. More in my "Script mistake or prot not read?" thread.
 
Back
Top