Shooting animation

gangrel

First time out of the vault
I trying make (in script) that dude_obj will shoot to someone. I testing this with Reg_Anim_Func and but I don't know action_id of shooting in player character. Anyone know this ID number? Or other way to make this?
 
dude_obj is the player character. Shouldn't the player character determine who/when/if he is going to shoot? Or do you mean having critters shooting? If so, you can make a critter wield a weapon like this, then use the attack or attack_complex script functions. I don't think you need to choose an animation. If the critter is wielding a gun, it will automatically play the right animation (assuming that the critter can use that gun ie the sprite exists for it).
 
Hm... I wrote following code:
Code:
wield_obj_critter(dude_obj,PID_DESERT_EAGLE);
attack_setup(Dude_obj,Self_obj);
And when I put F8 in mapper then it crashes. What I do wrong?
 
If you search the script source code, which is in the \mapper\scripts directory, and look for the text attack_setup, you see things like this:

attack_setup( scorpion_obj, dude_obj );

The docs for the mapper say: the first parameter is who is attacking and the second parameter is the victim. Your code says dude_obj is attacking self_obj. That doesn't really make sense. What are you trying to do, make a critter attack the player? There is also just attack(who), so a critter can just attack(dude_obj).
 
I wont make something like end of the game of Fallout 1 with Bloody Mess perk. That's mean player will kill someone. And when I do this by attack fuction it will can miss or don't kill (just take xx demage). This also waste action points.
 
have a look at the ecbdygrd script in the RNDENCTR folder.. it's the scripted sequence where horrigan attacks the farmer and family.. it has all the stuff you want in there..
 
I'm doing the same thing to test the animations in the critter packs. I discovered that if you simply use the wield_obj or wield_obj critter and try to run the fire animations, the game crashes. However, if you do the following it works:

variable item;
item:=obj_carrying_pid_obj(self_obj,PID_VINDICATOR_MINIGUN);
wield_obj(item);

sound := sfx_build_weapon_name(snd_weapon_attack, item, hit_left_weapon_primary, self_obj);
reg_anim_clear(self_obj);
reg_anim_begin();
reg_anim_animate(self_obj, ANIM_fire_burst, -1);
reg_anim_play_sfx(self_obj, sound, 0);
reg_anim_end();

The obj_carrying_pid_obj returns a pointer to an instance of the minigun. If you only do wield_obj you don't have the pointer and the game crashes when it runs the animation. However, if you edit the critter's instance (in the mapper), do an add to inventory, and place the minigun in a weapon slot, then it works without needing the obj_carrying_pid_obj and wield (since critter already has gun in hand). They did it the latter way in the cut scene (ecbdygrd.ssl). In my testing I want to be able to wield and unwield dynamically though, to test the melee and ranged weapons, and the above code seems to work. BTW the sfx_build_weapon_name command is not in the mapper documentation, I guess they forgot to add that one.

Note however that dude_obj is a special case, it behaves differently than all the others. Not sure why you want to use dude_obj but your results may be different with that object. I created an instance of a male hero (dude_obj clone) and that seems to work. You want to make dude_obj fire this animation without the player controlling it? Are you making a cut scene or what?

I have a script that cycles through all of the animations (you can find a list of all of the animations in the mapper's \scripts\headers\animcomd.h). In my script, each time you click on (default action talk to) a critter, it plays the next animation in sequence. I will post the script source code later, still working on the other animations. I have the burst fire working.

I noticed that there are some jump suit animations that work with the FO1 FRMs but not FO2.
These are stair climbing animations:

ANIM_up_stairs_right
ANIM_up_stairs_left
ANIM_down_stairs_right
ANIM_down_stairs_left

If I copy the FO1 hmjmps/hfjmps FRMs to my patch, these stair animations work
(but I'm assuming the game engine doesn't use them in its movement routines).

The following animations don't seem to work with the hero characters:

ANIM_jump_begin
ANIM_jump_end
ANIM_falling
ANIM_magic_hands_up
ANIM_bad_landing
ANIM_bad_landing_sf

I also noticed that the female hero (hfjmps) doesn't have some of the animations that the male (hmjps) has.
I haven't figured out which types are missing but I have an FRM file comparison in this spreadsheet.


EDIT: The above code worked for a single weapon type, but when I tried to switch between various weapons, I got errors unless I manually added the weapons to the critter instance using the Edit "Add to Inventory" function. The code below works for any weapon without requiring manual inventory editing:

variable item;
item:=create_object(PID_VINDICATOR_MINIGUN,0,0);
add_mult_objs_to_inven(dude_obj,item,1);
wield_obj(item);

sound := sfx_build_weapon_name(snd_weapon_attack, item, hit_left_weapon_primary, self_obj);
reg_anim_begin();
reg_anim_animate(self_obj,ANIM_fire_burst,-1);
reg_anim_play_sfx(self_obj, sound, 0);
reg_anim_end();
 
Here's a script that cycles through all of the animations:

ANIMTEST.SSL
ANIMTEST.int
ANIMTEST.MSG

Create an instance of the male hero in the mapper, attach this script, and press F8.
Click on the hero to play an animation. Click on him again to play the next one.
All of these work with the hero model. Some won't work with other critters.
 
This spreadsheet (list of hero appearance FRM files) has been updated to map the file names to all of the script animation function calls (ANIM_fire_single etc). You can see that the female hero uses the male FRM for some of the death types like flaming and burning. It also shows how the stair movement FRMs are only in Fallout 1.
 
Back
Top