How to change (or create) Beardlib custom weapons' stats?
#1
I would like to know how to change (or create) the stats of custom standalone weapons added with Beardlib.
Right now specifically, i would like to change the stats of Babyforce's Water Pistol weapon.

I would like the weapon to simulate of having a capacity of an everyday IRL water pistol (usually the whole plastic), which then you'll (slowly) reload it, by simulating them having a small hole that fills the pistol with water very slowly.

I have already done this on the mod's main.xml file, by changing CLIP_AMMO_MAX to "100" and NR_CLIPS_MAX to "10", which means a "magazine" has 100 rounds in it, having 10 magazines available total, meaning 10x100 total ammo, keeping the mod's original intention of having too many ammo, but making it have finite amount still.

Now the problem i'm having is adjusting the Reload Time for the weapon. From what i researched, i've thought that reload_name_id was supposed to do the trick, originally having it completely omitted, thus having instant reload time. Changing the value to something like "glock_17", i thought it was going to read off the reload time of that weapon id, but instead it just simply played the animation, while still having instant reloads.

The creator had to do something to instantify the reload time, and i'm failing to find it via the main.xml file. Is there another file for the mod i'm supposed to see, or a block inside the XML file i'm not noticing?

This question, of course, also relates generally for a request on tutorials to how to create new standalone custom weapons, with customizable stats.

Thanks in advance.
Reply
#2
reload_name_id is parameter to tell the custom gun which reload animation it must use
idk how to completely make the reload instant, but you can change reload time with reload var with an integer value (0-9)
put this reload stat on the magazine weaponmod stats table
Reply
#3
You can hook a file to weapontweakdata.lua and add these lines in it :

if self.wpn then
self.wpn.stats.reload = X
end

Replace wpn with the id of the weapon.
11 is default (100%) reload speed, 1 is 50% base speed (or twice as slow) and 21 is 200% (twice as fast). I forgot what the cap is and can't really check right now because my internet is garbage.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)