Header files not included into script but nevertheless used?

Femic

First time out of the vault
Hi all,

if you open ACKLINT.SSL located in the BIS Mapper scripts you'll see this:
Code:
#include "..\headers\define.h"
//#include "..\headers\<TownName.h>"

#define NAME                    SCRIPT_ACKLINT
#define TOWN_REP_VAR            (GVAR_TOWN_REP_ARROYO)

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

If you scroll a bit down you'll see this:
Code:
procedure map_enter_p_proc begin
   variable pole;

   Only_Once:=0;
   critter_add_trait(self_obj,TRAIT_OBJECT,OBJECT_TEAM_NUM,TEAM_ARROYO);
   critter_add_trait(self_obj,TRAIT_OBJECT,OBJECT_AI_PACKET,AI_ARROYO_WARRIOR);

   if ((tile_contains_obj_pid(21303,0,PID_TEMPLE_SKULL_POLE)) and (global_var(GVAR_START_ARROYO_TRIAL) != 0)) then begin
       pole:=tile_contains_pid_obj(21303,0,PID_TEMPLE_SKULL_POLE);
       move_to(pole,19698,0);
   end
end

If you hover over TEAM_ARROYO and AI_ARROYO_WARRIOR in the Sfall script editor you'll see that they are defined in the files teams.h and AIPacket.h.
But they aren't included into ACKLINT.SSL.
Why aren't they included and how is it nevertheless possible to use TEAM_ARROYO and AI_ARROYO_WARRIOR?
 
If you hover over TEAM_ARROYO and AI_ARROYO_WARRIOR in the Sfall script editor you'll see that they are defined in the files teams.h and AIPacket.h.
But they aren't included into ACKLINT.SSL.
Why aren't they included and how is it nevertheless possible to use TEAM_ARROYO and AI_ARROYO_WARRIOR?
Because they are included in Define.h.
 
So you could also include ModReact.h to define.h and use any entry of ModReact.h in your script aslong you include define.h into your script?
Otherwise would it be also possible to just write...
Code:
#include "..\headers\teams.h"
#include "..\headers\AIPacket.h"
into you script?
 
So you could also include ModReact.h to define.h and use any entry of ModReact.h in your script aslong you include define.h into your script?
Yes, that's how header files work, not just in Fallout SSL but also C/C++ and various programming languages.
 
Do I understand it correctly that TEAM_ARROYO and AI_ARROYO_WARRIOR are so called constants that can be used like macros in every script?
The difference between constants and macros is that a constant is a defined variable in a header file and a macro is a shortener for commands (command == function?) also defined in header files, right?
 
Back
Top