View unanswered posts | View active topics It is currently Wed Dec 25, 2024 5:19 pm



Reply to topic  [ 2 posts ] 
 Stuck on how to modify reloading 
Author Message

Joined: Fri Dec 16, 2016 2:51 am
Posts: 2
Reply with quote
Post 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.


Wed Dec 21, 2016 12:30 am
Profile
User avatar

Joined: Fri Sep 13, 2013 1:39 am
Posts: 157
Location: ᴱᵛᵉʳʸʷʰᵉʳᵉ
Reply with quote
Post 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 :)


Wed Dec 21, 2016 4:38 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.044s | 13 Queries | GZIP : Off ]