Making a weapon in KF

  • Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

crono

FNG / Fresh Meat
Oct 3, 2009
54
2
0
Oslo, Norway
Hi, as most of you probably are aware of, Meow and I are working on making 3 guns for KF.

However there have been some ditches in the road, and I hope we help others get past these easier, but right now I have a question I hope someone can answer.

The third person weapon animations, such as the characters pose when holding the Bullpup is all saved in KF_Soldier_Trip -> Soldier_Animations_Trip with their respective stances, such as Idle, WalkL, WalkR.

I see that TWI appended new weapon animations to this when patching KF and adding new weapons, but we modders obviously shouldn't be doing that.
I'm going to try and add custom 3rd person animations today, and I'll report difficulties, but if anyone has the answer to this I'd appreciate it. (The question being, how to do this - can it be done?)


I'll sum up other challenges with their short answers for now, and include a few URLs with exported/converted KF material. If TWI or the mods would rather I do not do that, then let me know.

1) Testing weapons in ListenServer mode. This makes me slightly fail every time, I hope i'll get better at it with time, but make sure your weapon states and mechanics work in MP before going too far with it.. this really is a coder matter, so i'll leave it at that

2) Sleeves & models. There is a SleeveNum variable in all KF weapons, this determines which material slot the soldiers various sleeves will be appended to. In most cases this is also defaulted in the skeletalmesh properties, or the gun properties, so make sure those are off before you test whether sleeves work appropiately, otherwise it might be set statically. As with all arrays it starts at indice 0, even though all stock KF weapons have put it at material 1-3, it can be 0.

3) PickupItem model, there seems to be some kind of magic going on here too, the weapons are supposed to fade red/green while they are on the ground so they are easily spotted. By just copying a stock weapons settings, your weapon will get the default mesh material when its dropped - the gray blob thing, I fixed this not by setting the material in staticmesh or the pickupitem's skin, but by adding this:
Code:
simulated function RenderPickupImage(Canvas C)
{
  C.SetPos((C.SizeX - C.SizeY) / 2,0);
  //C.DrawTile( Texture'KillingfloorHUD.ClassMenu.L85', C.SizeY, C.SizeY, 0.0, 0.0, 256, 256);
  C.DrawTile( Combiner'GodsTexture.Weapons.minigun_cmb', C.SizeY, C.SizeY, 0.0, 0.0, 256, 256);
  texture = Combiner'GodsTexture.Weapons.minigun_cmb';
}
I'm guessing its the texture setting that helps, but adding it to defaults didn't so i'm not sure why it works yet, but glad that it does ;)

And finally, the reason most of you made it through this FAQ rant; the files:

http://apollo.wsh.no/~crono/Soldier_Animations_Trip.psa - Third person weapon animations
http://apollo.wsh.no/~crono/Soldier_Animations_Trip.qc - Index of these scenes as they are all in one file, basically start/end time and its name
http://apollo.wsh.no/~crono/char_anim.zip - The animationset (without soldier mesh) exported into .fbx so it can be opened in 3ds max and perhaps others - maya?
http://apollo.wsh.no/~crono/british_soldier.fbx - The default british soldier, remember the soldier is not to be packed with your new 3rd person animation, as they can vary depending on the player selection

http://apollo.wsh.no/~crono/KF_Weapons_Trip/ - Stock weaps
http://apollo.wsh.no/~crono/KF_Weapons2_Trip/ - new KF weaps
http://apollo.wsh.no/~crono/KF_Weapons3rd_Trip/ - stock 3rd
http://apollo.wsh.no/~crono/KF_Weapons3rd2_Trip/ - new 3rd

All these are in their .psa/.psk form, the outer folder will also have the weapons i've converted to fbx myself, where both skel and anim are in one.
 
Last edited:

crono

FNG / Fresh Meat
Oct 3, 2009
54
2
0
Oslo, Norway
Anyway, it turns out John is also working on this so hopefully there will be a breakthrough in adding/changing characters + animations sets soon ;)

Heres a failed animation import that looks weird
(EDIT: this is just for teh lulz, and not part of the problem described above)

CharFail.png
 
Last edited:

Yomommassis

FNG / Fresh Meat
Sep 24, 2009
705
233
0
Palmdale, CA USA
lol wtf
idk what you did to do that lol
the problem isnt making a custom pack the problem is getting the character to actually use that pack in game

my guess is you loaded an animation that doesnt use the same bones?

in killing floor the forward walking animation is actually walking backwards, i fixed it awhile ago but had no way to get it in game
Untitled-5.png
 

crono

FNG / Fresh Meat
Oct 3, 2009
54
2
0
Oslo, Norway
Yes, well that picture was rather unrelated however it seems to me that theres an easy and mutator-unfriendly way of doing this, lets call it the TWI way; Adding new animations to the existing set, the mutator will then be 50MB+ and may require players to download it over the web instead of through the game caching system... it will obviously work but its not a simple mutator then, but more like an unofficial patch or a Mod (like full mod)

The second way would be to override some function so that a weapon can have an animation outside of the initial set.. this might be "impossible" without majorly altering how the UT engine works as the animations are played near the bottom of the objective ladder, at xPawn or Pawn (afaik)

I don't like these options.. and we might just continue without a 3rd person animation for now