I'm having troubles wit a couple of scripts:
I can't compile this piece of code (only the first var block is o.k.). The mistake is in this procedure, the rest of the script is fine. The error message says: Error! Expected "then". I couldn't find any wrong if/then/begin/parenthesis/comments. What's wrong?
Second script:
This script is meant to destroy a scenery element (a hole), but doesn't behave as intended: in this form the hole can either desappear or desappear after a while. Fadein/fadeout seldom work, xp and msg are not handled. I tried to destroy the hole with or without using a MVAR, I put the "destroy_object(Self_obj);" bit in several procedure: no correct behaviour. Any leads?
Code:
procedure talk_p_proc begin
if (global_var(GVAR_CLEAR_BASEMENT) == 0) then begin
if (local_var(LVAR_Herebefore) == 0) then begin
set_local_var(LVAR_Herebefore,1);
start_gdialog(NAME,self_obj,4,-1,-1);
gSay_Start;
call Node001;
gSay_End;
end_dialogue;
end
else begin
start_gdialog(NAME,self_obj,4,-1,-1);
gSay_Start;
call Node006; //pc talked once, didn't accept the quest
gSay_End;
end_dialogue;
end
end //script compiles until this block
if (GVAR_CLEAR_BASEMENT) >= 1) then begin
if (local_var(LVAR_Herebefore) == 0) then begin
start_gdialog(NAME,self_obj,4,-1,-1);
gSay_Start;
call Node010; //pc wasn't assigned the quest, started on his own
gSay_End;
end_dialogue;
end
else begin
start_gdialog(NAME,self_obj,4,-1,-1);
gSay_Start;
call Node005; //pc accepted quest, not finished yet
gSay_End;
end_dialogue;
end
end
if ((global_var(GVAR_CLEAR_BASEMENT) == 10) and (global_var(GVAR_CLEARED_BASEMENT) == 0)) then begin
set_global_var(GVAR_CLEARED_BASEMENT,1);
start_gdialog(NAME,self_obj,4,-1,-1);
gSay_Start;
call Node008; //pc's over with the quest, he wants his due
gSay_End;
end_dialogue;
end
if ((global_var(GVAR_CLEAR_BASEMENT) == 11) and (global_var(GVAR_CLEARED_BASEMENT) == 1)) then begin
start_gdialog(NAME,self_obj,4,-1,-1);
gSay_Start;
call Node009; //quest's over, general dialogue
gSay_End;
end_dialogue;
end
end
Second script:
Code:
#include "..\headers\define.h"
#define NAME SCRIPT_FLIHOLE
#include "..\headers\flreside.h"
#include "..\headers\command.h"
procedure start;
procedure map_update_p_proc;
procedure use_skill_on_p_proc;
procedure description_p_proc;
procedure look_at_p_proc;
procedure use_p_proc;
procedure destroy_p_proc;
import variable Hole_Fixed;
procedure start begin
end
procedure destroy_p_proc begin
end
procedure use_p_proc begin
end
procedure look_at_p_proc begin
script_overrides;
display_msg(mstr(100));
end
procedure description_p_proc begin
script_overrides;
display_msg(mstr(101));
end
procedure use_skill_on_p_proc begin
variable Skill_Used;
script_overrides;
Skill_Used := action_being_used;
if( Skill_Used == SKILL_SCIENCE ) then begin
if( is_success(roll_vs_skill(dude_obj, SKILL_SCIENCE, 0)) ) then
display_msg(mstr(102));
give_exp_points(30);
end
else if( Skill_Used == SKILL_REPAIR ) then begin
if( is_success(roll_vs_skill(dude_obj, SKILL_REPAIR, 0)) ) then
fadeout(8);
set_map_var(MVAR_Hole_Fixed,1);
inc_global_var(GVAR_CLEAR_BASEMENT);
fadein(8);
end
end
procedure map_update_p_proc begin
if (map_var(MVAR_Hole_Fixed) == 1) then begin
destroy_object(Self_obj);
display_msg(mstr(103));
give_exp_points(30);
end
end
This script is meant to destroy a scenery element (a hole), but doesn't behave as intended: in this form the hole can either desappear or desappear after a while. Fadein/fadeout seldom work, xp and msg are not handled. I tried to destroy the hole with or without using a MVAR, I put the "destroy_object(Self_obj);" bit in several procedure: no correct behaviour. Any leads?