xisailuo261
First time out of the vault
I give npc some weapon ,butI I can not use ANIM_take_out & ANIM_fire_single ,it seems no effect.Can you teach me how to use it or give me some examples?
reg_anim_clear(self_obj);
reg_anim_begin();
reg_anim_animate(g1,ANIM_fire_continuous ,-1);
reg_anim_end();
I load the map ,but it does not run.In this mapper I cannot fight ,such as bi attacked by the evil plant in ARROY, are there some bugs in this mapper? how can I run itit's the script that does all the stuff in the in game sequence where you meet Frank Horrigan and the farmers in the desert for the first time...
Copyright 1998-2003 Interplay Entertainment Corp. All rights reserved.
*/
/*
Name: BodyGuard Vignette In Desert
Location: Gammovie
Description: He kicks ass
Log:
Please note any changes that have been made to the file in Updated. Then comment
the code which you have changed/altered/commented out. Please, do not delete any
code which was written.
Created:
Updated:
*/
/* Include Files */
/* Note, the Following Lines need to be in this order so that
the script will be compilable. The define Name is referenced
in a module from define.h and used in command.h. Please do
not change the ordering.
-rwh2 11/13/97
*/
//Overrides the pickup p proc.
#define NPC_REACTION_TYPE REACTION_TC /* REACTION_TC REACTION_TG REACTION_C REACTION_G */
#define NPC_REACTION_VAR 7 /* same as thief variable */
#include "..\headers\define.h"
//#include "..\headers\<TownName.h>"
#define NAME SCRIPT_ECBDYGRD
//#define TOWN_REP_VAR (GVAR_TOWN_REP_)
#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 combat_p_proc;
procedure combat_is_starting_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 Node001;
procedure doSequence;
//~~~~~~~~~~~~~~~~ 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_Caught_Thief (7)
/* 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_) */
#define GUARD1TILE 20897
#define GUARD2TILE 21700
#define FARMERTILE 20706
#define WIFETILE 20707
#define CHILDTILE 20907
#define DUDE_WATCH_TILE 22307
#define BODYLEAVETILE 16885
#define GUARD1LEAVETILE 17088
#define GUARD2LEAVETILE 17485
#define CENTER_TILE 20702
/* Local variables which do not need to be saved between map changes. */
variable begin
Only_Once:=0;
guard1;
guard2;
farmer;
wife;
child;
lastDudePos;
lastDudeRot;
sequence;
animated;
end
#define TIMER_SEQUENCE 1
procedure timed_event_p_proc begin
if (fixed_param == TIMER_SEQUENCE) then begin
call doSequence;
end
end
procedure combat_p_proc begin
terminate_combat;
end
procedure combat_is_starting_p_proc begin
terminate_combat;
end
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
Only_Once:=0;
ON_RND_YOUNG_SEQ;
ON_RND_YOURG_SEQ_DONE;
if (not is_loading_game) then begin
display_mstr(109);
sequence := 1;
call doSequence;
end
guard1 := tile_contains_pid_obj(GUARD1TILE, 0, PID_ENCLAVE_GUARD_MALE);
guard2 := tile_contains_pid_obj(GUARD2TILE, 0, PID_ENCLAVE_GUARD_MALE);
farmer := tile_contains_pid_obj(FARMERTILE, 0, PID_MALE_FARMER);
wife := tile_contains_pid_obj(WIFETILE, 0, PID_FEMALE_FARMER);
child := tile_contains_pid_obj(CHILDTILE, 0, PID_CHINA_BOY);
debug_msg("guard1 " + guard1 + " guard2 " + guard2 + " farmer " + farmer + " wife " + wife + " child " + child);
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) != 0) and (obj_can_see_obj(self_obj,dude_obj))) then begin
set_local_var(LVAR_Hostile,1);
self_attack_dude;
//Macro made by Tom to keep the critter fleeing.
end
/* if (obj_on_screen(self_obj) and tile_distance_objs(self_obj, dude_obj) <= 8 and sequence == 0) then begin
sequence := 1;
call doSequence;
end*/
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 (obj_in_party(source_obj)) then begin
set_local_var(LVAR_Personal_Enemy,1);
end
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
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
/* inc_evil_critter */
/* inc_neutral_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_Herebefore) == 0) then
display_mstr(100);
else
display_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_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
// Not lines are allowed to be added below here
// The Following lines are from the Design Tool
//~~~~~~~~~~~~~~~~ DESIGN TOOL STARTS HERE
procedure Node001 begin
end
procedure doSequence begin
variable sound;
variable sound1;
variable sound2;
variable sound3;
if (sequence == 1) then begin
if (animated == 0) then begin
animated := 1;
game_ui_disable;
reg_anim_clear(dude_obj);
reg_anim_begin();
animate_move_obj_to_tile(dude_obj, DUDE_WATCH_TILE, ANIMATE_RUN);
reg_anim_end();
end else begin
if (not anim_busy(dude_obj)) then begin
sequence += 1;
end else begin
debug_msg("ECBDYGRD: tile_set_center(CENTER_TILE): " + tile_set_center(CENTER_TILE));
end
end
add_timer_event(self_obj, 2, TIMER_SEQUENCE);
end else if (sequence == 2) then begin
float_msg(self_obj, mstr(103), FLOAT_MSG_NORMAL);
sequence += 1;
add_timer_event(self_obj, game_ticks(3), TIMER_SEQUENCE);
end else if (sequence == 3) then begin
float_msg(farmer, mstr(104), FLOAT_MSG_GREEN);
sequence += 1;
add_timer_event(self_obj, game_ticks(3), TIMER_SEQUENCE);
end else if (sequence == 4) then begin
float_msg(self_obj, mstr(105), FLOAT_MSG_RED);
sequence += 1;
add_timer_event(self_obj, game_ticks(3), TIMER_SEQUENCE);
end else if (sequence == 5) then begin
float_msg(farmer, mstr(106), FLOAT_MSG_YELLOW);
sequence += 1;
add_timer_event(self_obj, game_ticks(3), TIMER_SEQUENCE);
end else if (sequence == 6) then begin
float_msg(self_obj, mstr(107), FLOAT_MSG_RED);
sequence += 1;
add_timer_event(self_obj, game_ticks(1), TIMER_SEQUENCE);
end else if (sequence == 7) then begin
sound := sfx_build_weapon_name(snd_weapon_attack, obj_carrying_pid_obj(guard1, PID_VINDICATOR_MINIGUN), hit_left_weapon_primary, self_obj);
reg_anim_clear(guard1);
reg_anim_begin();
reg_anim_animate(guard1, ANIM_fire_burst, -1);
reg_anim_play_sfx(guard1, sound, 0);
reg_anim_end();
reg_anim_clear(guard2);
reg_anim_begin();
reg_anim_animate(guard2, ANIM_fire_burst, -1);
reg_anim_play_sfx(guard2, sound, 0);
reg_anim_end();
sound1 := sfx_build_char_name(farmer, ANIM_chunks_of_flesh, snd_die);
sound2 := sfx_build_char_name(wife, ANIM_chunks_of_flesh, snd_die);
sound3 := sfx_build_char_name(child, ANIM_chunks_of_flesh, snd_die);
reg_anim_clear(farmer);
reg_anim_begin();
reg_anim_animate(farmer, ANIM_chunks_of_flesh, -1);
reg_anim_play_sfx(farmer, sound1, 0);
reg_anim_end();
reg_anim_clear(wife);
reg_anim_begin();
reg_anim_animate(wife, ANIM_chunks_of_flesh, -1);
reg_anim_play_sfx(wife, sound2, 0);
reg_anim_end();
reg_anim_clear(child);
reg_anim_begin();
reg_anim_animate(child, ANIM_chunks_of_flesh, -1);
reg_anim_play_sfx(child, sound3, 0);
reg_anim_end();
sequence += 1;
add_timer_event(self_obj, game_ticks(3), TIMER_SEQUENCE);
end else if (sequence == 8) then begin
kill_critter(farmer, ANIM_chunks_of_flesh_sf);
kill_critter(wife, ANIM_chunks_of_flesh_sf);
kill_critter(child, ANIM_chunks_of_flesh_sf);
reg_anim_clear(self_obj);
reg_anim_begin();
animate_rotation(rotation_to_tile(self_tile, dude_tile));
reg_anim_end();
float_msg(self_obj, mstr(108), FLOAT_MSG_NORMAL);
sequence += 1;
add_timer_event(self_obj, game_ticks(3), TIMER_SEQUENCE);
end else if (sequence == 9) then begin
reg_anim_clear(self_obj);
reg_anim_begin();
animate_move_obj_to_tile(self_obj, BODYLEAVETILE, ANIMATE_WALK);
reg_anim_end();
sequence += 1;
add_timer_event(self_obj, game_ticks(2), TIMER_SEQUENCE);
end else if (sequence == 10) then begin
reg_anim_clear(guard1);
reg_anim_begin();
animate_move_obj_to_tile(guard1, GUARD1LEAVETILE, ANIMATE_WALK);
reg_anim_end();
reg_anim_clear(guard2);
reg_anim_begin();
animate_move_obj_to_tile(guard2, GUARD2LEAVETILE, ANIMATE_WALK);
reg_anim_end();
sequence += 1;
add_timer_event(self_obj, game_ticks(4), TIMER_SEQUENCE);
end else if (sequence == 11) then begin
if (self_tile == BODYLEAVETILE and tile_num(guard1) == GUARD1LEAVETILE and tile_num(guard2) == GUARD2LEAVETILE) then begin
set_obj_visibility(self_obj, 1);
destroy_object(guard1);
destroy_object(guard2);
sequence += 1;
end
debug_msg("Sequence: " + sequence + " Next == 12");
add_timer_event(self_obj, game_ticks(1), TIMER_SEQUENCE);
end else if (sequence == 12) then begin
game_ui_enable;
destroy_object(self_obj);
end
end
//xxxxxxxxxxxxxxxxxxxx