So, uhm... yeah.
I created a new weapon per the Basic Guide (made it in unique_items, etc.), and it works. Perfectly.
However, I tried to make it come with a non-detachable grenade launcher by adding the line "grenade_launcher_status = 1", but then I get a fata error as follows:
FATAL ERROR [error]Expression : fatal error [error]Function : CInifile::r_string [error]File : D:\xray-svn\xrCore\Xr_ini.cpp [error]Line : 351 [error]Description : [error]Arguments : Can't find variable grenade_vel in [wpn_cqcar24_m1]
Now, I checked through the other unique items. It seems that the Storming Obokan (or whatever; it's the unique Abakan that has a grenade launcher) has the "grenade_launcher_status = 1" line, but it also has "grenade_vel = 76".
So, does anyone have a clue as to how to add a non-detachable grenade launcher to a unique item? I'm guessing that "grenade_vel" means "grenade velocity", but I don't wanna screw things up by adding an incorrect value based on a guess.
Any help would be appreciated.
Well...It doesn't have a nade launcher...
Uh, yeah it does. You can change the .ltx file to allow it to attach a grenade launcher (my current version of my custom weapon has a removable 'nade launcher). What I want to do is make it so that the 'nade launcher isn't removable (i.e., set "grenade_launcher_status" to 1 and have it work), but apparently I also need to add the "grenade_vel" line, but I dunno what what values mean what.
In fact, if you take a look at some of the weapon mods, all the assault rifles in the game, except for the AK74U, can mount scopes, silencers, and grenade launchers if you tweak their .ltx files. The AK74U can't have a grenade launcher because there's no model/texture of it with one.
My guess would be to look at a Unique weapon with the same Grenade Launcher your trying to attach to the L86 (IE: The M209, find another gun that has the M209 perm-a-fixed) and copy the values over.
Just try it out, it isn't working now, what are the chances testing a fix would make it work less?
Thing is, I can't find any other weapons that use the M203 'nade launcher. Like I said, the "Storming" Obokan uses a GL, but I dunno if the values translate to the same thing.
Best thing to do is to post the text of the modified weapon like I did in the tutorials so people can try it out themselves. It's all well and good to theoretically talk about it, but if we can't play with it, we can't do much about it =D You may have left out a line or two.
To be honest, a quick check at the weapon add-ons shows the russian one to have a grenade_vel = 76, and the M209's grenade_vel = 71 by default. Most files don't change this number, since the grenade itself should determine the firing speed, not the launcher :P But if you make a launcher status = 1, then you'll need to add in the velocity, simply because the base file doesn't have it, and you're not using the add-on's properties.
Cool beans. I tried 76, and it works, but I haven't a chance to test-fire. I'll change it to 71, that's probably for the best.
Oddly, when I made the grenade launcher a default weapon, the inventory image didn't change... even when I changed the gun itself (it was an L85, but now it's an LR-300). I tried creating a new game to see if that would fix the problem, but no cigar. Any ideas?
Oh, and another thing I've noticed is that, since I've converted my L85 into an LR300, I now have head-bob while using iron sights, but only for my modded gun, not for any other weapons (at least, not for the Abakan and the AK74). Any clues on how I did that? It'd be nifty to implement in a realism mod.
And here's the gun:
unique_items.ltx: [wpn_cqcar24_m1]:wpn_lr300 ;Ñáàëàíñèðîâàííàÿ L85 $spawn = "weapons\wpn_lr-300" description = enc_weapons1_wpn-cqcar24_m1 inv_name = wpn-cqcar24_m1 inv_name_short = wpn-cqcar24_m1 ammo_mag_size = 50 fire_modes = 1, 3, -1 cam_dispersion = 0.05 cam_dispersion_inc = 0.1 condition_shot_dec = 0.00000 misfire_probability = 0.00 hit_power = 0.85, 0.90, 0.95, 1.00 fire_distance = 600 bullet_speed = 600 grenade_launcher_status = 1 grenade_vel = 71 silencer_hit_power = 0.93 silencer_bullet_speed = 600 inv_grid_x = 5 inv_grid_y = 25 fire_dispersion_base = 0.005 cam_relax_speed = 0.65 cam_dispersion = 0.002 cam_dispersion_inc = 0.0005 cam_dispertion_frac = 0.004 cam_max_angle = 0.06 cam_max_angle_horz = 0.09 cam_step_angle_horz = 0.005
string_table_enc_weapons.xml: This fearsome looking pistol is of unknown origin; the only indicator to what it should be called is marked by an engraving on the slide, saying "Adjudicator". From the looks of it, this pistol is very powerful, and the threaded muzzle allows for a suppressor. Not a weapon to be on the recieving end of.\n Ammunition:\n Standard 9x19mm FMJ\n Improved 9x19mm PB1s CQCAR 24 Mod 3
And I won't bore you with details on how to add to traders.
You didn't tell it to use a different Inventory image, in the code file, there is something like this (SPAS12 example) inv_grid_width = 6 inv_grid_height = 1 inv_grid_x = 12 inv_grid_y = 2 The inv_grid X and Y determine the image used in invetory, if you go back and read Niphty's tutorial, it will explain that. Even so, the L85 was never naturally able to equip the GL in game, so the image for it probably doesn't exist.
as for the view bob, not a clue how to fix that.
I don't need to use a different inventory image, do I? I just change the main weapon reference from wpn_l85 to wpn_lr300; as long as I don't change the inv_grid values in my unique item, it shouldn't affect the image used.
Also, the L85 can naturally equip a grenade launcher. Inventory images are just over-layed; models and textures of every weapon with grenade launcher/silencer/scopes (where appropriate) exist, except for the AK74U, I believe. All you have to do is edit a couple of values in the individual weapon files (why the devs set the values to "0;2", I'll never know).
Final Warrior;3616146Also, the L85 can naturally equip a grenade launcher.
I've NEVER been able to put either the 25mm or the 40mm on it.
As for the image, iunno. I can't even get the bartender to sell my weapon, and before that had to mess up a file just so the game would start, but now it ignores it all together.