Jump to content
Sign in to follow this  
.kju

Scripted weapon collision addon - looking for input

Recommended Posts

The mod should be disabled whenever the soldier uses ironsights to aim (i.e. use the usual collision). Otherwise it's impossible to get to a corner to lean with a weapon up.

I like it thus far. Soldier no longer gets pushed away from the obstacle when strafing near it with the weapon raised - and it's realistic at the same time (no weapon clipping through walls)

It just needs a smoother animation with lowered weapon (similar to how it's lowered in Ground Branch) - default BIS lowered weapon anim isn't good enough.

Edited by metalcraze

Share this post


Link to post
Share on other sites

Here's another revision: http://www.norrin.org/norrin/ArmA2/addons/rflOcclusion/v02/norrn_rflocc.pbo (Version 0.2)

Fixes:

1. Fixed ArmA2 report errors

2. Fixed script error when performing special moves such as climbing ladders

3. Fixed cross movement while crouching (forward + left/right) standing bug

4. Also you can now bring up aim mode while standing facing a wall, so that you can lean round corners more easily

Still need to fix:

1. Looping animation bug when going from standing un-occluded to kneeling occluded and vice versa.

Share this post


Link to post
Share on other sites

You still need to make addon scripts be ignored when looking through sights so the soldier won't lower his weapon when aiming

Share this post


Link to post
Share on other sites

Thanks for putting in work on this Norrin. I tested your 0.3 version and it works pretty well.

The only thing that seems not quite right is when the player makes the transition from weapon up to lowered (and vice versa). The screen seems to judder or jump a little.

It's not a massive problem but thought I'd chime in with some feedback.

Thanks again.

Share this post


Link to post
Share on other sites
Thanks for putting in work on this Norrin. I tested your 0.3 version and it works pretty well.

The only thing that seems not quite right is when the player makes the transition from weapon up to lowered (and vice versa). The screen seems to judder or jump a little.

It's not a massive problem but thought I'd chime in with some feedback.

Thanks again.

Agree with all, a very neat development - much improved CQB in/around buildings. Thank you Norrin for the addon, & PvPScene for the initiative... one of many hits for each of you IMHO :)

However, I tried this on a mission on Lingor (v1.4); running through the shrubbery was somewhat disconcerting because of the jumpiness. It also interrupted the sprint to some extent. Could it be disabled when the player is moving fast? - it isn't really relevant when the player is running anyway.

Share this post


Link to post
Share on other sites

Here: http://www.norrin.org/norrin/ArmA2/addons/rflOcclusion/v04/norrn_rflocc.pbo

Fixes

1. Rifles are no longer auto-lowered if you are running or sprinting - Orcinus

2. You can now aim while standing and crouching while your weapon is lowered - metalcraze

3. A few other bits and pieces

@Das Attorney - I'm not sure if I can make it any smoother mate as my knowledge of animation configs is not great and I have had to use the switchMove command to trigger the lower/raise action rather than playMove which I think would give a smoother transition.

@Kju - if you see this and you have any suggestions on how to rearrange the anim config so the animations are smoother please let me know.

Share this post


Link to post
Share on other sites

No probs at all mate. I read the thread and got the jist of why it gets a little disjointed here and there. Appreciate what you're doing and hope the devs pay some attention too for Arma 3.

I would try the new one, but I'm (unsuccessfully) trying to build a Hackintosh so I've got all my Windows HD's and memory unplugged. Will look forward to testing later :)

Share this post


Link to post
Share on other sites
Here: http://www.norrin.org/norrin/ArmA2/addons/rflOcclusion/v04/norrn_rflocc.pbo

Fixes

1. Rifles are no longer auto-lowered if you are running or sprinting - Orcinus

2. You can now aim while standing and crouching while your weapon is lowered - metalcraze

3. A few other bits and pieces

Thanks, norrin. Will test asap.

Edit: ran a few quick tests & it's looking good - both of points 1 & 2 make it a lot smoother. Nice work, thanks again.

Edited by Orcinus

Share this post


Link to post
Share on other sites

Hi

Found a bug (well, perhaps just a somewhat unwanted feature :)

Navigating through Lingor on a very cloudy night, no compass so the only way to navigate was to look at the map & my icon's orientation. When I exit the map, the rifle is lowered & hitting optics (NUM pad 0 or RMB) gives me a close-up of the ground at my feet. The only way I could get out of that was to move a step or two. Got me killed twice :(

Happens in the middle of an empty field, not even a bush nearby.

This was on CO 1.61 RC3 - will check on 1.60 before & after updating to 1.62 RC2.

Share this post


Link to post
Share on other sites
Navigating through Lingor on a very cloudy night, no compass so the only way to navigate was to look at the map & my icon's orientation. When I exit the map, the rifle is lowered & hitting optics (NUM pad 0 or RMB) gives me a close-up of the ground at my feet. The only way I could get out of that was to move a step or two. Got me killed twice :(

.

