[FO2]Problem with M_VAR and L_VAR

Berth

First time out of the vault
(first of all sorry for my bad english)
i asked my question somewhere else on the forum but maybe in the wrong place, so i post here.
My problem is about M_VAR and L_VAR (and certainly G_VAR but i didn't try)
I already have done some simple scripts that are working fine, (mainly simple dialogs) but each time i try to use a l_var or a m_var, it doesn't work, everithing goes right during compilation, but when i make tests nothing happen. that's strange because i defined each of them, and gave them a value but the game makes as they don't exist. may someone knows how to fix my problem because i don't found the solution by myself( neither on the web)
 
i'm no scripter, but i've tinkered with a few..
are you actually trying the scripts in the game, or the game mode in the editor?
because the game mode in the editor doesn't initialise the variables properly most of the time...

i read there was a file where you had to list the variables...
G_VAR's need to be defined in vault13.gam

do the number of L_vars need to be defined in the scripts.lst file?

M_VARs need to be defined in the map script and exported to the other script on the map...
 
i'm using the game for testing my script.

i've created the .gam files associated to my map, i've put the number of Lvar associated to my script in the script.lst file.

thanks for your help, i'll check what you're saying about mvar but i think i've do it too.

but for the moment i'll be happy if i manage to make my lvar work
 
wait.. what?
there is only one .gam file... vault13.gam... all the globals are listed there..

you don't make a .gam file for your own maps......

are you defining your L_VARs with a number? you can't just define a L_VAR you know.. you have to give it a number... it doesn't dynamically assign one...

please post an example of your script file for us to look over and see if we can spot any errors...
 
wait.. what?
there is only one .gam file... vault13.gam... all the globals are listed there..

if you browse the maps directory in the master.dat, you'll see there is one .gam for each .map existing, but that's not the matter.

I know i have to assign a number to my lvar, in fact if i did not do it, the compiler won't work.

i try to fix the problem, and i notice that the other lvar like LVAR_Personal_Enemy or LVAR_Looked_Before doesn't work too


here is an exemple of the scripts i make, it's a simple panel. the lvar i had is first_read, i use it in the begining of the dialog.


/*
Copyright 1998-2003 Interplay Entertainment Corp.
All rights reserved.
*/

/*
Name: xipanl
Location: Abbey
Description: note panel

Log:

Created: Mai 21 2004
Updated:
*/

/* Include Files */
#include "..\headers\define.h"
#define NAME SCRIPT_XIPANL
#include "..\headers\command.h"
#include "..\headers\Abbey.h"

/* Standard Script Procedures */
procedure start;
procedure look_at_p_proc;
procedure description_p_proc;
procedure map_enter_p_proc;
procedure map_exit_p_proc;
procedure timed_event_p_proc;
procedure use_p_proc;

/* Script Specific Procedure Calls */
procedure Node999; // This Node is Always Ending

procedure Node001;
procedure Node002;
procedure Node003;
procedure Node004;
procedure Node005;
procedure Node006;
procedure Node007;
procedure Node008;
procedure Node009;
procedure Node010;


/* Local Variables which are saved. All Local Variables need to be
prepended by LVAR_ */
#define LVAR_Flags (0)
#define LVAR_ABBEY_BB_NOTE (1)
#define LVAR_Remove_Post_time (2)
#define LVAR_First_Read (3)

procedure start begin
end

procedure timed_event_p_proc begin
end

procedure map_enter_p_proc begin
if (is_loading_game == false) then begin
end
if (map_first_run) then begin
set_local_var(LVAR_First_Read,0);
end

end

procedure map_exit_p_proc begin
end

procedure use_p_proc begin

if (dude_is_stupid) then begin
call Node010;
end else begin
start_dialog_at_node(Node001);
end
end

procedure look_at_p_proc begin
script_overrides;
display_mstr(100);
end

procedure description_p_proc begin
script_overrides;
display_mstr(101);
set_examined;
end

procedure Node999 begin
end

procedure Node001 begin
if (local_var(LVAR_First_Read) == 0) then begin
set_local_var(LVAR_First_Read,1);
Reply(104);

end else begin
Reply(105);

end
NOption(106, Node002, 004); //resh
NOption(107, Node003, 004); //berth
NOption(108, Node004, 004); //lien
NOption(109, Node005, 004); //swoo
NOption(200, Node999, 004);
end
procedure Node002 begin
Reply(110);
NOption(202, Node006, 004);
NOption(201, Node001, 004);
NOption(200, Node999, 004);
end
procedure Node003 begin
Reply(111);
NOption(202, Node007, 004);
NOption(201, Node001, 004);
NOption(200, Node999, 004);
end
procedure Node004 begin
Reply(112);
NOption(202, Node008, 004);
NOption(201, Node001, 004);
NOption(200, Node999, 004);
end
procedure Node005 begin
Reply(113);
NOption(203, Node009, 004);
NOption(201, Node001, 004);
NOption(200, Node999, 004);
end
procedure Node006 begin
Reply(114);
NOption(201, Node001, 004);
NOption(200, Node999, 004);
end
procedure Node007 begin
Reply(115);
NOption(201, Node001, 004);
NOption(200, Node999, 004);
end
procedure Node008 begin
Reply(116);
NOption(201, Node001, 004);
NOption(200, Node999, 004);
end
procedure Node009 begin
Reply(117);
NOption(201, Node001, 004);
NOption(200, Node999, 004);
end
procedure Node010 begin
display_mstr(102);
dude_floater(103);
end
 
looks fine to me.. i do note however that 95 percent of the scripts i've looked at start the LVAR defines at (4)..
maybe 0, 1, 2, and 3, are defined in the header file for use in things like dialogues???...
 
maybe, but in orher script, i add lvar with number 10 or 11 and i don't think those numbers are used by the game engine like the 0,1,2 or 3 could be and it doesn't work too
 
i finally found where i was wrong. Listen to me everybody, the name of your scripts should NEVER begin with the "x" letter...

i put an "a" and all works fine.
 
Back
Top