Jump to content
Choffix

Vehicle config problem

Recommended Posts

Hello guys!

 

So lately I've started getting into modding and my first mod would be continuing the work of a person I know. He tried editing the vanilla independent IFV (Mora I believe it's called) and creating a realistic FV 510 Warrior with the correct weapons and ammunition. He couldn't get it working and gave up a while ago. I have made quite a lot of progress and I'm fairly certain I can finish it this week, but I am stuck at something and I hope someone can see what's wrong with the config.

 

So my problem is that the modded rarden autocannon does not replace the vanilla autocannon, but the modded chaingun replaces the vanilla coax MG and works properly. I don't understand why the code works for the chaingun but it doesn't for the rarden. Ingame the vehicle spawns with the vanilla autocannon (I can see that because I flagged the display name) and no ammo for it. When I put vanilla ammo in it it works.

 

Here's the code on pastebin: http://pastebin.com/r05gmh9L

 

 

 

Bonus question: For the chaingun 'magazineReloadTime' works and changes the... well, magazine reload time, but 'reloadTime' doesn't change the rate of fire for some reason (I commented it after trying, don't worry). Any ideas?

 

 

Thanks!

 

Share this post


Link to post
Share on other sites

Ha it took some time to figure it out, but I got it!

the autocannon_30mm has this line in its config:

   muzzles[] = {"HE","AP"};

which means it has two type of weapons combined in the one, the HE and AP.

Now those weapons override what parameters you have in the class rjm_l21a1_rarden and make it still look like the original.
If you change it to muzzles[] = {"this"}; it will use the parameters from the class rjm_l21a1_rarden.

muzzles[] = {"HE","AP"}; is used to simulate dual loading gun that can use HE and AP ammo without changing magazines and is the same system as how underbarrel grenade launchers are set up in rifles: muzzles[] = {"this","UGL"}; means theres the weapon defined in the weapon class itself and additional weapon defined in the class UGL and so on.

You can also define your own HE and AP weapons if you want and just place them in the muzzles array.

  • Like 1

Share this post


Link to post
Share on other sites

Thank you so much!

 

Unfortunately my motherboard died today so until I get a new one I won't be able to see if this works or not but you sound like you know what you're doing so I trust it will!

 

Since I can't test it right now, if I just put in 'muzzles[] = {"this"};' the cannon will require a reload when switching ammo types, and if I put in let's say 'muzzles[] = {"rjm_l21a1_rarden_HE", "rjm_l21a1_rarden_AP"};' it will not?

 

Thanks again!

Share this post


Link to post
Share on other sites

Thank you so much!

 

Unfortunately my motherboard died today so until I get a new one I won't be able to see if this works or not but you sound like you know what you're doing so I trust it will!

 

Since I can't test it right now, if I just put in 'muzzles[] = {"this"};' the cannon will require a reload when switching ammo types, and if I put in let's say 'muzzles[] = {"rjm_l21a1_rarden_HE", "rjm_l21a1_rarden_AP"};' it will not?

 

Thanks again!

Yes I think that is how it works. It was actually a new thing for me too since I have no even thought about dual fed weapons before, but it does open bunch of new opportunities. :D

Share this post


Link to post
Share on other sites

So I got my new motherboard and the code works! Thank you very much!

 

But now I have another problem, I can't figure out how to change reloadTime (rate of fire).

 

Here is what I currently have:

http://pastebin.com/nRwhGR54

 

When I get it ingame the gun has the proper reloadTime but it has no sound and a ton of errors. I know there's something wrong with the inheritance and I've spent hours trying to figure it out but I'm clueless.

 

Any help would be greatly appreciated!

Share this post


Link to post
Share on other sites

So I got my new motherboard and the code works! Thank you very much!

 

But now I have another problem, I can't figure out how to change reloadTime (rate of fire).

 

Here is what I currently have:

http://pastebin.com/nRwhGR54

 

When I get it ingame the gun has the proper reloadTime but it has no sound and a ton of errors. I know there's something wrong with the inheritance and I've spent hours trying to figure it out but I'm clueless.

 

Any help would be greatly appreciated!

If theres missing class errors it does not inherit everything needed that is correct, have you checked how the classes differ in the Arma 3 ingame configviewer? (start scenario from editor, hit esc, under the debug console)

Share this post


Link to post
Share on other sites

It's like this, if I spawn as the gunner I can use the autocannon, but if I change weapons or enter the gunner seat I can't. The weapon doesn't even appear in the config viewer, only the vehicle and the chaingun.

 

 

Nevermind! I'll post back when I find the differences.

Share this post


Link to post
Share on other sites

Here are the 2 screenshots I took: http://imgur.com/a/3p7uR

 

The only difference between the two configs in the config viewer is the positioning of the 'reloadTime'. I suppose that's the issue. Any ideas?

 

EDIT: After editing the working config, I got the same result in the config viewer as the one that doesn't work, only the gun actually works (but the RoF doesn't change). I just moved 'reloadTime' above 'muzzles'.

 

class rjm_l21a1_rarden : autocannon_30mm

{

       reloadTime = 5.0
       muzzles[] = {"this"};
       displayName = "L121A1 RARDEN";
       magazines[] = {"rjm_6rd_apfsdp", "rjm_6rd_hei"};
       magazineReloadTime = 4 ;
 
};
 

Share this post


Link to post
Share on other sites

reloadTime = 5.0 is missing ; from the end.

Other that don't know whats going on. Could you put the whole config somewhere? Easier to test that way.

Share this post


Link to post
Share on other sites

Here's the code that works but 'reloadTime' does nothing: http://pastebin.com/5zQV1J1e

I've tried fixing that in this config but it's just messing the gun up. I'm pretty sure it has to be done like 'class player : Mode_FullAuto' but the inheritance is screwed up: http://pastebin.com/taxgU0wC

 

Here are the modes that the gun inherits from CannonCore: modes[]={"player","close","short","medium","far"};

 

Hell, here's the mod itself if you want to take a closer look: https://www.dropbox.com/s/c1rx2op3np2bnv2/%4020AIB_Warrior.7z?dl=0

Share this post


Link to post
Share on other sites

I'll take a look at it later today. What I gathered from last night is that the 30mm_autocannon does not have the mode_fullauto classes in it at all so that is where the inheritance fails. 

in any firemode class theres a variable "onlyforplayer" or something like that defines if the mode is for player or AI use and I think you have to change the reload time in the firemode class itself. I'll check it out more throughout when I get the chance!

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×