peacefull critters... arg

Berth

First time out of the vault
it's me anew, i gat an other problem...indeed, all the critters i made (with my script in fact) won't attacke the hero when i use Node998 in my dialogs...does anybody know how to fix it. thanks.
 
If you use mapper to test this script then set in mapper.cfg

run_mapper_as_game=1

After install it is set to 0 and no critter will attack player.( Thx: ColJack) :wink:
 
here is the source but it's quite long

#include "..\headers\define.h"
#include "..\headers\abbeyres.h"

#define NAME SCRIPT_ACBERTH
#define TOWN_REP_VAR (GVAR_TOWN_REP_ABBEY)

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


/* Standard Script Procedures */
procedure start;
procedure critter_p_proc;
procedure pickup_p_proc;
procedure talk_p_proc;
procedure destroy_p_proc;
procedure look_at_p_proc;
procedure description_p_proc;
procedure use_skill_on_p_proc;
procedure damage_p_proc;
procedure map_enter_p_proc;
procedure timed_event_p_proc;
/* Script Specific Procedure Calls */
procedure Node998; // This Node is Always Combat
procedure Node999; // This Node is Always Ending


// The next lines are added in by the Designer Tool.
// Do NOT add in any lines here.
//~~~~~~~~~~~~~~~~ DESIGNER TOOL STARTS HERE
procedure Node000;
procedure Node001;
procedure Node002;
procedure Node003;
procedure Node004;
procedure Node005;
procedure Node006;
procedure Node007;
procedure Node008;
procedure Node009;
procedure Node010;
procedure Node011;
procedure Node011a;
procedure Node012;
procedure Node013;
procedure Node014;
procedure Node015;
procedure Node016;


procedure Node990;
procedure Node989;
procedure Node988;
procedure Node987;
procedure Node986;
procedure Node985;
procedure Node984;
procedure Node983;
procedure Node982;
procedure Node981;
procedure Node980;
procedure Node979;
procedure Node978;
procedure Node977;

//~~~~~~~~~~~~~~~~ DESIGN TOOL ENDS HERE
// The Following lines are for anything that is not needed to be
// seen by the design Tool


/* Local Variables which are saved. All Local Variables need to be
prepended by LVAR_ */
#define LVAR_Herebefore (4)
#define LVAR_Hostile (5)
#define LVAR_Personal_Enemy (6)
#define LVAR_Looked_Before (7)
#define LVAR_Is_Known (8)
#define LVAR_Is_Gunsmith (9)

/* Imported variables from the Map scripts. These should only be
pointers and variables that need not be saved. If a variable
Needs to be saved, make it a map variable (MVAR_) */


/* Local variables which do not need to be saved between map changes. */
variable Only_Once:=0;
import variable lien_rag;


procedure start begin
end

/* This procedure will get called each time that the map is first entered. It will
set up the Team number and AI packet for this critter. This will override the
default from the prototype, and needs to be set in scripts. */
procedure map_enter_p_proc begin
script_overrides;


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

if (night) then begin
move_to(self_obj, berth_night_tile, self_elevation);
end


end


/* Every heartbeat that the critter gets, this procedure will be called. Anything from
Movement to attacking the player on sight can be placed in here.*/
procedure critter_p_proc begin

/* If the critter is mad at the player for any reason, it will attack and remember to attack
the player should the game be saved and loaded repeatedly. Additionally, if any special
actions need to be taken by the critter based on previous combat, the critter will remember
this as well. */

if ((local_var(LVAR_Hostile) == 2) and (obj_can_see_obj(self_obj,dude_obj))) then begin
set_local_var(LVAR_Hostile,1);
attack(dude_obj);
end
move_at_night(berth_night_tile) //warning personnal macro
if night then rot_at_tile(berth_night_tile,berth_night_rot) //warning personnal macro

move_at_morning(berth_day_tile)//warning personnal macro
if morning then rot_at_tile(berth_day_tile,berth_day_rot) //warning personnal macro

end

/* Whenever the critter takes damage of any type, this procedure will be called. Things
like setting ENEMY_ and LVAR_Personal_Enemy can be set here. */
procedure damage_p_proc begin

/* If the player causes damage to this critter, then he will instantly consider the player
his personal enemy. In Critter_Proc or through dialog, actions will be taken against
the player for his evil acts. */
if (source_obj == dude_obj) then begin
set_local_var(LVAR_Personal_Enemy,1);
set_global_var(GVAR_ENEMY_ABBEY,1);
end

