Jump to content

Change firemode ingame (Full auto <-> Semi auto)


ferkel

Recommended Posts

Hey,

 

I actually love all those assault rifles in the game (and most of the added ones) and I'm allways tempted to use them. To bad they are so horribly inaccurate. This is more or less realistic, as they fire in full auto, but I don't want to use them in full auto all the time anyway. I don't simply want to change the firemode and reduce the spread etc with GECK, I would rather want to be able to change the firemode ingame for reduced spread, slightly increased damage and maybe even less action points for VATS. All this simply by pressing a key. And change everything back when pressing once more.

 

I wanted to do it on my own and found out that all this is or should be possible with FOSE, the commands needed should be

 

Get-/ SetWeaponIsAutomatic,

SetWeaponMinSpread

SetWeaponActionPoints

and SetAttackDamage.

 

This alone would alter the firemode of all weapontypes, therefore I would check if the weapon is either a TwoHandedAutomatic (GetWeaponType, 6 is 2HAuto) or is anyway on full auto, like the 10mm SMG or other custom made weapons. (It's probably easier by checking the weapontype as there might be problems when unequipping a SMG you set to semi auto, equip a different rifle and change the mode, reequip the smg and try to set it back to full auto. It may not be considered an automatic weapon anymore. Maybe setting the firemode back to full auto when unequipping the weapon would help here. Would be anoying though.)

 

And you need to bind a key to alter the firemode, of course. Shouldn't be too hard to do, but I don't know how it works. I did some basic modding for myself in Morrowind and know a little about scripting, but many things have changed since and I forgot most things. I also took a look at other mods that bind keys, but it never worked when I tried it on my own. And changing the firemode didn't work either, but I guess I simply failed in coding :whistling:

 

One more thing: If possible, make it compatible to "Weapon Mod Kits". :)

 

So would be nice if anyone could do this or just tell me how to do it on my own (or worst case scenario: tell me it's not possible at all).

 

If you think "Hey, that sounds very cool, I want this mod too!" it would be nice if you show your interest to encourage those who try to realize this idea. :thanks:

 

If a mod like this already exists, please give me a link, I didn't find anything similar (except all those mods that add semi automatic versions to the game etc)

 

 

ferkel

 

PS: I'm not a native english speaker, so if you can't understand what I mean, sry. I'll try to explain anything that is unclear.

Link to comment
Share on other sites

This isn't as simple as it looks. The problem is that you need to change the weapon animation as well (e.g. AttackLoop to AttackRight), and for some reason the FOSE function that is supposed to do that (SetWeaponAttackAnimation) doesn't work.

 

I've got a kludge/workaround I'll post later today.

Link to comment
Share on other sites

what about something similar to what that one guy did with the 50 cal sniper he made? he made it so that it was one gun that acted as 3 every time you equip it it asks if you want to use the normal one the bipod one or the silenced one if you take a look in the geck there was a gun of each version but you only needed one of them to use all 3 different ones

 

would this be a possible way to switch between automatic and semi auto and maybe even burst? on equip it will just ask you which one you want to use?

Link to comment
Share on other sites

@ sunici: I am currently working on a script, but I can't try if it really works cause I have problems binding a key... :( Would be cool if a nice person could tell me how to write such a script...

 

But SetWeaponAttackAnimation works fine if you use the console, why should it be broken in a script?

 

For now, my script looks like this:

 

SCN MakeItSemi

short wType						  ;weaponType
short fMode						;fireMode
short wDam						  ;weaponDamage, not used yet, but will be set to GetAttackDamage
short wAction						;will be used to change action points
short scripted						;used to determine wether the equipped weapon has a script or not
float wSpread						;will be used to change the weapons spread
ref wEquipped					;reference for equipped weapon
ref emptyscript					 ;checkscript


begin onequip player			 ;this is the key binding part (doesn't work)

showmessage MISSelectKey 

set MISSwitchKey to getkeypress 0			;MISSwitchkey is a global var (standard=0) gkp 0= the first key to be pressed (not sure)

if (MISSwitchKey != 0 && MISSwitchKey != 65535)				 ;if no key is pressed, gkp will return 65535

	showmessage MISSuccess

endif

end

begin GameMode

set wType to GetWeaponType
set fMode to GetWeaponIsAutomatic
set wDam to GetAttackDamage
set wAction to GetWeaponActionPoints
set wSpread to GetWeaponMinSpread
set wEquipped to player.GetEquippedObject 5
set scripted to wEquipped.isscripted
set emptyscript to MISmSwitched

if (GetKeyPress MISSwitchKey)

if (wType == 6 && fMode == 1 && scripted == 0)			  ;only automatic, non-scripted weapons should be affected
	wEquipped.SetScript emptyscript
	wEquipped.SetWeaponIsAutomatic 0
	wEquipped.SetWeaponAttackAnimation 9
	
elseif (wType == 3 && fMode == 1 && scripted == 0)	
	wEquipped.SetScript emptyscript
	wEquipped.SetWeaponIsAutomatic 0
	wEquipped.SetWeaponAttackAnimation 9
	
elseif (wType == 7 && fMode == 1 && scripted == 0)
	wEquipped.SetScript emptyscript
	wEquipped.SetWeaponIsAutomatic 0
	wEquipped.SetWeaponAttackAnimation 9
	
elseif (wType == 4 && fMode == 1 && scripted == 0)
	wEquipped.SetScript emptyscript
	wEquipped.SetWeaponIsAutomatic 0
	wEquipped.SetWeaponAttackAnimation 9

elseif (wType == 6 && fMode == 0 && wEquipped.GetScript == emptyscript)		 ;only non-automatic, scripted weapons should be affected
	wEquipped.removeScript emptyscript
	wEquipped.SetWeaponIsAutomatic 1
	wEquipped.SetWeaponAttackAnimation 8
	
elseif (wType == 3 && fMode == 0 && wEquipped.GetScript == emptyscript)	
	wEquipped.removeScript emptyscript
	wEquipped.SetWeaponIsAutomatic 1
	wEquipped.SetWeaponAttackAnimation 8
	
elseif (wType == 7 && fMode == 0 && wEquipped.GetScript == emptyscript)
	wEquipped.removeScript emptyscript
	wEquipped.SetWeaponIsAutomatic 1
	wEquipped.SetWeaponAttackAnimation 8
	
elseif (wType == 4 && fMode == 0 && wEquipped.GetScript == emptyscript)
	wEquipped.removeScript emptyscript
	wEquipped.SetWeaponIsAutomatic 1
	wEquipped.SetWeaponAttackAnimation 8
else
	return

endif

endif

end

(Nobody is allowed to copy and/or use this script or parts of it except for helping me with this mod. This is my intellectual property and I don't want anybody to steal it and use it for own purposes)

 

The bindig part is probably completely wrong...but just take a look and tell me whats wrong with this...as I said, I have no idea how scripting works in F3...but this is as far as I got...

 

@ kyosuke1000: Hmm, good idea, but it's not really what I intended. The great advantage of a script (like mine should be) is that it works with all weapons (for added ones too) and you wouldn't have to create 3 versions of all assault rifles/SMGs and add scripts to all of them. Would probably be illegal too, as I'm not allowed to change other's mods...for personal use would be okay, but it's too much work anyway...

 

Thanks for helping :)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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