Author Topic: Realistic gun movement  (Read 3911 times)

Offline Guderian

  • Developer
  • ******
  • Posts: 135
  • Level Designer
    • View Profile
Re: Realistic gun movement
« Reply #15 on: 29-03-2011, 05:03:28 »
It was not intended or directed at you Devilman. It's just my general feeling I get when people attempt to shoot holes in others work. I think your willingness to experiment is greatly appreciated by me.
« Last Edit: 29-03-2011, 05:03:18 by Guderian »

Offline Devilman

  • I belong to Naughty Club
  • **
  • Posts: 274
    • View Profile
Re: Realistic gun movement
« Reply #16 on: 29-03-2011, 05:03:42 »
BF2142 has this code in several handweapons

Quote
rem ---BeginComp:DefaultGunSwayComp ---
ObjectTemplate.createComponent DefaultGunSwayComp
ObjectTemplate.sway.gunSwayUseZoom 1
ObjectTemplate.sway.gunSwayPitchSteps 40
ObjectTemplate.sway.gunSwayPitchFactor 3
ObjectTemplate.sway.gunSwayPitchMax 7
ObjectTemplate.sway.gunSwayPitchUpdateRate 0
ObjectTemplate.sway.gunSwayPitchSmoothFactor 0.005
ObjectTemplate.sway.gunSwayPitchSmoothMax .5
ObjectTemplate.sway.gunSwayPitchSmoothThreshold 2.4
ObjectTemplate.sway.stabilityRecoverTime 1
ObjectTemplate.sway.stabilityTime 1
ObjectTemplate.sway.stabilityDuration 1.4
ObjectTemplate.sway.stabilityDurationRecoverTime 4
rem ---EndComp ---

the code may also somehow be linked to some sort of animation,not sure
it definately works in BF2142 regarding the projectile moving in sync with the weapon,and with an unlock allows the shift key to stabilize it for a short period of time
unfortunately this code doesnt work in BF2

Offline Archimonday

  • Full Member
  • ***
  • Posts: 1.197
  • Sir vis pacem, para bellum!
    • View Profile
Re: Realistic gun movement
« Reply #17 on: 29-03-2011, 05:03:54 »
hehe nvm, didn't read enough xD

Offline Devilman

  • I belong to Naughty Club
  • **
  • Posts: 274
    • View Profile
Re: Realistic gun movement
« Reply #18 on: 29-03-2011, 05:03:18 »
It was not intended or directed at you Devilman. It's just my general feeling I get when people attempt to shoot holes in others work. I think you're willingness to experiment is greatly appreciated by me.

HA HA,I know who it was directed at  ;)
I just posted that so,that LHeureux wouldnt feel like such a loser

Offline Guderian

  • Developer
  • ******
  • Posts: 135
  • Level Designer
    • View Profile
Re: Realistic gun movement
« Reply #19 on: 29-03-2011, 05:03:24 »
I attempt to be positive and support anyone willing to contribute to the mod. It's in my best interest to encourage guys like you and Archi (<--lazy :D)

@Archi
Where's that video you showed me months ago from a mod that had surf/waves?
« Last Edit: 29-03-2011, 05:03:19 by Guderian »

Offline Archimonday

  • Full Member
  • ***
  • Posts: 1.197
  • Sir vis pacem, para bellum!
    • View Profile
Re: Realistic gun movement
« Reply #20 on: 29-03-2011, 05:03:44 »
I attempt to be positive and support anyone willing to contribute to the mod. It's in my best interest to encourage guys like you and Archi (<--lazy :D)

@Archi
Where's that video you showed me months ago from a mod that had surf/waves?

I forgot who did that.

Offline Devilman

  • I belong to Naughty Club
  • **
  • Posts: 274
    • View Profile
Re: Realistic gun movement
« Reply #21 on: 29-03-2011, 05:03:00 »
I think your willingness to experiment is greatly appreciated by me.

Thankyou,you just earnt my respect  ;)

Offline LHeureux

  • Full Member
  • ***
  • Posts: 1.350
    • View Profile
Re: Realistic gun movement
« Reply #22 on: 29-03-2011, 07:03:55 »
but again it's random, you can't make it to go out by the barrel direction everytime.

Wrong again  ::) ::) ::)



Sorry. How am I wrong?  :-\