Yep I know what you're talking about and it happens in the 1.62 release candidate as well. Try hitting the "left mouse" button instead of the right mouse or 0 key as this will bring your weapon up without you having to move. Let me know how you get on, personally I don't mind it but if you can't live with it I'll looking into changing it.

Share this post


Link to post
Share on other sites

Thanks, norrin. I'll try that & see how it goes.

CQB in houses & behind solid cover is much improved (also using asr_ai 1.16 beta1, TPWC_AI_suppression, & TPW_LOS 102). I foresee this becoming one of my 'must use' mods :D

Share this post


Link to post
Share on other sites

This would be awesome if it was built in house and shipped by default. I am tired of having to download 25 mods to get the full experience. They should just launch with most of the experience already built in house.

They need to just hire all these modders, and make it all in house.

Share this post


Link to post
Share on other sites

I've modified BigDawks method (thanks for posting that mate) and have used existing in game animations to smooth out the rifle raising lowering anims.

NP, I'm glad you got it to work, and that you were able to find a solution to the problems I was having with it (what did you end up doing btw?). I've spent lots of hours messing (and mess is the appropriate way to describe it) with animation configs trying to improve movement and add new functionality using only what RTMs are already present, and I'm glad something usable finally came of it.

If you are interested in any other projects, I also had semi working lowered animations for pistols (the way AI holds them when not in combat) and launchers, though I was running into obstacles with certain hardcoded action maps. They could be transitioned to via script, but not bound to the existing raise & lower key actions. AI was also another issue. It would be cool to have these states (as well as holstering pistols and slinging rifles like in OFP) but it's just so much work. Perhaps someone who is more motivated could make an attempt.

Share this post


Link to post
Share on other sites
what did you end up doing btw?

You can download the full anim config from here if you're interested: http://www.norrin.org/norrin/ArmA2/addons/rflOcclusion/v04/rflOcc_config.cpp

Rather than

InterpolateFrom[] = {"AmovPercMwlkSrasWrflDr",0.01};

I created a new animation for each change in weapon position and then connected the actual .rtm file (the pre-state) to the post state using interpolateTo as shown in the following example:

class nStandRfllowerS : AmovPercMstpSrasWrflDnon
{
speed = 1;
file = "\ca\Anims\Characters\data\Anim\Sdr\Mov\Erc\stp\ras\rfl\AmovPercMstpSrasWrflDnon.rtm";
ConnectTo[] = {};
InterpolateTo[] = {"AmovPercMstpSlowWrflDnon",0.02};
};

The script then detects when there is a something blocking your view that is 1 metre in front of your eyes and then auto plays the appropriate lowering/raising animation using the switchMove command - couldn't get it to work with playMove unfortunately as I believe that would have provided a smoother transition. Doing it this way removed the unnecessary extra steps the unit was taking using your method.

Hmm you've just given me an idea :)

Share this post


Link to post
Share on other sites

Nice. You are getting there man. Just needs a custom animation for standing stance perhaps since it's still a little bit jerky when switching back and forth between lowered and readied weapon.

The only problem now is that first person camera (and I'm guessing a soldier's head too) sometimes clips through a wall if you are facing it and moving (try with Takistani buildings), especially in a crouching stance. Guess BIS didn't think about it happening under such circumstances.

Maybe you will try to experiment with soldier not exactly being pressed so close to the wall but still have just a little bit of a distance.

Edited by metalcraze

Share this post


Link to post
Share on other sites

Agree with metalcraze about the clipping. The other issue I've found is when trying to rearm at crate (especially), or a vehicle - the animation loops very rapidly between raised/lowered, one has to jiggle back & forth to fing a stable positon before the gear menus can be activated.

Share this post


Link to post
Share on other sites

Aloha :)

This addon sounds very nice. I just read this thread and haven't tested it yet, but got an idea: Can you add a check for the weapon used by the player and change the distance accordingly?

That way you can add another feature missing from Arma for too long and get a difference between assaulting a house with M107 or MP5. Best solution would be a .cpp file in "userconfig" I guess, so anyone can add new weapons.

Either way, thank you for making this (and everyone else helping/making suggestions) and I'll have a go with it tomorrow.

Share this post


Link to post
Share on other sites

@Metalcraze - I've found I can slow down the change in weapon readiness by using the interpolationSpeed option in the anim config, this reduces the jerkiness quite a bit and it may be more what you're after. If you can give me a link to the Ground Branch anim that you mentioned in an earlier post that'd be a huge help as I can see exactly what you mean. I'll also look into the clipping issue, I may have to re-define the player's collision shape while crouching.

@Orcinus - I think the same thing happens when you try dragging someone, I thought I'd fixed the gear anim problem in version 0.4 but I'll check again under the conditions you suggest.

@Scruffy - that's a very nice idea :) I'll see if there is a way to determine the rifle's length from its model space that way no user config'ing would be necessary if you were using one of the many weapon mods that are out there.

