To Dude_Object: Thanks for the Home Tile bit.
My critters are still placed manually, but I am going to try the create_oject_sid command in a later stage. I hope Jargo is right, but here is one of my scripts: not a fine one but it works.
/* Include Files */
#include "..\headers\define.h"
#include "..\headers\florence.h"
#define NAME SCRIPT_FCTOWNA
#define TOWN_REP_VAR (GVAR_TOWN_REP_FLORENCE)
#include "..\headers\command.h"
#include "..\headers\ModReact.h"
/* Standard Script Procedures */
procedure start;
procedure timed_event_p_proc;
procedure pickup_p_proc;
procedure destroy_p_proc;
procedure push_p_proc;
procedure use_p_proc;
procedure look_at_p_proc;
procedure description_p_proc;
procedure use_skill_on_p_proc;
procedure use_obj_on_p_proc;
procedure damage_p_proc;
procedure map_enter_p_proc;
procedure map_update_p_proc;
procedure talk_p_proc;
/* Script Specific Procedure Calls */
procedure Node998; // This Node is Always Combat
procedure Node999; // This Node is Always Ending
procedure Node001;
procedure Node002;
#define LVAR_Herebefore (4)
#define LVAR_Hostile (5)
#define LVAR_Personal_Enemy (6)
#define LVAR_State (7)
#define LVAR_HomeTile (8)
variable Only_Once:=0;
#define TIMER_MOVE 1
#define TIMER_FLOAT 2
procedure start begin
end
procedure timed_event_p_proc begin
if (((critter_state(self_obj) bwand DAM_KNOCKED_DOWN) == FALSE)
and (not(combat_is_initialized))) then begin
reg_anim_clear(self_obj);
reg_anim_begin();
animate_move_to_tile(tile_num_in_direction(tile_num(self_obj),random(0,5),3));
reg_anim_end();
end
add_timer_event(self_obj,game_ticks(random(5,7)),1);
/*variable tile;
variable hello;
if (fixed_param == TIMER_MOVE) then begin
if (self_visible) then begin
tile := tile_num_in_direction(local_var(LVAR_HomeTile), Random(0, 5), Random(5, 7));
if (not anim_busy(self_obj)) then begin
reg_anim_clear(self_obj);
reg_anim_begin();
animate_move_to_tile(tile);
reg_anim_end();
end
end else begin
tile := tile_num_in_direction(local_var(LVAR_HomeTile), Random(0, 5), Random(5, 7));
if (not anim_busy(self_obj)) then begin
reg_anim_clear(self_obj);
reg_anim_begin();
animate_move_to_tile(tile);
reg_anim_end();
end
end
add_timer_event(self_obj, ONE_GAME_SECOND * Random(5, 10), TIMER_MOVE);
end else if (fixed_param == TIMER_FLOAT) then begin*/
if (self_visible) then begin
call Node002 ;
end
end
/*add_timer_event(self_obj, ONE_GAME_SECOND * Random(5, 10), TIMER_FLOAT);
end
procedure use_p_proc begin
end
procedure look_at_p_proc begin
script_overrides;
if (local_var(LVAR_Herebefore) == 0) then
display_msg(mstr(100));
else
display_msg(mstr(101));
end
procedure description_p_proc begin
script_overrides;
display_msg(mstr(114));
end
procedure use_skill_on_p_proc begin
end
procedure use_obj_on_p_proc begin
end
procedure damage_p_proc begin
end
procedure map_enter_p_proc begin
Only_Once:=0;
critter_add_trait(self_obj,TRAIT_OBJECT,OBJECT_TEAM_NUM,TEAM_FLORENCE);
critter_add_trait(self_obj,TRAIT_OBJECT,OBJECT_AI_PACKET,AI_TOUGH_CITIZEN);
if (not is_loading_game) then begin
if (not local_var(LVAR_HomeTile)) then begin
set_local_var(LVAR_HomeTile, self_tile);
end
add_timer_event(self_obj, ONE_GAME_SECOND * Random(5, 10), TIMER_MOVE);
/*add_timer_event(self_obj, ONE_GAME_SECOND * Random(5, 10), TIMER_FLOAT);*/
end
end
procedure map_update_p_proc begin
end
procedure talk_p_proc begin
call Node001;
end
procedure push_p_proc begin
end
procedure destroy_p_proc begin
/* Increment the aligned critter counter*/
inc_good_critter
/* Set global_variable for Enemy status*/
end
procedure pickup_p_proc begin
if (source_obj == dude_obj) then begin
set_local_var(LVAR_Hostile,2);
end
end
procedure Node998 begin
set_local_var(LVAR_Hostile,2);
end
procedure Node999 begin
end
procedure Node001 begin
float_msg(self_obj, mstr(102 + Random(0, 4)), FLOAT_MSG_BLUE);
end
procedure Node002 begin
float_msg(self_obj, mstr(107 + Random(0, 6)), FLOAT_MSG_RED);
end
To Jargo: Thanks for the info, I hope this is the final solution for the problem.
Bye