Jump to content

Magazine extender script


GOLDENTRIANGLES

Recommended Posts

I need some help for anyone that has the FO3 GECK currently installed.

I have already gotten permission from the author to use the script in there mod that is linked below and I would like to re-purpose it for my own weapons that I am making.

This would be very helpful since the GECK's limit for a magazine size is 256 rounds.

 

http://www.nexusmods.com/fallout3/mods/12375/?

 

I don't have fallout 3 or the GECK so I would like someone to extract the script for me so I can use it for some laser weapons I am making.

Link to comment
Share on other sites

BeltFedMinigunQuestScript;

 

 

 

scn BeltFedMinigunQuestScript

float Timer

begin GameMode

if player.isininterior == 0
if Timer > 5
player.additem MinigunToken 1
stopquest MinigunQuest
else
set Timer to (Timer + getsecondspassed)
endif
endif

end

 

 

BeltFedMinigunScript;

 

 

 

scn	BeltFedMinigunScript

short		Firing
short		Loaded
short		Init
short		Button
short		CanReload
short		AwaitingAmmo
short		WaitReply

long		Magazine
long		MagSize

float		FireTime
float		FireDelay
float		DelayTime
float		DisplayTimer
float		ReloadTimer

ref			GunType
ref			AmmoType


begin OnAdd player

	set DelayTime to 0.9
	set MagSize to 450
	set Guntype to 0
	set Ammotype to 0

end

begin OnEquip player
	
	showmessage MagSelectMessage
	set WaitReply to 1
	player.unequipitem MinigunToken 0 1

end

begin MenuMode

	if WaitReply == 1

		set Button to getbuttonpressed

		if Button == 0
			set MagSize to 250
		elseif Button == 1
			set MagSize to 350
		elseif Button == 2
			set MagSize to 450
		elseif Button == 3
			set MagSize to 550
		elseif Button == 4
			set MagSize to 650
		elseif Button == 5
			set MagSize to 1000
		endif

		if Button != -1
			set Init to 1
			set Magazine to Magazine - 1
			player.additem AmmoType Magazine 1
			set Magazine to 0
			set Loaded to 0
			set WaitReply to 0
		endif

	endif

end

begin GameMode

	if player.isweaponinlist MinigunList

		disablecontrol 12
		
		if player.getequippedobject 5 != Guntype
			set GunType to player.getequippedobject 5
			set AmmoType to player.getweaponammo GunType
			player.additem AmmoType Magazine 1
			set Magazine to 0 
			set Loaded to 0
			set Init to 1
		endif

		if player.getitemcount AmmoType > 20
			set CanReload to 1
		else
			set CanReload to 0
		endif

		if Magazine == 1 && CanReload == 1
			setweaponammouse 1 GunType
			holdkey 256
		else
			setweaponammouse 0 GunType
		endif

		if Magazine == 0 && Init == 0
			set Loaded to 0
			set Firing to 0
			set FireDelay to 0
			set FireTime to 0
			releasekey 256
			disablekey 256
			if CanReload == 1
				set ReloadTimer to 6
				playsound DRSVaultGearOpenSteam01
			endif
		endif

		if ReloadTimer > 0
			set ReloadTimer to (ReloadTimer - getsecondspassed)
		elseif ReloadTimer <= 0 && Magazine > 0
			enablekey 256 
		endif
		
		if Loaded == 0
			set Init to 0
			set Loaded to 1
			if player.getitemcount AmmoType > Magsize
				set Magazine to Magsize - 1
				player.removeitem AmmoType Magazine 1
				set Magazine to Magsize
				if AwaitingAmmo == 1
					set AwaitingAmmo to 0
					player.removeitem AmmoType 1 1
				endif
			elseif CanReload == 0
				set AwaitingAmmo to 1
				set Init to 1
				set Loaded to 0
				disablekey 256
			else
				set Magazine to (player.getitemcount AmmoType) -1
				player.removeitem AmmoType Magazine 1
				set Magazine to Magazine + 1
				if AwaitingAmmo == 1
					set AwaitingAmmo to 0
					set Magazine to Magazine - 1
				endif
			endif			
		endif

		if iskeypressed 256 && ReloadTimer <= 0
			set Firing to 1
			if FireDelay < DelayTime
				set FireDelay to (FireDelay + getsecondspassed)
			elseif FireDelay > DelayTime
				set Firetime to (FireTime + getsecondspassed)
				if FireTime >= 0.047 && Magazine > 0
					set FireTime to 0
					set Magazine to (Magazine - 1)
				endif
			endif
		elseif Firing == 1
			set Firing to 0
			set FireDelay to 0
			set FireTime to 0
		endif


		if iskeypressed 257 == 1 
			if DisplayTimer <= 0
				if AwaitingAmmo == 1 && Magazine == 0
					showmessage AmmoWaitMessage Magazine MagSize
				else
					showmessage AmmoCountMessage Magazine MagSize
				endif
				set DisplayTimer to 2
			elseif DisplayTimer > 0
				set DisplayTimer to (DisplayTimer - getsecondspassed)
			endif
		else
			set DisplayTimer to 0
		endif
	
	elseif Loaded == 1
		set Magazine to Magazine - 1
		player.additem AmmoType Magazine 1
		set Magazine to 0
		set Loaded to 0
		enablecontrol 12
		set GunType to 0
	elseif AwaitingAmmo == 1
		enablekey 256
		set AwaitingAmmo to 0
	endif

