Page 1 of 2

Throwing Knifes

Posted: Tue Jan 25, 2011 3:56 am
by Master Jay
Hey, is there any possbile way I can make knfies thow? Just like that game CS:S? So when they right click, the knife would throw.

Re: Throwing Knfies

Posted: Tue Jan 25, 2011 5:07 am
by motoko
An SSM way of doing this would have you addTemplate a bullet to the knife, but CSM, I have no clue.... You could play around with it, and if you can, create a new bullet and maybe set an animation to it.

Posted: Tue Jan 25, 2011 8:26 pm
by freddy
isnt there throwing knifes in the secret weapons expansion?

Re: Throwing Knfies

Posted: Tue Jan 25, 2011 8:30 pm
by Master Jay
not sure

Re: Throwing Knfies

Posted: Tue Jan 25, 2011 9:15 pm
by motoko
I think there is, the Commando, I believe. Try checking through the files to see. Don't have BF1942 installed as of the moment.

Re: Throwing Knfies

Posted: Tue Jan 25, 2011 10:04 pm
by fo0k
throwing knives are basically the non driving essence of the interstate mod! :)

Both teams have them as default kit.. maybe best way is to grab the mod and have a play/look through the code.. www.is82.com

Re: Throwing Knfies

Posted: Wed Jan 26, 2011 12:04 am
by Swaffy
The projectile Geometry would be a knife. Then you'd add the spinning effect used on the grenade [ObjectTemplate.rotationalSpeed 2/0/0]. After that, you would add bullet drop to the Projectile Template [ObjectTemplate.gravityModifier 1.0].

For the rest of the junk, just copy over the throwing Knife from Secret Weapons of WWII. It's very easy to do. You would need:

Animations from Snimations.rfa plus the Animation speed scripting
Sounds from Sounds.rfa
Textures from Textures.rfa
Meshes from StandardMesh.rfa
Images from Menu.rfa
And the scripting in Objects.rfa

Re: Throwing Knifes

Posted: Fri Jan 28, 2011 1:56 am
by Master Jay
So did I do this right?

Code: Select all

ObjectTemplate.create HandFireArms KnifeAxis
ObjectTemplate.itemIndex 1
ObjectTemplate.projectileTemplate KnifeProjectile
ObjectTemplate.projectilePosition 0/0/0
ObjectTemplate.magSize -1
ObjectTemplate.numOfMag 4
ObjectTemplate.magType 0
ObjectTemplate.reloadtime 1
ObjectTemplate.fireOnce c_True
ObjectTemplate.roundOfFire 2
ObjectTemplate.GUIIndex 83
ObjectTemplate.setHudAmmoType ATNone
ObjectTemplate.setCrossHairType CHTIcon
ObjectTemplate.fireInCameraDof 1
ObjectTemplate.loadSoundScript Sounds/knife.ssc
ObjectTemplate.soldierCameraPosition 0/-0.03/0.1
ObjectTemplate.aiTemplate KnifeAxis

ObjectTemplate.velocity 50

ObjectTemplate.createSkeleton animations/KnifeAxis.ske
ObjectTemplate.useSkeletonPartAsMain Base
ObjectTemplate.addTemplate KnifeAxisLod

rem *** Objects ***
ObjectTemplate.create SimpleObject KnifeAxisSimple
ObjectTemplate.geometry Shad_KnifeAxis

ObjectTemplate.create AnimatedBundle KnifeAxisComplex
ObjectTemplate.geometry KnifeAxis
ObjectTemplate.hasDynamicShadow 1
ObjectTemplate.createSkeleton animations/KnifeAxis.ske

ObjectTemplate.create LodObject KnifeAxisLod
ObjectTemplate.lodselector HandWeaponLodSelector
ObjectTemplate.addTemplate KnifeAxisComplex
ObjectTemplate.addTemplate KnifeAxisSimple

rem*** Modded knfie ***
ObjectTemplate.rotationalSpeed 2/0/0
ObjectTemplate.gravityModifier 1.0

Re: Throwing Knifes

Posted: Sun Oct 16, 2011 6:34 pm
by Psycho
Hello. I just added the throwingknife from Xpack2, and it works brilliant:).
I have done it so the throwingknife replaces the ordinary knife. And its not a mod I'm doing. only a map. So its mapside.

But, I can't figure out how to get the soldiers animation to match the throwingknife.

I have all the animation files in place and so on, but how to link it together?
I understand that it is the soldier object I have to modify. But how.... hmmm.

Re: Throwing Knifes

Posted: Mon Oct 17, 2011 4:02 pm
by Swaffy
Look in the "AnimationStatesShoot.con" file. You should look in there for any hooblah relating to the throwing knives.

For soldier anims, there might be something in the "AnimationStatesUpper.con" file.

- - - - - - - - - - - - - - - - - - - - - - - - - - - -
Master Jay wrote:So did I do this right?

Code: Select all

ObjectTemplate.create HandFireArms KnifeAxis
ObjectTemplate.itemIndex 1
ObjectTemplate.projectileTemplate KnifeProjectile
ObjectTemplate.projectilePosition 0/0/0
ObjectTemplate.magSize -1
ObjectTemplate.numOfMag 4
ObjectTemplate.magType 0
ObjectTemplate.reloadtime 1
ObjectTemplate.fireOnce c_True
ObjectTemplate.roundOfFire 2
ObjectTemplate.GUIIndex 83
ObjectTemplate.setHudAmmoType ATNone
ObjectTemplate.setCrossHairType CHTIcon
ObjectTemplate.fireInCameraDof 1
ObjectTemplate.loadSoundScript Sounds/knife.ssc
ObjectTemplate.soldierCameraPosition 0/-0.03/0.1
ObjectTemplate.aiTemplate KnifeAxis

ObjectTemplate.velocity 50

ObjectTemplate.createSkeleton animations/KnifeAxis.ske
ObjectTemplate.useSkeletonPartAsMain Base
ObjectTemplate.addTemplate KnifeAxisLod

rem *** Objects ***
ObjectTemplate.create SimpleObject KnifeAxisSimple
ObjectTemplate.geometry Shad_KnifeAxis

ObjectTemplate.create AnimatedBundle KnifeAxisComplex
ObjectTemplate.geometry KnifeAxis
ObjectTemplate.hasDynamicShadow 1
ObjectTemplate.createSkeleton animations/KnifeAxis.ske

ObjectTemplate.create LodObject KnifeAxisLod
ObjectTemplate.lodselector HandWeaponLodSelector
ObjectTemplate.addTemplate KnifeAxisComplex
ObjectTemplate.addTemplate KnifeAxisSimple

rem*** Modded knfie ***
ObjectTemplate.rotationalSpeed 2/0/0
ObjectTemplate.gravityModifier 1.0
No. If you read my post correctly, you'd know to put the gravityModifier in the projectile template [the thing that says "create Projectile ProjectileName"]. The rotationSpeed goes under the "create HandFireArms KnifeAxis" section. For simplicity's sake, just copy the throwing knife projectile template.

A project like this isn't very easy, and is a moderate level mod.