MrProfessorSir Posted December 19, 2013 Posted December 19, 2013 Hello everyone, I was wondering how I could make a weapon consume action points after or during use.
jazzisparis Posted December 19, 2013 Posted December 19, 2013 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.
MrProfessorSir Posted December 20, 2013 Author Posted December 20, 2013 They won't save. Idk what's wrong with the script, sorry. I just copied and pasted.
Gribbleshnibit8 Posted December 21, 2013 Posted December 21, 2013 Depending on the weapon's type, attach one of the below scripts to the weapon (note that both require NVSE): Did you heed that note? I'm guessing not. http://nvse.silverlock.org/
MrProfessorSir Posted December 21, 2013 Author Posted December 21, 2013 I have NVSE, but I've never used its scripts.
jazzisparis Posted December 21, 2013 Posted December 21, 2013 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').
MrProfessorSir Posted December 21, 2013 Author Posted December 21, 2013 I know how to name a script :P I just wasn't launching GECK from NVSE. I greatly appreciate your help, and will try this immediately
MrProfessorSir Posted December 21, 2013 Author Posted December 21, 2013 It worked thank you so much. Do you know what I'd add to the script in order to make the weapon unusable at less than the required ap?
jazzisparis Posted December 21, 2013 Posted December 21, 2013 The script already does that. It disables the attack control (thereby preventing the player from attacking) when there aren't enough AP.
MrProfessorSir Posted December 22, 2013 Author Posted December 22, 2013 I'm sorry, but that part doesn't seem to work :(
Recommended Posts