deadguyinadumpster
First time out of the vault
First, I guess I should explain that I have little scripting experience with this game. I tried learning a couple of years ago and quickly gave up. However, I'm trying to get a friend of mine to try the Fallout games. I loaned him my CDs, but for some reason they're not installing properly on his computer. So I just copied the installed games onto a flash drive and was going to give them to him. Then I got an idea... with me giving him the games as they are installed on my computer, I could mod them a bit and it would transfer to his computer. So I'm trying to play a little joke on him by making a character in Klamath named Jeff (his name) who makes comments about how he must be going crazy because he's seeing himself in the game. I just want the script to do two simple things:
1. Produce some floater messages in sequential order (like Melchoir's kid in Redding)
2. If you use fruit on the character, he immediately dies (Jeff hates fruit).
I copied and pasted stuff from other scripts and got this:
#include "C:\Program Files\Black Isle\Fallout 2 Mapper\scripts\HEADERS\define.h"
//#include "..\headers\<TownName>"
#define NAME SCRIPT_ECJEFF
#define TOWN_REP_VAR (GVAR_TOWN_REP_KLAMATH)
#include "C:\Program Files\Black Isle\Fallout 2 Mapper\scripts\HEADERS\command.h"
#include "C:\Program Files\Black Isle\Fallout 2 Mapper\scripts\HEADERS\kladwtn.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 damage_p_proc;
procedure map_enter_p_proc;
procedure use_obj_on_p_proc;
procedure Node001;
procedure killSelf;
#define LVAR_Message (0)
#define LVAR_Hostile (4)
#define LVAR_Personal_Enemy (5)
variable Only_Once:=0;
procedure start begin
end
procedure map_enter_p_proc begin
Only_Once:=0;
critter_add_trait(self_obj,TRAIT_OBJECT,OBJECT_TEAM_NUM,TEAM_KLAMATH);
critter_add_trait(self_obj,TRAIT_OBJECT,OBJECT_AI_PACKET,AI_BERSERKER);
end
procedure critter_p_proc begin
if (((local_var(LVAR_Hostile) == 2)or(local_var(LVAR_Personal_Enemy) == 1)) and (obj_can_see_obj(self_obj,dude_obj))) then begin
set_local_var(LVAR_Hostile,1);
self_attack_dude;
end
end
procedure damage_p_proc begin
if (source_obj == dude_obj) then begin
set_local_var(LVAR_Personal_Enemy,1);
//CHANGE -nbk
set_global_var(GVAR_ENEMY_KLAMATH,1);
end
end
procedure pickup_p_proc begin
if (source_obj == dude_obj) then begin
set_local_var(LVAR_Hostile,2);
end
end
procedure talk_p_proc begin
call Node001;
end
procedure destroy_p_proc begin
inc_good_critter
end
procedure look_at_p_proc begin
script_overrides;
display_mstr(100);
end
procedure description_p_proc begin
script_overrides;
display_mstr(150);
end
procedure use_obj_on_p_proc begin
if ((source_obj == dude_obj) and (obj_pid(obj_being_used_with) == PID_MUTATED_FRUIT)) then begin
call killSelf;
end
end
procedure Node001 begin
floater(200 + local_var(LVAR_Message));
if (local_var(LVAR_Message) < 27) then begin
inc_local_var(LVAR_Message);
end
end
procedure killSelf begin
float_msg(self_obj, mstr(160), FLOAT_MSG_RED);
critter_damage(self_obj, 10000);
end
procedure Node998 begin
set_local_var(LVAR_Hostile,2);
end
procedure Node999 begin
end
The script compiled properly. I added "ecjeff.int" to scripts.lst and scrname.msg. I went into the fallout mapper and tried giving a critter the ecjeff script, but all it produces is 'error' when you look at him, talk to him, or use fruit on him. I can't figure out why this doesn't work. I've managed to get simple floater scripts to work before and I don't think I'm doing anything differently here. I have the restoration patch installed, but I don't see why that would affect it at all. I'm about ready to give up and just give him the games as they are, but this is too unique an opportunity for a joke to pass up.
1. Produce some floater messages in sequential order (like Melchoir's kid in Redding)
2. If you use fruit on the character, he immediately dies (Jeff hates fruit).
I copied and pasted stuff from other scripts and got this:
#include "C:\Program Files\Black Isle\Fallout 2 Mapper\scripts\HEADERS\define.h"
//#include "..\headers\<TownName>"
#define NAME SCRIPT_ECJEFF
#define TOWN_REP_VAR (GVAR_TOWN_REP_KLAMATH)
#include "C:\Program Files\Black Isle\Fallout 2 Mapper\scripts\HEADERS\command.h"
#include "C:\Program Files\Black Isle\Fallout 2 Mapper\scripts\HEADERS\kladwtn.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 damage_p_proc;
procedure map_enter_p_proc;
procedure use_obj_on_p_proc;
procedure Node001;
procedure killSelf;
#define LVAR_Message (0)
#define LVAR_Hostile (4)
#define LVAR_Personal_Enemy (5)
variable Only_Once:=0;
procedure start begin
end
procedure map_enter_p_proc begin
Only_Once:=0;
critter_add_trait(self_obj,TRAIT_OBJECT,OBJECT_TEAM_NUM,TEAM_KLAMATH);
critter_add_trait(self_obj,TRAIT_OBJECT,OBJECT_AI_PACKET,AI_BERSERKER);
end
procedure critter_p_proc begin
if (((local_var(LVAR_Hostile) == 2)or(local_var(LVAR_Personal_Enemy) == 1)) and (obj_can_see_obj(self_obj,dude_obj))) then begin
set_local_var(LVAR_Hostile,1);
self_attack_dude;
end
end
procedure damage_p_proc begin
if (source_obj == dude_obj) then begin
set_local_var(LVAR_Personal_Enemy,1);
//CHANGE -nbk
set_global_var(GVAR_ENEMY_KLAMATH,1);
end
end
procedure pickup_p_proc begin
if (source_obj == dude_obj) then begin
set_local_var(LVAR_Hostile,2);
end
end
procedure talk_p_proc begin
call Node001;
end
procedure destroy_p_proc begin
inc_good_critter
end
procedure look_at_p_proc begin
script_overrides;
display_mstr(100);
end
procedure description_p_proc begin
script_overrides;
display_mstr(150);
end
procedure use_obj_on_p_proc begin
if ((source_obj == dude_obj) and (obj_pid(obj_being_used_with) == PID_MUTATED_FRUIT)) then begin
call killSelf;
end
end
procedure Node001 begin
floater(200 + local_var(LVAR_Message));
if (local_var(LVAR_Message) < 27) then begin
inc_local_var(LVAR_Message);
end
end
procedure killSelf begin
float_msg(self_obj, mstr(160), FLOAT_MSG_RED);
critter_damage(self_obj, 10000);
end
procedure Node998 begin
set_local_var(LVAR_Hostile,2);
end
procedure Node999 begin
end
The script compiled properly. I added "ecjeff.int" to scripts.lst and scrname.msg. I went into the fallout mapper and tried giving a critter the ecjeff script, but all it produces is 'error' when you look at him, talk to him, or use fruit on him. I can't figure out why this doesn't work. I've managed to get simple floater scripts to work before and I don't think I'm doing anything differently here. I have the restoration patch installed, but I don't see why that would affect it at all. I'm about ready to give up and just give him the games as they are, but this is too unique an opportunity for a joke to pass up.