end

procedure timed_event_p_proc begin
end

/* Any time that the player is caught stealing from this critter, Pickup_proc will be called.
In here, various things can happen. The most common response is instant hostility which
will be remembered. */
procedure pickup_p_proc begin
if (source_obj == dude_obj) then begin
set_local_var(LVAR_Hostile,2);
end
end

/* The dialog system is setup and prepares the player to talk to this NPC. Where To Go
written by designers are placed in here. Additionally, Reactions are generated and
stored which affects player interactions. */
procedure talk_p_proc begin
Evil_Critter:=0;
Slavery_Tolerant:=SLAVE_TOLERANT;
Karma_Perception:=KARMA_PERCEPTION1;

CheckKarma;

GetReaction;
if (obj_name(dude_obj)=="NONE") then
begin
start_gdialog(NAME,self_obj,4,-1,-1);
gSay_Start;
call Node010;
gSay_End;
end_dialogue;
end
else if night then begin
call Node000;
end
else begin
start_gdialog(NAME,self_obj,4,13,BACKGROUND_ADOBE);
gSay_Start;
call Node001;
gSay_End;
end_dialogue;
end
end

/* This procedure gets called only on the death of this NPC. Special things like
incrementing the death count for reputation purposes and Enemy Counters are placed
in here. */
procedure destroy_p_proc begin

/* Increment the aligned critter counter*/
inc_good_critter

/* Set global_variable for Enemy status*/
end

/* Look_at_p_proc gets called any time that the player passes the cursor over any object.
This should only hold the most cursory of glances for the player. */
procedure look_at_p_proc begin
script_overrides;
if (local_var(LVAR_Looked_Before) == 0) then begin
set_local_var(LVAR_Looked_Before,1);
display_msg(mstr(100));
end
else
display_msg(mstr(101));
end

/* The player will see more indepth descriptions from this procedure. They are actively
looking at the critter and want more information. Things like names can be added here
if the critter is known to the player. */
procedure description_p_proc begin
script_overrides;
display_msg(mstr(102));
end

/* Any time a skill is used on a critter this call is made. This can be to give examinations
for things like Doctor skill or messages for various other skills. */
procedure use_skill_on_p_proc begin
end

/* Should the Player ever cause the NPC too much discomfort that he desires to attack the player,
this call will be made. Essentially, it stores the Hostile vaule so that the critter remembers
he was once hostile towards the player.*/
procedure Node998 begin
set_local_var(LVAR_Hostile,2);
end

/* Anytime that there is a need for an ending to dialog, this node is to be called. It will just
exit from the dialog system without any reprisals from the NPC. */
procedure Node999 begin
end

//weapons upgrade procedures


procedure Node990 begin
remove_pid_qty(dude_obj, PID_44_MAGNUM_REVOLVER, 1)
give_pid_qty(dude_obj, PID_44_MAGNUM_SPEEDLOADER, 1)
call Node011;
end
procedure Node989 begin
remove_pid_qty(dude_obj, PID_DESERT_EAGLE, 1)
give_pid_qty(dude_obj, PID_DESERT_EAGLE_EXT_MAG, 1)
call Node011;
end
procedure Node988 begin
remove_pid_qty(dude_obj, PID_LASER_PISTOL, 1)
give_pid_qty(dude_obj, PID_MAGNETO_LASER_PISTOL, 1)
call Node011;
end
procedure Node987 begin
remove_pid_qty(dude_obj, PID_PLASMA_PISTOL, 1)
give_pid_qty(dude_obj, PID_PLASMA_PISTOL_EXT_CART, 1)
call Node011;
end
procedure Node986 begin
remove_pid_qty(dude_obj, PID_HUNTING_RIFLE, 1)
give_pid_qty(dude_obj, PID_SCOPED_HUNTING_RIFLE, 1)
call Node011;
end
procedure Node985 begin
remove_pid_qty(dude_obj, PID_ASSAULT_RIFLE, 1)
give_pid_qty(dude_obj, PID_ASSAULT_RIFLE_EXT_MAG, 1)
call Node011;
end
procedure Node984 begin
remove_pid_qty(dude_obj, PID_FN_FAL, 1)
give_pid_qty(dude_obj, PID_FN_FAL_NIGHT_SCOPE, 1)
call Node011;
end
procedure Node983 begin
remove_pid_qty(dude_obj, PID_LASER_RIFLE, 1)
give_pid_qty(dude_obj, PID_LASER_RIFLE_EXT_CAP, 1)
call Node011;
end
procedure Node982 begin
remove_pid_qty(dude_obj, PID_FLAMER, 1)
give_pid_qty(dude_obj, PID_IMPROVED_FLAMETHROWER, 1)
call Node011;
end
procedure Node981 begin
remove_pid_qty(dude_obj, PID_PLASMA_RIFLE, 1)
give_pid_qty(dude_obj, PID_TURBO_PLASMA_RIFLE, 1)
call Node011;
end
procedure Node980 begin
remove_pid_qty(dude_obj, PID_FLAMETHROWER_FUEL, 1)
give_pid_qty(dude_obj, PID_FLAMETHROWER_FUEL_MK_II, 1)
call Node011;
end
procedure Node979 begin
remove_pid_qty(dude_obj, PID_CATTLE_PROD, 1)
give_pid_qty(dude_obj, PID_SUPER_CATTLE_PROD, 1)
call Node011;
end
procedure Node978 begin
remove_pid_qty(dude_obj, PID_POWER_FIST, 1)
give_pid_qty(dude_obj, PID_MEGA_POWER_FIST, 1)
call Node011;
end