end


 

Link to comment
Share on other sites

BeltFedMinigunQuestScript;

 

 

 

scn BeltFedMinigunQuestScript

float Timer

begin GameMode

if player.isininterior == 0
if Timer > 5
player.additem MinigunToken 1
stopquest MinigunQuest
else
set Timer to (Timer + getsecondspassed)
endif
endif

end

 

 

BeltFedMinigunScript;

 

 

 

scn	BeltFedMinigunScript

short		Firing
short		Loaded
short		Init
short		Button
short		CanReload
short		AwaitingAmmo
short		WaitReply

long		Magazine
long		MagSize

float		FireTime
float		FireDelay
float		DelayTime
float		DisplayTimer
float		ReloadTimer

ref			GunType
ref			AmmoType


begin OnAdd player

	set DelayTime to 0.9
	set MagSize to 450
	set Guntype to 0
	set Ammotype to 0

end

begin OnEquip player
	
	showmessage MagSelectMessage
	set WaitReply to 1
	player.unequipitem MinigunToken 0 1

end

begin MenuMode

	if WaitReply == 1

		set Button to getbuttonpressed

		if Button == 0
			set MagSize to 250
		elseif Button == 1
			set MagSize to 350
		elseif Button == 2
			set MagSize to 450
		elseif Button == 3
			set MagSize to 550
		elseif Button == 4
			set MagSize to 650
		elseif Button == 5
			set MagSize to 1000
		endif

		if Button != -1
			set Init to 1
			set Magazine to Magazine - 1
			player.additem AmmoType Magazine 1
			set Magazine to 0
			set Loaded to 0
			set WaitReply to 0
		endif

	endif

end

