Jump to content

gun-to-blade script debugging, have a look people ;)


Nightterror5

Recommended Posts

Could anyone hlep me to get this script to work?

So far nothign is happening ingame :(

The script is well commented, the desription what is supposed to happen is right at the beginning

 

;this script goes on both the 01FBrotherguard Pistol and the 01FBrotherguard Melee Weapon.

;It is switching the Brotherguard to "blade mode" (1HandMelee type) if the "BaldeAmmo" is equiped or to shoot mode if it is unequiped.

 

;On Equip of the "01FBrotherguardBladeAmmo" you get the "01FBrotherguardMelee" and the "01FBrotherguard" is removed.

;On UnEquip of the "01FBrotherguardBladeAmmo" the "01FBrotherguardMelee" is removed and you get the "01FBrotherguard" back.

;The Weapons healt is stored in a global, so you don't get a free repair

;You get the "01FBrotherguardBladeAmmo" as soon as you have one of the Brotherguards

 

 

Since there are balrely any modders in the chat I'd like to place this question here

EDIT: the syntax highligting down there is screwed! Paste the code to http://www.cipscis.com/fallout/utilities/validator.aspx

scn 01FBrotherguardSwitchtoMelee
;script type: Object
;this script goes on both the 01FBrotherguard Pistol and the 01FBrotherguard Melee Weapon.
;It is switching the Brotherguard to "blade mode" (1HandMelee type) if the "BaldeAmmo" is equiped or to shoot mode if it is unequiped.

;On Equip of the "01FBrotherguardBladeAmmo" you get the "01FBrotherguardMelee" and the "01FBrotherguard" is removed.
;On UnEquip of the "01FBrotherguardBladeAmmo" the "01FBrotherguardMelee" is removed and you get the "01FBrotherguard" back.
;The Weapons healt is stored in a global, so you don't get a free repair
;You get the "01FBrotherguardBladeAmmo" as soon as you have one of the Brotherguards

;globals
;-aaaFBrotherguardHealth
;-aaaFBrotherguardInShootMode

Begin GameMode

;when player has a Brotherguard or BrotherguardMelee, give him "BaldeAmmo"
if (player.GetItemCount  01FBrotherguard == 1 || player.GetItemCount  01FBrotherguardMelee == 1)
	if (player.GetItemCount 01FBrotherguardBladeAmmo < 1)										;if player has no Bladeammo
		player.AddItem 01FBrotherguardBladeAmmo 1 1												;add a new blade ammo, hide the message
	endif
else
		player.RemoveItem 01FBrotherguardBladeAmmo 100 1										;if he does not have one anymore (droped/sold), remove the ammo
endif


; check if Brotherguard is equipped
if (player.GetEquipped 01FBrotherguard == 1 || player.GetEquipped 01FBrotherguardMelee == 1)

	set aaaFBrotherguardHealth to Player.GetWeaponHealthPerc				;store current health of brotherguard to global
 		
		;if bladeammo is equiped and balde is not jet used -> switch to blade
	;the if(Shootmode ==1) is Imprtant! If you woud just ask for the ammo, every frame you got that ammo equiped, you switch to the same weapon aggain.
	if (player.GetEquipped 01FBrotherguardBladeAmmo == 1 && aaaFBrotherguardInShootMode == 1) 
		player.AddItemHealthPercent 01FBrotherguardMelee 1 aaaFBrotherguardHealth 1	;1 brotherguardmelee added, with specific healt, message hidden
		player.equipitem 01FBrotherguardMelee 0 1													;equip brotherguardmelee, it is de-equipable, message hidden
		player.removeitem 01FBrotherguard 100 1														;all normal brothergards are removed, message hidden	
		set aaaFBrotherguardInShootMode to 0															;now in blade mode

	elseif (player.GetEquipped 01FBrotherguardBladeAmmo != 1 && aaaFBrotherguardInShootMode == 0)
		player.AddItemHealthPercent 01FBrotherguard 1 aaaFBrotherguardHealth 1			;1 brotherguard added, with specific healt, message hidden
		player.equipitem 01FBrotherguard 0 1															;equip brotherguard, it is de-equipable, message hidden
		player.removeitem 01FBrotherguardMelee 100 1												;all melee brothergards are removed, message hidden	
		set aaaFBrotherguardInShootMode to 1															;now in shoot mode
	

	;if something wierd happens and you are in blade mode while you don't have the "balde ammo equiped" these reset the global.
	elseif (player.GetEquipped 01FBrotherguardBladeAmmo == 1)
		set aaaFBrotherguardInShootMode to 0															;now in blade mode

	elseif (player.GetEquipped 01FBrotherguardBladeAmmo == 0)
		set aaaFBrotherguardInShootMode to 1															;now in shoot mode

	endif ;end of the switching ifs

endif ;end of check if any brotherguard is equiped

end ;end of GameMode

 

UNCOMMENTED VERSION

scn 01FBrotherguardSwitchtoMelee

Begin GameMode
if (player.GetItemCount  01FBrotherguard == 1 || player.GetItemCount  01FBrotherguardMelee == 1)
	if (player.GetItemCount 01FBrotherguardBladeAmmo < 1)
		player.AddItem 01FBrotherguardBladeAmmo 1 1
	endif
else
	player.RemoveItem 01FBrotherguardBladeAmmo 100 1
endif


if (player.GetEquipped 01FBrotherguard == 1 || player.GetEquipped 01FBrotherguardMelee == 1)

	set aaaFBrotherguardHealth to Player.GetWeaponHealthPerc
 		
		if (player.GetEquipped 01FBrotherguardBladeAmmo == 1 && aaaFBrotherguardInShootMode == 1) 
		player.AddItemHealthPercent 01FBrotherguardMelee 1 aaaFBrotherguardHealth 1
		player.equipitem 01FBrotherguardMelee 0 1
		player.removeitem 01FBrotherguard 100 1
		set aaaFBrotherguardInShootMode to 0

	elseif (player.GetEquipped 01FBrotherguardBladeAmmo != 1 && aaaFBrotherguardInShootMode == 0)
		player.AddItemHealthPercent 01FBrotherguard 1 aaaFBrotherguardHealth 1
		player.equipitem 01FBrotherguard 0 1
		player.removeitem 01FBrotherguardMelee 100 1	
		set aaaFBrotherguardInShootMode to 1
	
	elseif (player.GetEquipped 01FBrotherguardBladeAmmo == 1)
		set aaaFBrotherguardInShootMode to 0

	elseif (player.GetEquipped 01FBrotherguardBladeAmmo == 0)
		set aaaFBrotherguardInShootMode to 1

	endif

endif

end

 

My Gun, the Brotherguard:

http://fc00.deviantart.net/fs71/f/2010/028/7/3/Brotherguard_by_The_5.jpg

 

Pic of the gun in my old FO3 Mod:

http://fc09.deviantart.net/fs70/f/2010/029/0/f/The_Brotherguard_in_FAllout_3_by_The_5.jpg

Link to comment
Share on other sites

  • Recently Browsing   0 members

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