Author Topic: Pistol brass on wrong side  (Read 1156 times)

0 Members and 1 Guest are viewing this topic.

calan

  • Newbie
  • *
  • Posts: 44
  • Karma: +0/-0
  • Doom Newbie
    • View Profile
Pistol brass on wrong side
« on: October 30, 2014, 02:49:47 AM »
Is there a mod floating around that swaps the pistol ejection port to the right (correct) side?

I'm using a compilation mod...so not sure if it's a mod issue or just coded that way in the game, but it's irritating as hell.
Old bastard but kid at heart...

BielBdeLuna

  • Full Member
  • ***
  • Posts: 242
  • Karma: +8/-20
  • Doom Newbie
    • View Profile
    • my Github repositories
Re: Pistol brass on wrong side
« Reply #1 on: October 30, 2014, 10:20:21 AM »
you should be able to script it or to code it without much hassle.

calan

  • Newbie
  • *
  • Posts: 44
  • Karma: +0/-0
  • Doom Newbie
    • View Profile
Re: Pistol brass on wrong side
« Reply #2 on: October 30, 2014, 11:39:42 AM »
you should be able to script it or to code it without much hassle.

Well if I knew how, I wouldn't be asking for help.  :)

Do you have any code or something I could look at?
Old bastard but kid at heart...

Ivan_the_B

  • Newbie
  • *
  • Posts: 18
  • Karma: +3/-0
  • Doom Newbie
    • View Profile
Re: Pistol brass on wrong side
« Reply #3 on: October 30, 2014, 03:35:03 PM »
I'd change the angular_velocity value in the debris def.
Denton mod made this easier to change iirc.

BielBdeLuna

  • Full Member
  • ***
  • Posts: 242
  • Karma: +8/-20
  • Doom Newbie
    • View Profile
    • my Github repositories
Re: Pistol brass on wrong side
« Reply #4 on: October 30, 2014, 05:25:38 PM »
angular_velocity should be just the rotation of the debries

I guess the velocity should be the vector of exit that should indicate the initial direction and the speed of the debries

Ivan_the_B

  • Newbie
  • *
  • Posts: 18
  • Karma: +3/-0
  • Doom Newbie
    • View Profile
Re: Pistol brass on wrong side
« Reply #5 on: October 31, 2014, 05:05:44 AM »
You are right, "angular_velocity" is just... the angular velocity. :)
"velocity", on the other hand, is applied to the direction determined by the current orientation of the "eject" joint (of the weapon viewmodel).
You should indeed be able to change the direction changing the "velocity" vector. Try negative values too.
Another solution is to rotate the "eject" joint in the weapon script.

The Happy Friar

  • Happy Happy Joy Joy
  • Administrator
  • Hero Member
  • *****
  • Posts: 776
  • Karma: +30/-4
  • Semi-Newbie.
    • View Profile
    • EarthQuake
Re: Pistol brass on wrong side
« Reply #6 on: February 04, 2016, 10:32:26 AM »
resurrecting a long dead thread here...

trying to eject the shotgun brass from the other site.  I moved the eject bone to the other side & the brass ejects from the other side but still flys towards the left side of the gun.

I've tried adjusting the "velocity" values in the brass def, it seems to ignore the negative & just use abs values.  I tried rotating the eject bone but it just seems to use that an xyz origin point for spawning the debris, the angle of the bone doesn't seem to matter.

Any idea?

motorsep

  • Hero Member
  • *****
  • Posts: 911
  • Karma: +72/-127
  • Artist
    • View Profile
    • Kot in Action Creative Artel
Re: Pistol brass on wrong side
« Reply #7 on: February 04, 2016, 10:40:56 AM »
You have to rotate bone 180 deg (so that whatever axis points to the left would be pointing to the right; make sure to switch to normal coordinate system in Blender to see it).

The Happy Friar

  • Happy Happy Joy Joy
  • Administrator
  • Hero Member
  • *****
  • Posts: 776
  • Karma: +30/-4
  • Semi-Newbie.
    • View Profile
    • EarthQuake
Re: Pistol brass on wrong side
« Reply #8 on: February 04, 2016, 12:13:08 PM »


That's in the md5mesh.  I also tried modifying the bone in the firing animation and it didn't help either.

I'm sure I'm doing something stupid somewhere, just can't figure out what.

wintch

  • Newbie
  • *
  • Posts: 45
  • Karma: +2/-0
  • Doom Newbie
    • View Profile
