Flan's Mod Ultimate Stability Edition

Flan's Mod Ultimate Stability Edition

187k Downloads

Toggle weapon model disappearance on scoped weapon

HighQualityCookie opened this issue · 21 comments

commented

When I tried to put a simple crosshair as scope (pictures attached), I noticed that the weapon model disappears. And then I thought it would be pretty cool if you could toggle the weapon model disappearence. That would make toggleable crosshairs pretty easy to implement like that. Let me know if that could be a thing or if something like this even already exists (or can be achieved in another way).

Much thanks!

2021-07-12_01 39 04
2021-07-12_01 39 07

commented

Heya, I had a go at enabling control over all animation settings for ADS, but there's too much going on to simplify into variables.
For now, I've just added two, you need to put these in your model file.

// Render gun even when scope overlay is displayed
stillRenderGunWhenScopedOverlay = true;
// Effects the amount of movement to do when ADS. 1 = normal 0 = none e.t.c.
adsEffectMultiplier = 0;

A demo can be seen here:
https://streamable.com/g5j9jw

I've included a build with the feature in, would be grateful if you could provide feedback on it. Let me know if you have anymore questions :)
rel.zip
Disclaimer: This build may have bugs in it, and is not a proper release. Only suitable for testing atm.

commented

Works just the way I wanted it to. Thanks alot!

commented

Thanks for the build! I´ll try it out.

commented

Great! Glad that's what you wanted. It'll be released fully in the next version. Can this issue be closed now?

commented

Yep

commented

Interesting. Out of curiosity, what's the attraction of this effect? I assume you want to combine the overlayed ADS texture with the zero movement?

commented

On the same note, I had another idea. May you also implement an option where you can disable the zooming animation altogether? So when you ADS/zoom in, the weapon just doesn't move at all. Appreciated ;)

commented

That's pretty much the case. The gun that I'd love to capture just has some unique features; and to achieve a greater level of detail on that gun, these options would just be amazing!

commented

https://streamable.com/mtghhy
Some progress. Got the gun to display or not when scoped via a config option. Looks like it was just being moved behind the eyes before. It doesn't work with ZoomLevel currently, so I'll have to investigate that. Then, looking at the animations for moving to and from ADS. My hope is to make those configurable, so you can choose exactly where it moves to - but the code there is.. cryptic. I'll link it here if you're interested.

https://github.com/Unknown025/Flans-Mod-Plus/blob/Ultimate/src/main/java/com/flansmod/client/model/RenderGun.java#L175
175-218 pretty much.

commented

Looks pretty good so far 👍

commented

I should add, do you mind much about zooming?

commented

Yes, it´s quite important to me.

commented

I'm completely surprised by this, but it looks like the reason this isn't possible is down to forge/minecraft, not Flansmod..

As we can see in this screenshot:
image

If the cameraZoom isn't 1, it just.. doesn't render. I had to install intellij to try and track this down, and I'm quite frustrated at this.
I'm sure it is possible to do, but I lack the skills to do it, I'm afraid. My apologies that this will probably be quite disappointing news for you..

Based on that, the only option then is to use the FOV change, just without any magnification.

Next step is to make the animation settings for ADS configurable.

commented

I think a zoom via FOV-change would also be pretty good. I can't wait to get my hands on these features ;) I really appreciate the effort, no need to apologize. Thanks a lot!

commented

Heya, thanks for using the mod, I believe the feature you're looking for exists already, and is implemented in quite a few packs. Like the ACOG from the MW pack?
https://github.com/Unknown025/Flans-Mod-Plus/blob/Ultimate/eclipse/Flan/Modern%20Weapons%20Pack/attachments/ACOGSight.txt

You can see comments in here too, explaining what the different variables do.
//These variables only come into effect if this is a scope //The ZoomLevel affects how much the view zooms in (note that this removes the model from the zooming animation and so is useless for iron sights) //The FOVZoomLevel affects how much the view narrows when zooming. Very useful for iron sights as it gives the illusion of zooming without killing off the model ZoomLevel 1.0 FOVZoomLevel 2.0 ZoomOverlay None

I think you need to use FOVZoomLevel, and make sure ZoomLevel is 1.
Hope that helps, let me know if you have anymore questions :)

commented

The problem was not that I don't know how to zoom in but how to keep the model of the gun as well as the red crosshair (that you can see in the second picture) at the same time.

EDIT: I'm not using an attachment btw.

commented

Ah, okay. Wasn't sure before. Can you send the config of the gun? I can have a look and see what options are available there.

commented

Here it is.
FirstPistol.txt

commented

I only want the crosshair to be shown when the player ADS. I'm also aware of the fact that most current iron sights are build into the model itself. But I would really love to see this feature, so you can just put a GUI over the screen much like a sniper scope; but simply without the model disappearing.

commented

I'm not sure there is a way currently, the way a lot of scopes work is to have one built into the model, with a high res texture semi-transparent in it, in the model as well. To display a 2d texture as well, I'll have to investigate further when I have time.

Are you wanting this only when the player scopes/ADS/aims, not constantly?

commented

Oke, I'll hopefully get to investigate this fairly soon - and probably get this into the next release if it's not there already.
Thank you for your questions and feedback ;)