Jump to content

I need some help with fixing buckshots/slugs


CabooseNor

Recommended Posts

The current implementation of shotgun buckshots and slugs is poor. Currently, if you use slugs, your weapon will sway less (not spread). And if you use buckshots, your weapon sways more. This is a really poor way of simulating slugs and buckshots.

 

I'm trying to make it so that slugs have higher accuracy and range, and buckshots have higher damage, but higher spread (not sway) and shorter range. Range is a parameter in projectiles and I think I got that one down.

 

But does anyone know how to use the command "setWeaponMinSpread" (MinSpread is the value that determines a buckshot's cone of fire) to apply only to a certain type of ammo? This is the way I have to do it with the current game system. Setting MinSpread higher on a weapon with buckshots equipped makes them spread out like a real shotgun shell does. (I also increase the number of projectiles from 7 pellets to 20, so that it becomes more consistent.) But in doing so, I f*** up the slugs' accuracy. Now they also spread out, but since slugs only have 1 projectile, they become very inaccurate. So I would like to be able to set the spread of the shotgun depending on what ammo I have loaded - slugs or buckshots.

 

Can I use the command "setWeaponMinSpread" in a script? Is this the best way? Is there an easier way already implemented in GECK? I'm a relatively new modder, but I've learned a lot about the GECK so far. But I'm not proficient at scripting yet.

 

Can anyone help me?

Edited by CabooseNor
Link to comment
Share on other sites

Nope, sorry, but that's the sway effect. It's called "Spread", but it really is sway (i.e. your weapon wobbles around). "MinSpread" is the real factor for spread. If you read my first post you would see that I already mentioned this.

 

EDIT: My current workaround for the issue is to have certain shotguns only allow slugs and certain shotguns only allow buckshots. Then give the Slug shotguns low MinSpread and the Buckshot shotguns higher damage (I use the higher spread shotguns for this)

 

This is really not a good or permanent solution, but it works better than the current slug/buckshot system. I would love if I could do this with only changing ammo types instead.

Edited by CabooseNor
Link to comment
Share on other sites

You might try something like this:


REF rCurrentAmmo

BEGIN Gamemode

IF rCurrentAmmo != GetPlayerCurrentAmmo
	Set rCurrentAmmo to GetPlayerCurrentAmmo
	IF rCurrentAmmo == Ammo12Ga
     	setWeaponMinSpread to 3
	ElseIF rCurrentAmmo == Ammo12GaSlug
     	setWeaponMinSpread to 1
	EndIF
EndIF

Link to comment
Share on other sites

Oh man, that sure put me on the right track. Thank so much, Earache.

 

Here is my working script. Maybe I should upload it as a module:

 

scn 0ShotgunFix

REF rCurrentAmmo
FLOAT fCurrentMinSpread
FLOAT fNewMinSpread

BEGIN Gamemode

   set fCurrentMinSpread to GetWeaponMinSpread

       IF rCurrentAmmo != GetPlayerCurrentAmmo

               set rCurrentAmmo to GetPlayerCurrentAmmo

               IF rCurrentAmmo == Ammo20GaSlug
		set fNewMinSpread to (fCurrentMinSpread * 0.1)
               	setWeaponMinSpread fNewMinSpread
               ElseIF rCurrentAmmo == Ammo12GaSlug
		set fNewMinSpread to (fCurrentMinSpread * 0.1)
               	setWeaponMinSpread fNewMinSpread
	ElseIF fCurrentMinSpread < 1
		set fNewMinSpread to (fCurrentMinSpread * 10)
               	setWeaponMinSpread fNewMinSpread
               EndIF

       EndIF

END

 

Then I just apply that script to every shotgun in the game.

 

Just one last thing from you more experienced scripters:

Can I clean up that code a bit? I.e. not repeat the phrase "setWeaponMinSpread fNewMinSpread"? Otherwise look good? It works, so, I thoroughly tested it with higher spread values to verify. It's my first script.

 

Oh, and do I need the line "ElseIF fCurrentMinSpread < 1"? (It works because all shotguns have more than 1 and less than 10 default MinSpread.)

Edited by CabooseNor
Link to comment
Share on other sites

No problem. Great idea. Would you mind if I do something similar with my mod? I already use a Spas-12 riot gun that switches from semi-auto firing mode to pump when you chamber a low pressure load like a beanbag, so this would slot in nicely.

 

Regarding your draft script, the first ElseIF is redundant and can be removed. Since shotgun barrels are not rifled, I don't think a tenfold decrease in spread is realistic. Lastly, as you must attach the script to each weapon in GECK, I don't see the advantage in using a generic algorithm rather than make a specific script for each shotty. That way you can fine tune the effect (more pronounced on the hunting shotgun than the sawed-off) and can get rid of the math and extra variables in favor of hard-coded values. You will also be able to wrap your logic in an " is weapon equipped" check which will limit execution to when you are holding the gun and reset to default values when you unequip.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...