Help a scripting retard with his script.

dvukomanovic

It Wandered In From the Wastes
Please, solve this and prove that Im a complite retard.

Here's the script:

Code:
/* Include Files */ 
#include "..\headers\define.h" 
#include "..\headers\SCRIPTS.H" 
#include "..\headers\command.h" 
#include "..\headers\NewReno.h" 
 
#define NAME                    SCRIPT_IREWI 
 
/* Defines and Macros */ 
 
/* Standard Script Procedures */ 
procedure start; 
procedure use_p_proc; 
 
procedure start begin 
end 
 
procedure use_p_proc begin 
   script_overrides; 
   gfade_out(ONE_GAME_SECOND); 
      critter_add_trait(dude_obj, PERK_night_vision, 1); 
      display_mstr(100); 
   gfade_in(ONE_GAME_SECOND); 
   scr_return(1); 
end
And, yes I read this and here's my script.h (just the bottom lines):

Code:
#define SCRIPT_NTRICROM         (1303)  // ntRicRom.int    ; New Reno Richard Wright Room Spacial 
#define SCRIPT_IREWI		(1304)	// dvIREWI.int	   ; L.I.M.O.N. Mod - Infra Red Eye-Wear Implant 
 
#endif // SCRIPTS_H

It's getting late and i can't get a simple script to work because god-knows why. Help me PLIZZZ!!!!
Oh, and feel free to delete this topic after I get my questions... i mean answers. :)
 
It doesn't look like you even asked a question, but I will assume you are asking why your script is not being used by the game.

Are you sure you added your script to SCRIPTS.LST and scrname.msg in addition to the above files you mentioned?
 
My Bad! I Told ya it is late!

I can't get this Thing to compile!
says undifined symbol for the NAME!

I'll include it in de script.lst if i ever get there! :roll: :cry:
 
Try this as well.

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

and place it after

#define NAME SCRIPT_IREWI
 
critter_add_trait requires four parameters
critter_add_trait(who (ObjectPtr), trait_type (int), trait (int), amount (int))
example critter_add_trait(dude_obj,TRAIT_PERK,PERK_gecko_skinning_perk,1)
You are missing the second parameter, trait type keyword TRAIT_PERK

Now ... if you change that, you still get the NAME error. This is because the #define for NAME must be positioned before command.h

#define NAME SCRIPT_IREWI
#include "..\headers\command.h"

With those two changes ... script compiled successfully.

Now here's a tip, I didn't find that right away. I knew about the positioning of NAME so fixed that, but sometimes FSE doesn't give a good error message, or none at all. If what FSE says doesn't make sense or doesn't give enough info, what you need to do is look at the line number of the error in temp.i. This is an intermediary script source with all of the #includes parsed in. temp.i is placed in the bin directory of FSE. By opening temp.i in an editor that shows line numbers, and navigating to the line number shown by the error in FSE, you find your error ....
 
thanks dude_obj!

Thing about includes is that they were beneath the NAME first time I tried, But I'll try again never the less.
I didn't know about four parameters so thanks for that as well (that is the only thing I wrote in this script and I got it wrong :) )
I don't use FSE (but now I think I should) i do it all with DOS commands like temp.c, temp.ssl, compile, /w4 /of= blah blah... and i get my error line (something like 10556) i go there and i see something like gSay_Reply(NAME,stored_msg) ;
Well I'll go and try. i'll put scripts.h under NAME as well. Thanks again! :wink:

EDIT:

Well, I'm still getting my errors! I tried EVERYTHING! What's with the NAME thing!? Should I use numbers insted (1304)? Should I Kill someone? Maybe I should kill myself! Could somone, PLEASE, try and compile this script!? The original script was NICATPW5.SSL (cat paw 5) from New Reno. And it didn't have include scripts.h. AND IT WORKED!!!!! :evil:
 
I managed to compile it when I got ridd of the New Reno header include.
Code:
#include "..\headers\define.h"
//#include "..\headers\NewReno.h"
#define NAME                    SCRIPT_IREWY

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

procedure start;
procedure use_p_proc;
procedure pickup_p_proc;
procedure destroy_p_proc;
procedure drop_p_proc;

procedure start begin
end

procedure pickup_p_proc
begin

end

procedure destroy_p_proc
begin

end

procedure drop_p_proc
begin

end
 
procedure use_p_proc begin
script_overrides; 
   gfade_out(ONE_GAME_SECOND);
   gfade_in(ONE_GAME_SECOND);
      critter_add_trait(dude_obj,TRAIT_PERK,PERK_night_vision,1);
       display_msg(mstr(100));
      //display_mstr(100);    
   scr_return(1);  
