Item giving item on use

Heyo o/ im new here:) and I’m making my first mod for ark.
It is a gun mod, but not like all the rest. I want Reloadable ammo. So I need my guns to give me a empty shell on firing or reload. I got the guns and I got the ammo. All is crafting just fine and as expected. But I cannot figure out how to get used casings back.

I found a parameter/setting thing called “give item on use” I added my casing resource there but it doesn’t seem to work:/
I tried doing that both on the ammo and the gun itself. Separate and at the same time.

So is this even possible? And if it is. How?

Thank you
Kind regards
DizzyRonson

The problem might be that the gun is being “fired” not used… I’m guessing it would have to happen as an event graph trigger by weapon fire. Though this is just a thought.

Thanks for the answer:) I have now had a little look at the graph stuff and I feel a bit… not overly intelligent atm. Could you maybe supply me with some pointer as to what to look for?
I will be trying to find some tutorials now:)

I am so stuck:/ I need some help on this… I have found no tutorials on how to do this. And whenever I find something that looks like it might be what I’m looking for it just results in a dead end… I am so frustrated with this now. I spent 8-9 hours today trying to figure out this one little thing… My head hurts and I’m just about to just quit the entire mod… so I ask one last time.

Can someone please try to figure out if what I’m trying to do is even possible and how to make it work. It seems so simple and I just can’t figure it out by myself. All I want is to get my “used ammo resource” when I fire a shot.

I have zero experience working with weapons and just started with the graphs and scripting a few days ago so i feel your pain… Ive tried countless tutorials and methods to making a mesh rotate or move and those aren’t even working for me so I’m the LAST person you want trying to actually solve the issue here haha. But i am pretty sure what I stated above is still true, I just have no idea how to deal with it. Unfortunately you will not get very much help right now as the contest timeline is coming to a close and people don’t want to take time away from their own mod or help out potential competition :p. Its the sad truth about these competitions haha.

I also think the clue you gave is the way to go. There are some of the stuff there that seems logical to me as far as naming and such go. But I just cannot figure out how it all works. I also feel what you say about this modding contest is true. And I feel contests like this is a bad thing for the modding community, I have never in my time with mods had such a struggle to get help… these competitions are driving the community apart and that is really a very bad thing:/ sure there might come some really good mods from it, but as a whole it will reduce the potential for new ideas and make the community much less friendly and more industrial… As far as modding go, industrial is the last thing anyone wants:/

Nonetheless I thank you for trying to help me:) you are the only one that has even bother to answer me on any of my post on any forum.

I’m very new to this too.

I think the “give item on use” won’t work because your player isn’t “using” the item (like food is used from a hotbar or a structure is used when placed).

My mod works with creating custom metal arrows and I needed to make it so that when they were “picked up” they gave back an item to the player’s inventory. I found this setting in the ProjArrow_ file. There is a heading called “Pick Up”. This is from my mod and it shows you can pickup the a Metal Arrow from a radius of 60 from the impact:


You might need to modify the gun so that in addition to the bullet it also fires a projectile with a ProjCasing_ file (or something like that). You can set the physics on the casing projectile so that it travels in the direction you want it to, at the speed you want it to, etc. In your Weap file for your weapon there is a “Projectile” heading where you can reference your projectile class. If they dropped onto the ground near the player then they can pick them up within a definable radius and that should work. It would also add a nice dynamic to the game where they need to spend a moment to re-gather their casing rather than just getting them regardless.

Actually, just spent twenty minutes digging around. While there is a Projectile heading for WeapCompoundBow and other bows it does not seem to be a heading for any of the guns. Maybe someone with more experience can suggest how it might be added in… If you can’t add a Projectile heading for a gun then maybe it would be easier to use a bow as your starting point, set the projectile to behave like a casing (rather than an arrow) and find a way for the damage dealt to be done by the bow itself rather than by the projectile…

Thank you so much for this idea. I will definitely do some testing with this. And as you mentioned with the casings actually dropping on the ground, it would be perfect:) I have already been toying with the idea of using a bow as base. To give the guns a bit of ballistics:)

No worries - hope to see your mod on the Steam Workshop soon :smiley: