OK, here goes. This is the script for the main guy. Just a bit of background to help. On another map, the GVAR is set to 3, and then you are taken to the map with this guy on. Straight away, it's supposed to disable user interface, (to make you watch) float dialogue alternately between the first guy and the other one and then finish. there are no headers, other than main headers.
/* Include Files */
#include "..\headers\define.h"
#define NAME SCRIPT_MODOCT35
#include "..\headers\command.h"
/* Standard Script Procedures */
procedure start;
procedure map_exit_p_proc;
procedure use_p_proc;
procedure look_at_p_proc;
procedure description_p_proc;
procedure use_skill_on_p_proc;
procedure use_obj_on_p_proc;
procedure damage_p_proc;
procedure map_enter_p_proc;
procedure map_update_p_proc;
procedure talk_p_proc;
#define LVAR_Herebefore (4)
#define LVAR_Hostile (5)
#define LVAR_Personal_Enemy (6)
#define LVAR_DONE_THIS (7)
import variable guy_obj;
procedure start begin
if (global_var(GVAR_LAST_BATTLE_BEGIN)==3) then begin
if (local_var(LVAR_DONE_THIS)==0) then begin
add_timer_event(self_obj,10,1);
game_ui_disable;
set_local_var(LVAR_DONE_THIS,1);
end
end
else if (global_var(GVAR_LAST_BATTLE_BEGIN)==2) then begin
if (local_var(LVAR_DONE_THIS)==0) then begin
game_ui_disable;
add_timer_event(self_obj,40,5);
set_local_var(LVAR_DONE_THIS,1);
end
end
end
procedure timed_event_p_proc begin
if (fixed_param ==1) then begin
float_msg(self_obj,message_str(1341,mstr(100)+dude_name+mstr(101)),FLOAT_COLOR_NORMAL);
add_timer_event(self_obj,10,2);
end
else if (fixed_param ==2) then begin
float_msg(guy_obj,message_str(1341,102),FLOAT_COLOR_NORMAL);
add_timer_event(self_obj,10,3);
end
else if (fixed_param ==3) then begin
float_msg(self_obj,message_str(1341,103),FLOAT_COLOR_NORMAL);
add_timer_event(self_obj,10,4);
end
else if (fixed_param == 4) then begin
game_ui_enable;
set_global_var(GVAR_LAST_BATTLE_BEGIN,4);
load_map(151,-1);
end
//this bit is if player is observing the procedings.
else if (fixed_param ==5) then begin
float_msg(self_obj,message_str(1341,104),8);
add_timer_event(self_obj,10,6);
end
else if (fixed_param ==6) then begin
float_msg(guy_obj,message_str(1341,105),8);
add_timer_event(self_obj,10,7);
end
else if (fixed_param ==7) then begin
float_msg(self_obj,message_str(1341,106),8);
add_timer_event(self_obj,10,8);
end
else if (fixed_param ==8) then begin
float_msg(self_obj,message_str(1341,108),8);
add_timer_event(self_obj,10,9);
end
else if (fixed_param == 9) then begin
game_ui_enable;
end
end
procedure use_p_proc begin
end
procedure look_at_p_proc begin
end
procedure description_p_proc begin
end
procedure use_skill_on_p_proc begin
end
procedure use_obj_on_p_proc begin
end
procedure damage_p_proc begin
attack(dude_obj);
end
procedure map_enter_p_proc begin
end
procedure map_update_p_proc begin
end
procedure talk_p_proc begin
end
procedure map_exit_p_proc
begin
destroy_object(self_obj);
end
The script is registered fine and reads the msg file ok. I tested this in game and in the mapper. I never used headers in the previous two versions of other mods and they worked fine.
In the other scripts I have.
Map script....
export variable guy_obj;
Guy's script.
import variable guy_obj; and...
procedure start begin
guy_obj := self_obj;
end
This is an interesting problem. I had trouble the other day with a similar script. It worked perfectly, but on the addition of import variable salvatore_obj; it never worked again, even when I removed this line.
All in all, I need this sort of coding in three places in the mod. There must be something I've missed?