Re: Pistol brass on wrong side
« Reply #9 on: February 04, 2016, 12:39:11 PM »
Try to look at neo/game/Weapon.cpp.
Sorry about that, the engine was made for a particular game and you need to touch C code from time to time to get what you need.
I also wanted brass from the other side and in my game that worked just fine  8)
« Last Edit: February 04, 2016, 12:41:39 PM by wintch »

motorsep

  • Hero Member
  • *****
  • Posts: 911
  • Karma: +72/-127
  • Artist
    • View Profile
    • Kot in Action Creative Artel
Re: Pistol brass on wrong side
« Reply #10 on: February 04, 2016, 01:54:19 PM »
@THF: I think you need to rotate it in Pose mode, and key it. Also, try moving your eject bone somewhere and see if that changes in-game. Maybe you are saving new md5 somewhere else and not replacing the original?

Also check idDebris and what axis it uses to eject brass. I am at work now, so can't really do much.

@wintch: You shouldn't modify C++ code for this. It doesn't solve the issue. What if I want for another weapon to toss brass up? The code clearly reads bone from def file and gets its axes and origin.
« Last Edit: February 04, 2016, 02:02:26 PM by motorsep »

The Happy Friar

  • Happy Happy Joy Joy
  • Administrator
  • Hero Member
  • *****
  • Posts: 776
  • Karma: +30/-4
  • Semi-Newbie.
    • View Profile
    • EarthQuake
Re: Pistol brass on wrong side
« Reply #11 on: February 04, 2016, 02:22:09 PM »
I can move the eject bond around and the shell spawns at the bone's origin.  I can modify it in pose mode too and it doesn't seem to effect the direction.

I also wanted brass from the other side and in my game that worked just fine  8)

The code or the modifying bone/def file?

The #'s in the def file effect direction but never go negative. 

motorsep

  • Hero Member
  • *****
  • Posts: 911
  • Karma: +72/-127
  • Artist
    • View Profile
    • Kot in Action Creative Artel
Re: Pistol brass on wrong side
« Reply #12 on: February 04, 2016, 03:13:32 PM »
I can move the eject bond around and the shell spawns at the bone's origin.  I can modify it in pose mode too and it doesn't seem to effect the direction.

I also wanted brass from the other side and in my game that worked just fine  8)

The code or the modifying bone/def file?

The #'s in the def file effect direction but never go negative.

C+ code sets velocity to be negative. So originally velocity is positive, so I assume it uses local +Z for direction. When you make it -40, it gets tossed on -Z. However, and that depends if it's an issue with the code originally or something else, rotating bone should have the same effect. If +Z points up, then brass should be tossed up.

wintch

  • Newbie
  • *
  • Posts: 45
  • Karma: +2/-0
  • Doom Newbie
    • View Profile
Re: Pistol brass on wrong side
« Reply #13 on: February 04, 2016, 05:39:02 PM »
What really needs to be done, is letting def file touch these values, but currently this is not implemented.
You just have to export variables from engine, and you'll get complete solution. Rotating bones is ok, but i'd prefer to touch code and not models every time i need to adjust something. Different approach, nothing else.

The Happy Friar

  • Happy Happy Joy Joy
  • Administrator
  • Hero Member
  • *****
  • Posts: 776
  • Karma: +30/-4
  • Semi-Newbie.
    • View Profile
    • EarthQuake
Re: Pistol brass on wrong side
« Reply #14 on: February 04, 2016, 10:26:08 PM »
C+ code sets velocity to be negative. So originally velocity is positive, so I assume it uses local +Z for direction. When you make it -40, it gets tossed on -Z. However, and that depends if it's an issue with the code originally or something else, rotating bone should have the same effect. If +Z points up, then brass should be tossed up.

In weapon.cpp I'm seeing it not even call the velocity stuff in the debris for weapons.  What's weird is that even though it doesn't say it's reading it, the values to effect what happens, but not matter what values it always launches to the left, never to the right.  Looking at the code the velocity that's gotten is applied after it's spawned and the direction is based on the weapon.cpp stuff, which is based on the player's look angle. 

:(

What really needs to be done, is letting def file touch these values, but currently this is not implemented.
You just have to export variables from engine, and you'll get complete solution. Rotating bones is ok, but i'd prefer to touch code and not models every time i need to adjust something. Different approach, nothing else.

I partly agree.  Having the option to use the model bones or the def would be nice.  Just more options.