procedure Node977 begin
remove_pid_qty(dude_obj, PID_COMBAT_SHOTGUN, 1)
give_pid_qty(dude_obj, PID_CITY_KILLER_UP, 1)
call Node011;
end

// Not lines are allowed to be added below here
// The Following lines are from the Design Tool
//~~~~~~~~~~~~~~~~ DESIGN TOOL STARTS HERE

procedure Node000 begin
if (tile_num(self_obj)==berth_night_tile) then
begin floater(400);
add_timer_event( self_obj, game_ticks(3), 3);
float_msg(lien_rag, message_str(NAME,401), FLOAT_MSG_WHITE);
end
end

procedure Node001 begin
Reply(103);

NOption(104,Node999,004);
if (lvar(LVAR_Is_Known)==1 and lvar(LVAR_Is_Gunsmith)==1) then NOption(140,Node011a,004);
else NOption(105,Node002,004);
NOption(106,Node003,004);

end

procedure Node002 begin
Reply(107);

NOption(108,Node004,004);
if (map_var(MVAR_Lien_Berth)==1) then
begin
NOption(109,Node005,004);
end
NOption(104,Node999,004);
slvar(LVAR_Is_Known,1);
end


procedure Node003 begin
Reply(112);

NOption(113,Node006,004);
NOption(117,Node007,004);
end

procedure Node004 begin
Reply(111);

NOption(119,Node008,004);
NOption(130,Node011a,004);
NOption(120,Node999,004);
end

procedure Node005 begin
Reply(110);
NOption(122,Node009,004);
NOption(121,Node999,004);
end

procedure Node006 begin
Reply(114);
NOption(115,Node999,004);
NOption(116,Node998,004);

end

procedure Node007 begin
Reply(118);
NOption(122,Node009,004);
NOption(108,Node004,004);
NOption(116,Node008,004);

end

procedure Node008 begin
Reply(124);

NOption(120,Node999,004);
end

procedure Node009 begin
Reply(123);

NOption(120,Node999,004);

end

procedure Node010 begin
blue_floater(200);
end

procedure Node011a begin
Reply(131);
NOption(133,Node012,004);
NOption(132,Node999,004);
slvar(LVAR_Is_Gunsmith,1);
end

procedure Node011 begin
gfade_out(ONE_GAME_MINUTE);
game_time_advance(ONE_GAME_HOUR);
gfade_in(ONE_GAME_MINUTE);
Reply(260);
NOption(261, Node012, 004);
NOption(262, Node999, 004);
dude_pay_self(400)
end

