the_demongod 31 Posted July 29, 2014 Hey guys First let me start out by saying I have practically no clue what I'm doing here. I am moderately familiar with scripting but this is the first time I have ever delved into config. What I want to do is raise the rate of fire of the A-164's cannon, to see if it will be less pathetically weak. All I want to do is make a simple addon that raises the rounds per minute. I read that ROF comes from the parameter reloadTime. This value was somewhere around 0.036, I changed it to 0.015. It didn't seem to make any difference. I changed it to 1.0, that didn't seem to make a difference either. I went into the config browser and indeed the value of reloadTime was changing, but it didn't seem to affect anything in-game. Does anybody know what the problem might be? p.s. I will put my config here below in case it will help fix the problem. Keep in mind that I pieced this together, mainly by guessing so don't be too harsh if it's a total piece of shit. class CfgPatches { class the_Demongod_A164_ROF { units[] = {}; weapons[] = {}; requiredVersion = 1.0; requiredAddons[] = {"A3_Air_F_EPC_Plane_CAS_01"}; }; }; class CfgWeapons { class CannonCore; class Gatling_30mm_Plane_CAS_01_F : CannonCore { reloadTime = 0.015; }; }; Cheers Share this post Link to post Share on other sites
x3kj 1247 Posted July 30, 2014 i vaguely remember that rounds per minute are dependant on your fps. You wont be able to go above a certain threshold. Thats also one reason why the Doorgunner minigun has area damage, to "simulate" higher rof. I would change hit/indirecthit/caliber instead to make it stronger. Share this post Link to post Share on other sites
the_demongod 31 Posted July 30, 2014 I know it is dependant on fps, but the fact that I can't make the rate of fire go down is what makes me think something is wrong with my code. Share this post Link to post Share on other sites
x3kj 1247 Posted July 30, 2014 oh ok, missed that. Does the Gatlinggun have this line modes=["mode1","mode2","blablabla"]; defined? If so, you have to change the modes instead - basically, its like a sub-weapon class. Weapons with modes ignore most stuff that is set in their main config, as its overwritten by the modes. Share this post Link to post Share on other sites
the_demongod 31 Posted July 30, 2014 yeah actually it does It's just the A-164's Cannon the line is: modes[] = {"LowROF","close","near","short","medium","far"}; How should I change my code to fix it? Oh and thanks for the help by the way Share this post Link to post Share on other sites
x3kj 1247 Posted July 30, 2014 you need to change the properties in the modes instead of the main weapon class. I guess LowROF is the important one, close and the rest are for AI use only (not visible to player) Share this post Link to post Share on other sites
the_demongod 31 Posted July 30, 2014 ahh that makes sense, I was trying to figure out what the different fire modes were. so what would change in my code? would I inherit to/from different classes, or do I have to add something entirely new? Share this post Link to post Share on other sites
x3kj 1247 Posted July 30, 2014 just look at the original class definition. It's in "<arma3root>/Addons/weapons_f_ebc.pbo/config.bin" extract the config file using a pbo extract tool. If you only see garglblarg when you open it with a texteditor, you need to debinarize it manually (drag&drop the file onto cfgconvert.exe in your A3 Tools folder). ive looked it up for you this one time, this is what you will find amongst other stuff: click Mode_Fullauto is an external class. check the A3 Handweapon sample, or the main config file i mentioned. Share this post Link to post Share on other sites
the_demongod 31 Posted July 30, 2014 Thanks a bunch :) I will be sure to try this out tonight. Cheers Share this post Link to post Share on other sites
dezkit 28 Posted July 30, 2014 Do not overwrite classes like that. Do this instead class CfgWeapons { class Gatling_30mm_Plane_CAS_01_F; class MyCoolWeapon : Gatling_30mm_Plane_CAS_01_F { reloadTime = 0.015; }; }; Share this post Link to post Share on other sites
das attorney 858 Posted July 30, 2014 (edited) You can overwrite default classes if you want. You just need to be careful. Lots of mods do it (JSRS and Blastcore for example). There are pros to creating child classes for your own mod (as Deskit quite rightly mentioned), but if you want to change the default behaviour of assets then a sneaky overwrite is the way to go. Anyway. I did a swift config for you. It definitely works as I've tried it with varying speeds and the ROF changes based on the value. Thanks Fennek for the pointer about LowROF. Wasn't sure which one to change at first. There wasn't any config rpt errors, but I've only tested it as part of a bigger mod, so can't guarantee there's no weird side effects (only tested for 10 min or so). I can see why BIS didn't set the value to some ridiculously small number. The FPS loss is large when close to target and also I would imagine there is a large amount of desync online due to massive spawn of ammunition simulated entities. Here's me blowing shit up: And here's the config: class CfgWeapons { class Default; class CannonCore: Default { class Mode_SemiAuto; class Mode_FullAuto; }; class Gatling_30mm_Plane_CAS_01_F: CannonCore { class LowROF : Mode_FullAuto { reloadTime = 0.00001; // 10; // ho ho }; }; }; BTW: Numbers this small appear as scientific notation in the config editor (like a 1980's calculator if you remember them). reloadTime = 0.00001; Shows up like this in the config editor: reloadTime = 1e-005; So don't be alarmed if you put in a number and then it looks different.. Enjoy :) EDIT: I think there's a limit to what the game can simulate anyway. You can set the number to what you want but it is still limited to the speed of the simulation on your PC. Check this by adding a "fired" EH which logs the time and then check shots per unit volume of time vs reality. (Save to variable and calculate in separate function and then dump to log instead of slowing the game down writing to the .rpt as you play) Edited July 30, 2014 by Das Attorney Share this post Link to post Share on other sites
the_demongod 31 Posted July 30, 2014 Thanks a million dude! It works like a charm. I knew the issue had to be related to classes and inheritance and such, since those bits made literally no sense to me haha. And I'm not surprised that it lagged your game: you set the cannon to fire at 6,000,000 rpm! The real A-10C's cannon only fires at around 4,000 :P anyways, thanks for the help, you saved my ass on that one. One more question: if I wanted to change the damage of the cannon, would I just add that to what I already have, or would that have to go into CfgAmmo? Share this post Link to post Share on other sites
das attorney 858 Posted July 31, 2014 Hi TDG You're quite right - That would be a separate CfgAmmo declaration. Your best bet it to work out a config, then play it for a bit and then see how it works. Silly me about the ridiculous re-chamber time. I picked some really small number and didn't really check out what it should be. I make it: 4000 RPM RoundsPerSecond = 4000 / 60 = 66 rounds every second. which means every round takes (1/66) of a second; = 0.01515 seconds And BI have their value as: reloadTime = 0.034; Share this post Link to post Share on other sites
ante185 2 Posted July 31, 2014 that would mean the BI wanted the number to be closer to 2000 RPM then? Share this post Link to post Share on other sites
x3kj 1247 Posted July 31, 2014 put an artificial limit of 30fps to your game and test with 4000rpm... i'm sure you'll only get 30 rounds per second. Share this post Link to post Share on other sites
das attorney 858 Posted July 31, 2014 I guess so - you can add in a new firemode to switch between them - there's no change in the HUD (top right), but the fire rate changes. Use the F key. class Gatling_30mm_Plane_CAS_01_F: CannonCore { modes[] = {"LowROF","HighROF","close","near","short","medium","far"}; class LowROF : Mode_FullAuto { displayname = "Low"; }; class HighROF : LowROF { burst = 20; displayname = "High"; reloadTime = 0.0152; }; }; You could define a sound if you want to know the mode has changed: changeFiremodeSound[] = {"yourDir\yourFile.wss",1,1}; Share this post Link to post Share on other sites
the_demongod 31 Posted July 31, 2014 If you guys fly the wipeout, I encourage you to try 4000 fps. It feels much more authentic, and unlike the standard fire rate, you can actually kill armor up to BTR-Ks and Marids with (realistic) ease. I suppose the damage could be buffed instead, but the real issue is just that you can't put enough rounds on target in the time you have in a strafing run. Share this post Link to post Share on other sites