map scripts

fuzzi

It Wandered In From the Wastes
Guys I have a big problem. Some of my map scripts don't work and I dunno why :( I tried everything. For example:
Code:
procedure map_enter_p_proc
begin
   if (map_first_run) then begin
      override_map_start_hex(16717, 1, 5);
      display_msg(mstr(100));
   end
end
If I come to this map I don't see msg from *.msg file and hero position is classic(in the middle of map=?). Scripts are properly registred. (scripts.LST, scripts.H, scrname.msg) Btw I use FSE. Can somebody tell me where is problem ?
 
I guess it's the if condition that does it. Try removing "if(map_first_run)" and see if it works.

The code should work, but only the first time you run the map. The mapper use to screw that condition up, so I'm not surprised you're having problems. It might help to restart the mapper and try again.

Does it work if you enter the map from the world map, without having been there before?
 
Hi there Fuzzi. I hope I'm not showing up with something silly again, anyway...
Maps don't come with a standard starting hex, you have to set it manually in the mapper.. Make also sure that in the map script map_enter procedure you set:
set_global_var(GVAR_LOAD_MAP_INDEX,0);
Along with the start hex this is *mandatory* for each map in game. I used to have strange results without this code. I hope this helps.
See you.
 
Sirren67 said:
map_enter procedure you set:
set_global_var(GVAR_LOAD_MAP_INDEX,0);
Code:
GVAR_RADAWAY_ADDICT                     :=0;    //      (25)
GVAR_ALCOHOL_ADDICT                     :=0;    //      (26)
GVAR_LOAD_MAP_INDEX                     :=0;    //      (27)
GVAR_RUNNING_BURNING_GUY                :=0;    //      (28)
GVAR_VIC_DEVICE                         :=0;    //      (29)

Agrajag said:
I guess it's the if condition that does it. Try removing "if(map_first_run)" and see if it works.

The code should work, but only the first time you run the map. The mapper use to screw that condition up, so I'm not surprised you're having problems. It might help to restart the mapper and try again.

Does it work if you enter the map from the world map, without having been there before?

This slice of script is OK. I try it on another map where scripts normally function and no problem.

EDIT: Mabey some wrong numbering of registration files ?
 
set_global_var(GVAR_LOAD_MAP_INDEX,0);

Well, to tell the truth I really can't remember. I was trying to fix a trouble related with LST files some six months ago, stayed on line with Jargo a couple of hours and tried the improbable before figuring the thing out... Amongst other stuff Jargo told me about this piece of code. It's mandatory in all map scripts and it's what you actually override when you teleport the PC from a map to another via script.
Anyway, I don't know if this makes a difference, but I've been brawsing the original scripts and the code aleays reads like:

procedure map_enter_p_proc
begin

override_map_start_hex(16717, 1, 5);

if (map_first_run) then begin
display_msg(mstr(100));
end
end

I.E the override bit is outside the condition block. Is it important?
 
Nope. Problem is that my map scripts are ignored:/ no error msg. I tested debug mod = nothing important. I have 7 maps. 1-OK, 2-OK, 3-OK, 4-OK, 5-map scripts are ignored(critter scripts are OK), 6-ignored, 7-ignored. :(( That's sux.
 
Script appurtenant to map at screenshot. ("Screenshoted" when hero come to map.) I don't see node 100 on left panel. No error msg. Simply total ignored :((

Code:
#include "..\headers\define.h"
#include "..\headers\updatmap.h"

#define NAME                    SCRIPT_BWHOUSE

#include "..\headers\command.h"

procedure start;
procedure map_exit_p_proc;
procedure map_enter_p_proc;
procedure map_update_p_proc;

procedure start begin
end

procedure map_enter_p_proc begin
 if (map_first_run) then begin
   display_msg(mstr(100));
 end
end 

procedure map_update_p_proc begin
   Lighting;
end

procedure map_exit_p_proc begin
end

http://img135.imageshack.us/my.php?image=1000ag0.jpg
 
Omfg I'am really noob. I forget the SET MAP SCRIPT IN MAPPER. Heh pls lock this theard and remove to vat's. Sorry all.
 
Back
Top