Jump to content

Scripting


ecksile

Recommended Posts

Ok well I'm just about finished with a multiple ammo type script based off of balors ammo type script. Found here http://fallout3nexus.com/downloads/file.php?id=1446

 

 

I have 3 questions.

 

1. In his original script, the script only runs once. When the game is first loaded. If you die or load a save from in game,It breaks the script and the script wont activate anymore. How can i fix this?

 

2. The script uses menus only activated from with in your inventory. In his original script if you only had one kind of ammo in your inventory, but your weapon was still in the mode to use another ammo. For example you last used armor piercing ammo but had none left and wanted to change to normal ammo. When you equipped the gun it just automatically equipped the only ammo you had in your inventory it didn't display the menu to choose the ammo. But with my edited version which i made work with more ammo types per weapon (his only uses 2 ammo types mine is made to use 3 or more), Its not automatic and asks you if you want to change your ammo even if you only have 1 ammo type in you inventory rather then just automatically switching to it.How would i fix this?

 

3. Lastly If I wanted to hotkey an ammo change from in real time With out Bringing up a menu but showing a message to what ammo type has been toggled. For example your in a fire fight you press x and change ammo to Armor piercing from normal ammo. Also i would like to add an animation for reload when hotkey is pressed even if your gun is full. I would also like to make it automatically switch ammo when you run out of another type. I know I would need FOSE. How would i go about doing this?

 

Here is his script. Primary ammo script.

---------------------------------------------------------------------------------------------------------------

 

scn BalorWeaponTypeChangerToNormal

float weaponCondition
short needequip
short button

begin OnEquip
if menumode
	if player.GetItemCount Ammo10mm >= 1 && player.GetItemCount Ammo10mmAP >= 1 
		set needequip to 1
		ShowMessage Balor10mmWeaponSelectionMSG
	elseif player.GetItemCount Ammo10mm >= 1
			set weaponCondition to player.GetWeaponHealthPerc / 100
;			ShowMessage BalorTestMSG weaponCondition 
			player.AddItemHealthPercent Weap10mmPistol 1 weaponCondition 1
			player.EquipItem Weap10mmPistol 0 1
			removeme
	endif
endif
end


Begin MenuMode
if needequip
	set Button to GetButtonPressed
	if ( Button == 2 )
		set needequip to 0
	elseif ( Button == 1 )
		set needequip to 0
		set weaponCondition to player.GetWeaponHealthPerc / 100
;			ShowMessage BalorTestMSG weaponCondition 
		player.AddItemHealthPercent Weap10mmPistol 1 weaponCondition 1
		player.EquipItem Weap10mmPistol 0 1
		removeme
	endif
endif
end

 

---------------------------------------------------------------------------------------------------------------

This is his secondary ammo script.

---------------------------------------------------------------------------------------------------------------

 

scn BalorWeaponTypeChangerToAP

float weaponCondition
short needequip
short button

begin OnEquip
if menumode
	if player.GetItemCount Ammo10mm >= 1 && player.GetItemCount Ammo10mmAP >= 1 
		set needequip to 1
		ShowMessage Balor10mmWeaponSelectionMSG
	elseif player.GetItemCount Ammo10mmAP >= 1
			set weaponCondition to player.GetWeaponHealthPerc / 100
;			ShowMessage BalorTestMSG weaponCondition 
			player.AddItemHealthPercent WeapBalor10mmPistolAP 1 weaponCondition 1
			player.EquipItem WeapBalor10mmPistolAP 0 1
			removeme
	endif
endif
end

Begin MenuMode
if needequip
	set Button to GetButtonPressed
	if ( Button == 1 )
		set needequip to 0
	elseif ( Button == 2 )
		set needequip to 0
		set weaponCondition to player.GetWeaponHealthPerc / 100
;			ShowMessage BalorTestMSG weaponCondition 
		player.AddItemHealthPercent WeapBalor10mmPistolAP 1 weaponCondition 1
		player.EquipItem WeapBalor10mmPistolAP 0 1
		removeme
	endif
endif
end

Link to comment
Share on other sites

  • Recently Browsing   0 members

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