begin GameMode

	if player.isweaponinlist MinigunList

		disablecontrol 12
		
		if player.getequippedobject 5 != Guntype
			set GunType to player.getequippedobject 5
			set AmmoType to player.getweaponammo GunType
			player.additem AmmoType Magazine 1
			set Magazine to 0 
			set Loaded to 0
			set Init to 1
		endif

		if player.getitemcount AmmoType > 20
			set CanReload to 1
		else
			set CanReload to 0
		endif

		if Magazine == 1 && CanReload == 1
			setweaponammouse 1 GunType
			holdkey 256
		else
			setweaponammouse 0 GunType
		endif

		if Magazine == 0 && Init == 0
			set Loaded to 0
			set Firing to 0
			set FireDelay to 0
			set FireTime to 0
			releasekey 256
			disablekey 256
			if CanReload == 1
				set ReloadTimer to 6
				playsound DRSVaultGearOpenSteam01
			endif
		endif

		if ReloadTimer > 0
			set ReloadTimer to (ReloadTimer - getsecondspassed)
		elseif ReloadTimer <= 0 && Magazine > 0
			enablekey 256 
		endif
		
		if Loaded == 0
			set Init to 0
			set Loaded to 1
			if player.getitemcount AmmoType > Magsize
				set Magazine to Magsize - 1
				player.removeitem AmmoType Magazine 1
				set Magazine to Magsize
				if AwaitingAmmo == 1
					set AwaitingAmmo to 0
					player.removeitem AmmoType 1 1
				endif
			elseif CanReload == 0
				set AwaitingAmmo to 1
				set Init to 1
				set Loaded to 0
				disablekey 256
			else
				set Magazine to (player.getitemcount AmmoType) -1
				player.removeitem AmmoType Magazine 1
				set Magazine to Magazine + 1
				if AwaitingAmmo == 1
					set AwaitingAmmo to 0
					set Magazine to Magazine - 1
				endif
			endif			
		endif

		if iskeypressed 256 && ReloadTimer <= 0
			set Firing to 1
			if FireDelay < DelayTime
				set FireDelay to (FireDelay + getsecondspassed)
			elseif FireDelay > DelayTime
				set Firetime to (FireTime + getsecondspassed)
				if FireTime >= 0.047 && Magazine > 0
					set FireTime to 0
					set Magazine to (Magazine - 1)
				endif
			endif
		elseif Firing == 1
			set Firing to 0
			set FireDelay to 0
			set FireTime to 0
		endif


		if iskeypressed 257 == 1 
			if DisplayTimer <= 0
				if AwaitingAmmo == 1 && Magazine == 0
					showmessage AmmoWaitMessage Magazine MagSize
				else
					showmessage AmmoCountMessage Magazine MagSize
				endif
				set DisplayTimer to 2
			elseif DisplayTimer > 0
				set DisplayTimer to (DisplayTimer - getsecondspassed)
			endif
		else
			set DisplayTimer to 0
		endif
	
	elseif Loaded == 1
		set Magazine to Magazine - 1
		player.additem AmmoType Magazine 1
		set Magazine to 0
		set Loaded to 0
		enablecontrol 12
		set GunType to 0
	elseif AwaitingAmmo == 1
		enablekey 256
		set AwaitingAmmo to 0
	endif

end


 

So which one do I use? Or is there a way to run two scripts at once on one weapon? Sorry I'm new to modding.

Link to comment
Share on other sites

So which one do I use? Or is there a way to run two scripts at once on one weapon? Sorry I'm new to modding.

BeltFedMinigunQuestScript is used to add the token (which is used in BeltFedMinigunScript), it's not a object script to be used on a weapon, it's a quest script and independent of the weapon form. The heavy lifting (pretty much everything) is in BeltFedMinigunScript. If you haven't been scripting this is *not* a project to cut your teeth on. On the other hand if you were just doing a port instead of a custom application for your own weapons then it wouldn't be a task. I guess it depends on how much your altering to fit your weapons.

 

If your going to be messing around with the code you should probably hit up some scripting tutorials.

Link to comment
Share on other sites

BeltFedMinigunQuestScript is used to add the token (which is used in BeltFedMinigunScript), it's not a object script to be used on a weapon, it's a quest script and independent of the weapon form. The heavy lifting (pretty much everything) is in BeltFedMinigunScript. If you haven't been scripting this is *not* a project to cut your teeth on. On the other hand if you were just doing a port instead of a custom application for your own weapons then it wouldn't be a task. I guess it depends on how much your altering to fit your weapons.

 

If your going to be messing around with the code you should probably hit up some scripting tutorials.

 

This is the mod that I am working on.

http://www.nexusmods.com/newvegas/mods/60738/?

 

I am currently stuck on trying to make the clip size larger than the engine limit of 256.

I would like to make

  • The pistol to have a 175 rounds
  • The rifle to have 200 rounds
  • The rifle x2 voltage to have 200 rounds
  • The rifle x2 current to have 400 rounds

The first three are not a problem since it's under 256 rounds. However the x2 current laser rifle has a clip-size greater than 256 and that is what I am stuck on.

If there is a simpler way to make this happen than the script listed above then I am more than happy to get some help. And of course I'll list your name in the credits.

Link to comment
Share on other sites

If there is a simpler way to make this happen than the script listed above then I am more than happy to get some help. And of course I'll list your name in the credits.

I'm really not a good candidate, as scripting isn't my strong suite (in face I may not even have a strong suite, but if I do it's *definitely* not scripting).

Link to comment
Share on other sites

  • Recently Browsing   0 members

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