Jump to content

Bringing the old Hunting Rifle back.


Recommended Posts

No disrespect to whoever did the new weapon models. They generally look nice, weird iron-sights on some though. I just miss and prefer the old classic wooden stock rifle.

I tried ripping the old prefab assets out of the assets bundle and packing it into a .unity3d + changing the items.xml meshfile property like the scope mods I made, but those were just simple textures. I don't really know Unity and I must be doing something wrong with setting up the prefab object. Shows up invisible in-game. Plus there were like 4 separate folders with hunting rifle assets/prefabs, and I also don't know how to get the animations applied and working correctly. I seem to be able to attach the reload animation to the prefab and it shows in the animator, but each part of the animation says its GameObject or Component is missing and it doesn't actually work. Basically I have no idea what I'm doing.

Not sure if this would be easy for someone who actually knows Unity since all of the assets are already there, or if they also made some fundamental changes with the hand model/animations that would require them to be re-done. I just don't know how to re-bundle them together properly.

Edited by Deceptive Pastry (see edit history)
Link to comment
Share on other sites

I got the attached animation to properly show values for each part. It seems the issue was it needs the correct hierarchy which is HuntingRiflePrefab with a HuntingRiflePrefab inside it (???), then the handle/attachments. Very strange. Still don't know why it's invisible in-game, would think I'd see console errors if the xml path was pointing to the wrong location. Unity seems very unintuitive to me, the way things have to be packaged into a prefab, dragged into the hierarchy, then dragged BACK into the asset window as a prefab. Maybe I just don't get it, seems overly complicated compared to many other games I've modded in the past. And a lot of the old youtube tutorials for 7 days don't exist anymore. Idk if I feel like continuing to mess with this. I'm sure someone will probably do it eventually.

Edited by Deceptive Pastry (see edit history)
Link to comment
Share on other sites

Hmmm.... and I know nothing about Unity, DP... - however, - as you mentioned "Bundles" - I just groped around with a hex editor, and it seems to me that the existing A20 Bundle folders have retained all of the same detail that's in the A19 Bundle folders, so last night I recreated all of the (HR) weapon xml's into a mod file after reading your post, and will see what I can come up with by following the tracks within those files today. Of course - I might be simply whistling Dixie - I have no real technical expertise - and don't understand most of what you're talking about!  I did, however get involved in modding the Far Cry 4 game and it's weaponry system, so that might help a little. . . .  maybe . . .

Later.

Edited . . . . . . .    Naaahh. . . . too much for this old fart..  besides - the new (old) rifle isn't too bad.. I'll live with it.  (The real reason is that my wife thinks this is interfering with my seasonal holiday participation. . . . duh! )   Good luck! Hope you make it work.

Edited by paulj_3 (see edit history)
Link to comment
Share on other sites

Another tip. If you are new to Unity - then you should make some kind of "stick" and add it as a weapon on the type of hands that the rifle uses.

This way you will be able to check the correctness of your production process.

Then, by comparing two objects in the editor, it is easier to calculate the difference that led to the error.

Link to comment
Share on other sites

I ended up messing with this some more and made decent progress. It's in-game and even have the front sight aligned fairly well. The last roadblock is I don't know how to get the animation functioning properly. I have it attached and working on the prefab, the issue is I don't know how the animations are named/sequenced in the animator to be triggered in-game. That doesn't seem to get imported with the .fbx. If there were an OnSelfReload trigger I could trigger the reload anim that way but I don't think there is.

EDIT: Got the animation triggers working. Need to tweak the animation a little and get attachments working then it might actually be set.

Edited by Deceptive Pastry (see edit history)
Link to comment
Share on other sites

  • Deceptive Pastry changed the title to Bringing the old Hunting Rifle back.

I just about have this thing finished and ready to release. I'm just having trouble getting the reload animation speed to scale properly with reload speed modifiers eg. the bandolier. Wondering if anyone has any insight on this, maybe I'm missing some parameter that the game uses to scale animation speeds or something.

Link to comment
Share on other sites

I figured it out after some deep google searching lol. The forum's built in search didn't bring anything up for me. You need a float parameter "ReloadSpeed" set to 1 in the animator, then you set the animation's speed multiplier to that parameter. It gets automatically adjusted in-game.

I think I've got about all the difficult stuff figured out. Finally. A little more tweaking then I'll probably post it tomorrow.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...