How to give weapons new firing modes? -1 reply

Please wait...

Servalion

I want to be like the Admins

50 XP

6th July 2008

0 Uploads

222 Posts

0 Threads

#1 11 years ago

This seemed pretty damned easy in SoC, but now its being odd.

Part of the mod I'm doing is to give a couple of the handguns a burst-fire/automatic option. My original goal was to do so through an upgrade option, but that wasn't responding.

See, on handguns, you don't even get a fire mode indicator on the screen. This is because handguns dont even have a "fire_modes" setting in their config files in CS. I added the "Fire_modes" setting with the desired fire types to the two handguns I wished to effect. I dont like the idea of giving these guns these extra fire modes to their base settings, but I thought it would fix it.

I was wrong. This got the fire mode indicator to show up on these guns in game, but despite 3 shot burst or automatic fire, the mode is stuck on "1" - single fire. The game won't switch off from it, either. Even if I only give a gun automatic fire only, it's still stuck at "1" in game and wont fire more than a single shot at once. I hope to god that this shit isnt hard-coded for some stupid reason, cause that would really screw up what is one of my favorite mod plans.

Can anyone assist? Really hoping for a solution here. Oh, and for the record, I'm putting in the settings to the handgun(s) as

"Fire_modes = 1, 3, -1" Single fire, 3 shot burst, & full automatic, respectively.

This is how it was in SoC, but has anything changed? I await the voices of others.




Jarvis

Dread pwns me!

50 XP

18th July 2006

0 Uploads

519 Posts

0 Threads

#2 11 years ago

Here's the auto pistol from ABC:

Spoiler: Show
[wpn_walther_speed]:wpn_walther $spawn = "weapons\walther" description = enc_weapons1_wpn-walther_speed inv_name = wpn-walther_speed inv_name_short = wpn-walther_speed ef_weapon_type = 6 ammo_mag_size = 17 ammo_class = ammo_9x19_fmj, ammo_9x19_pbp rpm = 1100 cost = 4000 weapon_class = assault_rifle inv_weight = 1.2; .7 inv_grid_x = 11 inv_grid_y = 21 class = WP_LR300 cam_relax_speed = 5.0 cam_dispersion = 0.7 cam_dispersion_inc = 0.4 cam_dispertion_frac = 0.7 cam_max_angle = 11.0 cam_max_angle_horz = 4.0 cam_step_angle_horz = 0.5 hit_power = 0.32, 0.35, 0.38, 0.41 silencer_hit_power = 0.32 hit_impulse = 120 silencer_hit_impulse = 100 hit_type = fire_wound fire_modes = 1, 2, 3, -1 silencer_status = 2 inv_grid_x = 11 inv_grid_y = 21 control_inertion_factor = 1.1f

Try changing those 3 lines, that might make it work.




blaktek

I don't spend enough time here

50 XP

23rd September 2008

0 Uploads

21 Posts

0 Threads

#3 11 years ago

Jarvis is right, it works with these changes. I saw one problem with automatic handguns : the NPCs wearing them tend to use it as their main weapon.

Hum, now that i think about it, I did set the auto fire mode in first position in the file. Need to go check this, now.




Jarvis

Dread pwns me!

50 XP

18th July 2006

0 Uploads

519 Posts

0 Threads

#4 11 years ago

Ahh, glad to know it works :nodding:

NPCs probably prefer them because they are now classed as assault rifles, and NPCs always pick them over shotguns or pistols if given the choice.




Servalion

I want to be like the Admins

50 XP

6th July 2008

0 Uploads

222 Posts

0 Threads

#5 11 years ago

I was thinking of doing exactly this last night, actually. I was too tired though, so I went to bed instead. Good to know I can come back to a confirmation, thanx.

You're probably right about the preference, though. I'll test them out, see how it goes. On the other hand, since they'd likely be carrying Assault Rifles anyways, one would hope they wouldn't make the switch.

(Bandits, however, might)

First off, gonna try "WP_AK74" a try, so they won't at least use these over NATO rifles.

(notices that MP5s are classified as "WP_LR300", where as actual LR 300s are classified as "WP_AK74") (swaps the values between the two)

Hmm, hopefully this will solve some wonky gun preferences on the NPCs.




Servalion

I want to be like the Admins

50 XP

6th July 2008

0 Uploads

222 Posts

0 Threads

#6 11 years ago

Well, "WP_AK74" doesn't work on handguns for some reason. The game CTDs, citing some "launch" variable that it can't find. LR_300 works just fine, though.

Aaaaand done! Both guns work great! Better yet, the extra fire modes through upgrades work as well. Now all I have to do is adjust the recoil on each, and I can move on to other guns. Thx a bunch guys. I hope to show everyone what I've come up with soon.




Servalion

I want to be like the Admins

50 XP

6th July 2008

0 Uploads

222 Posts

0 Threads

#7 11 years ago

Ok, all Handguns, Shotguns & MP5s are finished. There were quite a few issues that got in the way, but thanks to a lot of modding here and there, I was able to figure out what the problems were without asking others again, heh.

Now on to the meat of the weapons. I gotta get creative here, starting to run out of ideas....