EDIT: Just tested the clipping issue, it doesn't happen in buildings on Shapur but it does happen on Takistan. It even seems to happen on Takistan if you remove the addon and lower your rifle the default way. Seems there may be some issues with the Geo/collision lods of buildings on Takistan which are beyond my control.

Edited by norrin
Updated info

Share this post


Link to post
Share on other sites

What I mean is lowering weapon like this when close to a wall (well in Ground Branch the animation serves a different purpose) - since right now the anim is as if you are holding a weapon in a safe, relaxed stance. At that point in the video you can see that the weapon isn't held straight but basically lowered while still facing forward.

If you are planning on doing this it will be great if you still were able to pull the trigger with the weapon lowered like that - in CQB this will provide for a nice responsiveness when strafing through a door or coming around corner as you will be able to shoot immediately as the weapon is still getting raised, not wait until it's in a ready position - and those ~2 bullets fired early may as well save your life.

And if you will just have it lowered like that it will solve the problem of a head clipping through a wall since in that stance the weapon will still keep you some distance away from the wall although much smaller than usually - but I think it will be a nice balance between how you are getting pushed now with the weapon raised without the mod and how you are getting clipped with safe stance.

Edited by metalcraze

Share this post


Link to post
Share on other sites

What I mean is lowering weapon like this when close to a wall (well in Ground Branch the animation serves a different purpose) - since right now the anim is as if you are holding a weapon in a safe, relaxed stance. At that point in the video you can see that the weapon isn't held straight but basically lowered while still facing forward.

Thanks for that metalcraze and I agree that would be perfect for what we are trying to achieve. Unfortunately, I'm not sure this would be possible unless I remade all of the default weapon lowered animations and rerouted the default anim config to use the revised animations eg. when you lowered your weapon while walking forward it would move to the low aiming forward position rather than the across the body position and I'm not sure how happy people would be about that. I'm not saying that its impossible just could be a lot of work - making new animations, there's lots of them, then getting them to work when needed.

I'll look into it but for the next version I'm planning on releasing a slightly slower weapon lowering and raising animation combined with removal of the camera twitch that happens when this occurs.

Share this post


Link to post
Share on other sites

Two suggestions:

# Disable the check while changing stance - it can easily get you into an endless loop of crouch-stand up-crouch for example

# It be worth to consider to disable the check for certain objects (like bushes) and at certain extreme angles (looks at the ground or up)

In the latest version it happens quite often for me that while moving away from an object with weapon down, it wont snap back up.

Especially when you walk away backwards or turn and move. It works fine when walk - with run or sprint no weapon up again.

Another thing to consider but may not be easy to realize:

You move close to a wall, weapon gets lowered; now you move alongside the wall.

You dont want the weapon the be up immediately but probably once you stop again.

Maybe do the weapon up check only when not moving?

Share this post


Link to post
Share on other sites
Two suggestions:

# Disable the check while changing stance - it can easily get you into an endless loop of crouch-stand up-crouch for example

# It be worth to consider to disable the check for certain objects (like bushes) and at certain extreme angles (looks at the ground or up)

In the latest version it happens quite often for me that while moving away from an object with weapon down, it wont snap back up.

Especially when you walk away backwards or turn and move. It works fine when walk - with run or sprint no weapon up again.

Another thing to consider but may not be easy to realize:

You move close to a wall, weapon gets lowered; now you move alongside the wall.

You dont want the weapon the be up immediately but probably once you stop again.

Maybe do the weapon up check only when not moving?

Here's a new version it hopefully fixes many of the problems you describe: http://www.norrin.org/norrin/ArmA2/addons/rflOcclusion/v05/norrn_rflocc.pbo

Changes and Fixes:

1. Created a new series of animations for the weapon lowered position. Weapon is lowered straight down rather than across the body. Note: Its still possible to use the default ArmA weapon lowered animation by double tapping the left ctrl.

2. Created new geometry lods to match the new animations

3. Tried to identify problem actions such as dragging objects, accessing gear, re-arming etc and implemented work arounds.

4. Rewritten much of the code to optimise and simplify implementation.

5. Config updated to allow for new anims and to slow the transition from raised to lowered state.

Please let me know if you come across any bugs or actions that cause anim looping.

@Scruffy - still trying to think of a way to implement your suggestion, I may have to set it up for the default ArmA2CO weapons then allow for changes to a user config variable, as you pointed out, to allow for weapon mods.

Edited by norrin

Share this post


Link to post
Share on other sites

Wow - excellent stuff. In the last couple of months I have had an operation, been particularly ill and had to deal with the kid's summer holidays - I am in the process of catching up with what's been happening and I am amazed at the stuff that's being done! This is excellent work indeed.

I noticed the following script error whilst trying this in Takistan (using the new ACR SF guy in case it matters)...

Error in expression <7) : {"nKneelRfllowerFR"};};};player switchMove _anim;>
 Error position: <switchMove _anim;>
 Error switchmove: Type Bool, expected String

I can't reproduce the error - so maybe it was just a one-off.

Edited by Jedra
Added scripting error

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×