how to anime a NPC taking a item on the floor?

brother_soifran

Look, Ma! Two Heads!
Gronichonha .
I'm actually trying to make in sort that a NPC make a succession of animation and finish by taking an item on the floor...
I manage (inspiring darek and jordan bed script) to make move and animate where I want my critters, but I've nop idea to the way to put an item on a specific hexe to critter inventory or delete it of the map...

Any Idea?
here is my script (some part)

....
procedure map_enter_p_proc;
procedure map_update_p_proc;
procedure talk_p_proc;
procedure cueillette;
....
....
procedure critter_p_proc
begin
If (local_var(LVAR_salade)==2) then
animate_move_obj_to_tile(Self_obj,17496,0);
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
if (local_var(LVAR_salade)==3) then call cueillette;
end
...
...
...
//HEROS SUPER CHARISMATIQUE

procedure node022
begin
set_local_var(LVAR_salade,3);
set_global_var(GVAR_FIND_3_SALADES,2);
give_exp_points(100);
gSay_Message(1304,145,49);
end
...
...
procedure cueillette
begin
script_overrides;

/* if not (game_ui_is_disabled) then
game_ui_disable; */

reg_anim_clear(self_obj);
reg_anim_begin();
reg_anim_obj_move_to_tile(Self_obj,20287,0); //etait 17470
reg_anim_animate(Self_obj,ANIM_magic_hands_ground,-1);
reg_anim_end();
end

So all work after the node, the critter move etc,etc,etc, but
I don't understand how to delete or move a speficicly localised item from the map to the critter_inventory.
I've tried to destroy_obj, or move_obj_to another tiles out of range of the dude vision...but the game seems crash..
Any Idea?
Thanks.

Brother_Soifran
 
Back
Top