SO basically if the barrel is pointed in "x" direction, it will not care and fire where the crosshair is, right?
« Last Edit: 29-03-2011, 07:03:52 by LHeureux »
Hey, huge ass .gif signatures are totally unnecessary and obnoxious. Not these anymore, thankyouverymany kkbyethx love you, all the homo. -Flippy

Offline Archimonday

  • Full Member
  • ***
  • Posts: 1.197
  • Sir vis pacem, para bellum!
    • View Profile
Re: Realistic gun movement
« Reply #23 on: 29-03-2011, 07:03:52 »
Got a video proving that this doesn't work with hand weapons. It'll be up in a few.

Offline LHeureux

  • Full Member
  • ***
  • Posts: 1.350
    • View Profile
Re: Realistic gun movement
« Reply #24 on: 29-03-2011, 07:03:15 »
Not to be a douche, but I find it so annoying when people post as if they "know" what is possible in regard to coding. Sometimes you just just need to eat humble pie and acknowledge others abilities.

Ho sorry. That's just that everytime I made a suggestion on any BF2 mod or saw any other one concerning "sway" they all got destroyed by Devs then the topic got locked  ::)

And the reason they always give is what I said.

Exemple : http://www.realitymod.com/forum/f10-pr-bf2-general-discussion/86279-saw-recoil.html
« Last Edit: 29-03-2011, 07:03:25 by LHeureux »
Hey, huge ass .gif signatures are totally unnecessary and obnoxious. Not these anymore, thankyouverymany kkbyethx love you, all the homo. -Flippy

Offline Archimonday

  • Full Member
  • ***
  • Posts: 1.197
  • Sir vis pacem, para bellum!
    • View Profile
Re: Realistic gun movement
« Reply #25 on: 29-03-2011, 07:03:09 »
Ok here we go.

Experiment:

Test if weapon animations using CameraFireInDof 0 will effect where the shot goes.

Test Weapon:

MP40

Details:

MP40 Zoom Fire animation was removed, to avoid that snap from influencing the guns position while firing. Zoom Stand animation was changed to an over exaggerated sway animation, that should have been pretty noticeable.

CameraFireinDOF was set to 0 inside Mp40.tweak




Tested in-game this is what I got:

http://www.youtube.com/watch?v=6koQE0FHZWE


From the result I can say that FireInDof 0 does nothing on hand weapons, unless there is some other line of code that must be input to the weapon for it to work properly. The bullet was never going where I was aiming, so I'm closin the book on that one.

Offline Devilman

  • I belong to Naughty Club
  • **
  • Posts: 274
    • View Profile
Re: Realistic gun movement
« Reply #26 on: 29-03-2011, 07:03:46 »
The bullet was never going where I was aiming,

Did you change/lower your weapons, zoom deviation/deviation code as well ?

Offline Archimonday

  • Full Member
  • ***
  • Posts: 1.197
  • Sir vis pacem, para bellum!
    • View Profile
Re: Realistic gun movement
« Reply #27 on: 29-03-2011, 08:03:48 »
The bullet was never going where I was aiming,

Did you change/lower your weapons, zoom deviation/deviation code as well ?

I went and retried it later with no deviation or recoil, same result, even more noticeable.

Offline Devilman

  • I belong to Naughty Club
  • **
  • Posts: 274
    • View Profile
Re: Realistic gun movement
« Reply #28 on: 29-03-2011, 08:03:35 »
The bullet was never going where I was aiming,

Did you change/lower your weapons, zoom deviation/deviation code as well ?

I went and retried it later with no deviation or recoil, same result, even more noticeable.

correct me if i am wrong,as i know very little about animations
but shouldnt you of altered the Zoom Fire animation

Offline Archimonday

  • Full Member
  • ***
  • Posts: 1.197
  • Sir vis pacem, para bellum!
    • View Profile
Re: Realistic gun movement
« Reply #29 on: 29-03-2011, 08:03:50 »
The bullet was never going where I was aiming,

Did you change/lower your weapons, zoom deviation/deviation code as well ?

I went and retried it later with no deviation or recoil, same result, even more noticeable.

correct me if i am wrong,as i know very little about animations
but shouldnt you of altered the Zoom Fire animation

Well see this is the idea though. We are testing whether bullets can come out of the center of the gun by turning the camera dof off. Now if I was to have a fire animation, it plays back abruptly interrupting the zoom_stand animation, which means on trigger pull you would be instantly changing the position of the gun from its sway position. So I removed it instead, to keep the sway position, instead of having it snap back n forth on trigger pull.

That ensures that we can see exactly where the shell is going when the gun is fired.