rotators/Fo1in2

Punching bag animation issue

Closed this issue · 8 comments

ZSPNCHBG currently plays the hand animation (use object) and then the attack animation.

Tried overwriting the "use object" animaton via useanimobj hook script:

procedure useanimobj_handler begin
   variable
      critter := get_sfall_arg,
      target := get_sfall_arg,
      use_anim := get_sfall_arg;

   if (obj_pid(target) == PID_PUNCHING_BAG) then begin
      if (get_script(target) == SCRIPT_ZSPNCHBG) then begin
         set_sfall_return(-1);
      end
   end
end

This works, but only the first time unless the player moves move away after running the code. Standing on the same hex next to the object and "using" it again will now play no animation at all.

I also hit this in another form (trying to play magic hands when using dynamite on a door).

This works, but only the first time unless the player moves move away after running the code. Standing on the same hex next to the object and "using" it again will now play no animation at all.

According to my testing, the issue is actually the point blank range. If you walk right to the object and then do the thing for the first time, there's no animation.
Also, it seems that sometimes it does work - about 1 time out of 5. Can't find an explanation yet.

Yeh. For the punching bag issue I've decided to just force one of the unarmed attack animations instead of the magic hands, and then do the same again for actually using the object. This now results in the player attacking the object twice instead of just once. However, it still looks better than if he would "use" the object first.

About playing magic hands when using something - you could just add the animation into the object script. I'm doing that with a few objects in ettu (repairing power generators, etc).

About playing magic hands when using something - you could just add the animation into the object script. I'm doing that with a few objects in ettu (repairing power generators, etc).

I am doing it in object script (door). Or you mean the object in inventory? But the items with scripts don't stack, do they?

I mean the scenery object (door, etc).

Hm, could you link an example?
Maybe the difference is whether the inventory item has the "use" flag.

This is the Necropolis waterpump: https://github.com/rotators/Fo1in2/blob/master/Fallout2/Fallout1in2/Mapper/source/scripts/05necropolis/NH2OPUMP.ssl#L72

In vanilla Fo1 using the junk item on it will not play the magic hands animation.

Btw. I think Sfall Extended by Stalin has some hardcoded change here and will always run the magic hands animation when using objects on stuff (personally I don't like it).

Thanks. My code is pretty much the same. I think it'll have to be solved in sfall at some point.

I got used to the current approach and would consider this solved for now.