Data Realms Fan Forums
http://forums.datarealms.com/

Stuck on how to modify reloading
http://forums.datarealms.com/viewtopic.php?f=73&t=46112
Page 1 of 1

Author:  Afebrile [ Wed Dec 21, 2016 12:30 am ]
Post subject:  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.

Author:  RandomCoderZ [ Wed Dec 21, 2016 4:38 am ]
Post subject:  Re: Stuck on how to modify reloading

Afebrile wrote:
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&

Goodluck :)

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/