procedure Node012 begin
Reply(250);
if (dude_caps >= 400) then begin
if ((dude_carry_obj(PID_44_MAGNUM_REVOLVER) > 0) or
(dude_carry_obj(PID_DESERT_EAGLE) > 0) or
(dude_carry_obj(PID_LASER_PISTOL) > 0) or
(dude_carry_obj(PID_PLASMA_PISTOL) > 0)) then begin
NOption(251, Node013, 004);
end
if ((dude_carry_obj(PID_HUNTING_RIFLE) > 0) or
(dude_carry_obj(PID_LASER_RIFLE) > 0) or
(dude_carry_obj(PID_ASSAULT_RIFLE) > 0) or
(dude_carry_obj(PID_PLASMA_RIFLE) > 0) or
(dude_carry_obj(PID_FN_FAL) > 0) or
(dude_carry_obj(PID_FLAMER) > 0) or
(dude_carry_obj(PID_COMBAT_SHOTGUN) > 0)) then begin
NOption(252, Node014, 004);
end
if (dude_carry_obj(PID_FLAMETHROWER_FUEL) > 0) then begin
NOption(253, Node015, 004);
end
if ((dude_carry_obj(PID_POWER_FIST) > 0) or
(dude_carry_obj(PID_CATTLE_PROD) > 0)) then begin
NOption(254, Node016, 004);
end
NOption(255, Node999, 004);
end
NOption(141,Node999,004);
end

procedure Node013 begin
Reply(265);
if (dude_carry_obj(PID_44_MAGNUM_REVOLVER) > 0) then begin
NOption(266, Node990, 004);
end
if (dude_carry_obj(PID_DESERT_EAGLE) > 0) then begin
NOption(267, Node989, 004);
end
if (dude_carry_obj(PID_LASER_PISTOL) > 0) then begin
NOption(268, Node988, 004);
end
if (dude_carry_obj(PID_PLASMA_PISTOL) > 0) then begin
NOption(269, Node987, 004);
end
NOption(270, Node012, 004);
NOption(271, Node999, 004);
end
procedure Node014 begin
Reply(265);
if (dude_carry_obj(PID_HUNTING_RIFLE) > 0) then begin
NOption(276, Node986, 004);
end
if (dude_carry_obj(PID_ASSAULT_RIFLE) > 0) then begin
NOption(277, Node985, 004);
end
if (dude_carry_obj(PID_FN_FAL) > 0) then begin
NOption(278, Node984, 004);
end
if (dude_carry_obj(PID_LASER_RIFLE) > 0) then begin
NOption(279, Node983, 004);
end
if (dude_carry_obj(PID_FLAMER) > 0) then begin
NOption(280, Node982, 004);
end
if (dude_carry_obj(PID_PLASMA_RIFLE) > 0) then begin
NOption(281, Node981, 004);
end
if (dude_carry_obj(PID_COMBAT_SHOTGUN) > 0) then begin
NOption(282, Node977, 004);
end
NOption(270, Node012, 004);
NOption(271, Node999, 004);
end
procedure Node015 begin
Reply(265);
if (dude_carry_obj(PID_FLAMETHROWER_FUEL) > 0) then begin
NOption(291 + (check_general_rep >= 0), Node980, 004);
end
NOption(270, Node012, 004);
NOption(271, Node999, 004);
end
procedure Node016 begin
Reply(265);
if (dude_carry_obj(PID_CATTLE_PROD) > 0) then begin
NOption(301, Node979, 004);
end
if (dude_carry_obj(PID_POWER_FIST) > 0) then begin
NOption(302, Node978, 004);
end
NOption(270, Node012, 004);
NOption(271, Node999, 004);
end
//xxxxxxxxxxxxxxxxxxxx


btw the script works fine execpt the part concerning combat...
 
I have tested it and it works fine. Critter is attacking player (from dialog- node998).
 
arg...
thanks jargo, i'll check my mapper.cfg file to be sure all is good...

is it possible the problem comes from my version of watcom (9.5)

[EDIT] apparently now the problem seems to come from the map where i use my script, i tried to use it somewhere else and, oh miracle, it did work. I use it first on a new map (abbey map). maybe have i to modify city.txt or map.txt...
 
Hi

Can someone post a working compiler in a working environment ?
If its free only, of course....

I never got any of the compilers to work - in their DLable form at least....



Greetings
Jona
 
Depends. Do you mean a C compiler or one for the Fallout scripts?

There's a lot of free and open source C/C++ compilers, the best known being GNU GCC/G++, which usually comes with about every distro of Linux and is also downloadable for Windows systems as far as I remember (I think it also comes with CygWin alias Cygnus for Windows, a free Unix shell for Windows).

Just google.
 
Back
Top