Jump to content

AP as ammo


MrProfessorSir

Recommended Posts

Depending on the weapon's type, attach one of the below scripts to the weapon (note that both require NVSE):

 

If a ranged weapon (set the weapon's Ammo Use to 0):

short	bEquipped

begin OnEquip player

	set bEquipped to 1

end

begin OnUnequip

	set bEquipped to 0
	if IsControlDisabled 4
		EnableControl 4
	endif

end

begin GameMode

	if bEquipped
		if IsControlDisabled 4 != (player.IsWeaponOut && (player.GetAV ActionPoints < 15))
			if IsControlDisabled 4
				EnableControl 4
			else
				DisableControl 4
			endif
		endif
	endif

end

begin OnFire

	player.DamageAV ActionPoints 15

end

If a melee/unarmed weapon:

short	bEquipped
short	bIsAttacking

begin OnEquip player

	set bEquipped to 1

end

begin OnUnequip

	set bEquipped to 0
	if IsControlDisabled 4
		EnableControl 4
	endif

end

begin GameMode

	if bEquipped
		if IsControlDisabled 4 != (player.IsWeaponOut && (player.GetAV ActionPoints < 15))
			if IsControlDisabled 4
				EnableControl 4
			else
				DisableControl 4
			endif
		endif
		if bIsAttacking != (player.GetAnimAction == 2)
			set bIsAttacking to (bIsAttacking == 0)
			if bIsAttacking
				player.DamageAV ActionPoints 15
			endif
		endif
	endif

end

Both scripts are currently set to consume 15 AP with every attack. You can change that to whatever value you like.

Link to comment
Share on other sites

The first line of every script must be:

scn	[name of the script]

(I left out that line because I assumed you already knew that, and didn't want to name the script for you)

 

Second, you must launch the GECK via the NVSE loader, as described here (second paragraph under 'Installation').

Link to comment
Share on other sites

  • Recently Browsing   0 members

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