Re: Stuck on how to modify reloading
Something I’ve been having trouble understanding is how reloading works and how to tweak it via Lua. With no reference on how the game handles it, I’ve been stuck on how to do something as simple as prevent/enable reloading based on a variable.
Reading through a couple of mods that implemented custom reloading and ammunition hasn’t helped either. I can’t seem to pinpoint what segment of the code deals with it.
Mainly what I’m looking to achieve is:
-Create a system that stores ammunition magazines (was leaning towards a variable which stores them).
-Block reloading of the weapon when this is depleted.
-Deduct from whatever stores ammunition magazines after reloading.
If someone could give me examples of code that could achieve this, and maybe some examples that deal with reloading in general, it would really help.
Hello there, I don't know much about Lua, just some simple stuff and I'm gradually getting better at Lua. Cant really help you with the problem itself however, the DayZ mod has a working ammo system similar to that you seek. Maybe you can check that out and see how that work and you might pull something off yourself.
Heres the link:viewtopic.php?f=1&t=45250&