end
(I don't know if the rest of the stuff I edited make a difference.)
Bye!
 
I've tried your code and i can't compile it as well!

I dont know what am i doing wrong: here's step by step what i do to make script (*.int)

1. Write code in temp.c file
2. add script name in ..\HEADERS\SCRIPTS.H
3. pre-pocess it with comand:
wcc386 temp.c /pc /fo=temp.SSL /w4
4. Get temp.ssl
5. use command:
DOS4GW.exe compile.exe temp.ssl

6. get error: DOS/4GW Protected Mode Run-time Version 1.97
Copyright (c) Rational Systems, Inc. 1990-1994
Compiling TEMP.SSL
TEMP.SSL(9238): Error! Undefined symbol SCRIPT_IREWI
 
dvukomanovic said:
I don't use FSE (but now I think I should)

Yes, much easier, although sometimes you need to look in the generated temp.i to find the error (this is effectively the same as temp.ssl, the precompiled source with the included code parsed in). Jargo's FSE has everything, including interplays compiler and watcom preprocessor, all bundled around a productive editor. I won't be going back to using the interplay stuff, ever.

dvukomanovic said:
What's with the NAME thing!?

The command.h header has commands that use NAME, for example
if (NAME == SCRIPT_MCDAVIN)
So your #define of NAME must be placed before the include of command.h, or the compile will fail.


dvukomanovic said:
Should I use numbers insted (1304)?

No, do what I said, and it compiles. ALL scripts in FO2 work this way.

dvukomanovic said:
Should I Kill someone? Maybe I should kill myself!

Create an explosion at tile 17746 elevation 0.


dvukomanovic said:
Could somone, PLEASE, try and compile this script!?

Uh, I did compile it yesterday, with the changes I described. All you need to do is add that TRAIT_PERK and put the NAME define before the include of command.h. Install FSE, paste your code in there, with those changes, and it compiles.

As for watcom and such, that's doing it the hard way (FSE takes care of all of that for you).
 
If you get from Compiler this:
get error: DOS/4GW Protected Mode Run-time Version 1.97
Copyright (c) Rational Systems, Inc. 1990-1994
Compiling TEMP.SSL
TEMP.SSL(9238): Error! Undefined symbol SCRIPT_IREWI
Then precompilation(with watcom) went wrong, since you should not have any macros in your precompiled file TEMP.SSL.
Instead of SCRIPT_IREWI there should be number 1304.
Did you get some errors from Watcom? Like:
Code:
C:\Program Files\Black Isle\Fallout 2 Mapper\scripts\acklint.ssl(4): Error! E1055: Unable to open '..\Fallout 2 Mapper\scripts\headers\define.h'

And since the only place where you used SCRIPT_IREWI is
Code:
#define NAME                    SCRIPT_IREWI
Then probably you have wrong patch to included define.h and command.h files.
If your script is in mapper/scripts folder then remove dots".." from #include statement.
from this:
Code:
#include "..\headers\command.h"
to this:
Code:
#include "\headers\command.h"

ah and Dude this problem :
Now here's a tip, I didn't find that right away. I knew about the positioning of NAME so fixed that, but sometimes FSE doesn't give a good error message, or none at all. If what FSE says doesn't make sense or doesn't give enough info, what you need to do is look at the line number of the error in temp.i. This is an intermediary script source with all of the #includes parsed in. temp.i is placed in the bin directory of FSE. By opening temp.i in an editor that shows line numbers, and navigating to the line number shown by the error in FSE, you find your error ....
is solved by now in my personal version of FSE but i need to finish new dialog creator before release(now it don't work at all).
 
dvukomanovic said:
6. get error: DOS/4GW Protected Mode Run-time Version 1.97
Copyright (c) Rational Systems, Inc. 1990-1994
Compiling TEMP.SSL
TEMP.SSL(9238): Error! Undefined symbol SCRIPT_IREWI

Oops I didn't notice this before. I used to use a modified version of the p.bat that came with the mapper, but since I started using FSE it is so much easier. I highly recommend trying FSE rather than using watcom and dos4gw/compile.

On the FSE topic, Jargo, two suggestions for FSE

1) Since the algorithm that attempts to highlight where the error is doesn't always work, why not show temp.i in another pane and highlight the error there at its actual line number? This would make it a lot easier to use.

2) I haven't found a way to turn off the auto-complete function. Is there no way? If not, I really wish there was. I really don't like tools that pop up windows while I type.
 
1) Since the algorithm that attempts to highlight where the error is doesn't always work, why not show temp.i in another pane and highlight the error there at its actual line number? This would make it a lot easier to use.
In very similar way it works in new version
- first FSE try to find error line in script file
- if not found then it opens temp.i and show in that file
- user has option to always showing temp.i

2) I haven't found a way to turn off the auto-complete function. Is there no way? If not, I really wish there was. I really don't like tools that pop up windows while I type.
There is no switch for that, but it can be easy done so i will put it in new version;).
 
Well, I'll have to thank you all for your help... and softwer you developed. I'm downloading FSE (newer version) as I type... on more question:

does the two dots at the begining of an included h file path mean "in current dir", or does it mean "on step up"?
 
Two dots means up one level, just as is does in DOS and UNIX. Looks at the way the script source was layed out in the mapper2 directories. The header directory is at the same level as maps or den or generic. You don't have to do it that way, as long as the compiler knows where to find the headers. You will see that Jargo's FSE allows you to configure where the headers are.
 
ok, but there is the problem!
I "told" FSE where the headers are, but in the script it saya ..\headers\define.h
and it keeps giving me error on *.h location. I managed to overcome the proplem by including them as files instead with their full path.

Plus edit msg is little buggy :P
 
dvukomanovic said:
ok, but there is the problem!
I "told" FSE where the headers are, but in the script it saya ..\headers\define.h

They work for me exactly as is, but my script source is at the same directory level as the headers directory. For example:

\fo2xp\source\headers
\fo2xp\source\rndenctr

My scripts in rndenctr directory refer to ..\headers so thats okay.
If headers was a subdir of rndenctr I'd skip the ..\
If headers were in the same dir I'd just list the header name.
 
It looks to me like the configuration of where header files are isn't working properly in FSE (sorry I thought it did work). I created a new directory C:\headers and put them there, configured FSE to point there, and it does not include the headers.

That being the case, in the #include, just use relative path from where your source files are, like I said earlier.
 
Hey guys, Headers folder is used for many many things in FSE :)(registering script,global and map variables,auto-completion etc) but NOT for include.
Watcom always take #include from script, an it should be ;).
To solve problem with includes go to options and check "Update #include on script load" after that FSE will update your #include if they need it. :)
BTW there sims to be some bug with updating so will appreciate some testing.
 
Back
Top