Throwing Knifes

Ask questions, discuss ideas, get answers
Master Jay
Posts: 139
Joined: Mon Mar 29, 2010 10:28 pm

Throwing Knifes

Post 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.
Image
Im Watching You... When You Sleep!
motoko
Posts: 217
Joined: Sun Nov 21, 2010 8:43 pm
Location: Dante's 6th Pit of Hell

Re: Throwing Knfies

Post 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.
freddy
Posts: 1267
Joined: Sun Oct 18, 2009 4:58 pm

Post by freddy »

isnt there throwing knifes in the secret weapons expansion?
Master Jay
Posts: 139
Joined: Mon Mar 29, 2010 10:28 pm

Re: Throwing Knfies

Post by Master Jay »

not sure
Image
Im Watching You... When You Sleep!
motoko
Posts: 217
Joined: Sun Nov 21, 2010 8:43 pm
Location: Dante's 6th Pit of Hell

Re: Throwing Knfies

Post 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.
User avatar
fo0k
Posts: 1434
Joined: Fri Oct 16, 2009 4:21 pm
Location: UK

Re: Throwing Knfies

Post 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
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: Throwing Knfies

Post 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
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
Master Jay
Posts: 139
Joined: Mon Mar 29, 2010 10:28 pm

Re: Throwing Knifes

Post 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
Image
Im Watching You... When You Sleep!
User avatar
Psycho
Posts: 125
Joined: Thu Aug 25, 2011 3:31 am

Re: Throwing Knifes

Post 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.
I want to live in a created universe. Virtual reality, here I come.
User avatar
Swaffy
Posts: 1715
Joined: Sun Aug 29, 2010 9:25 pm
Location: Cibolo, Texas

Re: Throwing Knifes

Post 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.
(Forum Thread|Download) Swaffy'sMod v0.34 | Download link to come Soon™
Post Reply