News:

One Minute Game Review by The Happy Friar: https://ugetube.com/@OneMinteGameReviews
Also on Rumble: https://rumble.com/c/c-1115371

idTech 4 (aka Doom 3 tech) Discord Server! https://discord.gg/9wtCGHa

Main Menu

Pistol brass on wrong side

Started by calan, October 30, 2014, 02:49:47 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

calan

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

you should be able to script it or to code it without much hassle.

calan

Quote from: BielBdeLuna on October 30, 2014, 10:20:21 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

I'd change the angular_velocity value in the debris def.
Denton mod made this easier to change iirc.

BielBdeLuna

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

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

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

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



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

#9
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)

motorsep

#10
@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.

The Happy Friar

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.

Quote from: wintch on February 04, 2016, 12:39:11 PM
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

Quote from: The Happy Friar 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.

Quote from: wintch on February 04, 2016, 12:39:11 PM
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

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

Quote from: motorsep on February 04, 2016, 03:13:32 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. 

:(

Quote from: wintch 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.

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