detecting armor weight?

Post » Tue May 17, 2011 9:51 am

is there a script way to detect if the armor the player is wearing is heavy or light, without the use of lists? I see it defined in the armor it's self, but if I want to make a weapon that detects if the armor is heavy or light, is there a good way to go about doing that? FOSE or otherwise?
User avatar
Taylah Illies
 
Posts: 3369
Joined: Fri Feb 09, 2007 7:13 am

Post » Tue May 17, 2011 1:54 am

I think the Heavy/Light option is only there because it was used in OB. I don't think it has any use in Fallout. Looking at the different armors, I haven't seen any that use "Heavy" anyways... even power armor is "Light."
User avatar
Zualett
 
Posts: 3567
Joined: Mon Aug 20, 2007 6:36 pm

Post » Tue May 17, 2011 2:38 am

You could (with FOSE) use http://fose.silverlock.org/fose_command_doc.html#GetEquippedObject + http://fose.silverlock.org/fose_command_doc.html#GetWeight, or (without FOSE) add all armors heavier than X to a formlist, or both if you use http://www.mediafire.com/?dgd3xyio0mv or some other method of FOSE detection. The FOSE code would work for all armors including new ones added by mods while the non-FOSE code would, at least, work for items available from the plugin's master(s) and *drug into that FLST.

*you can sort by weight in the GECK's object window then Shift+Click to save time

scn IsArmorHeavyQuestSCPTRef rArmorFloat fWeightThreshold;Short bIsArmorHeavyGLOB <--- Probably best if a global to be checked by the weapon(s)Begin GameMode 	If FOSE		Set rArmor to Player.GetEquippedObject 2 ; Upper body		If ((rArmor.GetWeight >= fWeightThreshold) != bIsArmorHeavyGLOB)			Set bIsArmorHeavyGLOB to (bIsArmorHeavyGLOB == 0)		EndIf	ElseIf (Player.GetEquipped HeavyArmorFLST != bIsArmorHeavyGLOB)		Set bIsArmorHeavyGLOB to (bIsArmorHeavyGLOB == 0)	EndIfEnd;========== Repeaed in MenuMode to catch the player changing sooner =========Begin MenuMode 1	If FOSE		Set rArmor to Player.GetEquippedObject 2 ; Upper body		If ((rArmor.GetWeight >= fWeightThreshold) != bIsArmorHeavyGLOB)			Set bIsArmorHeavyGLOB to (bIsArmorHeavyGLOB == 0)		EndIf	ElseIf (Player.GetEquipped HeavyArmorFLST != bIsArmorHeavyGLOB)		Set bIsArmorHeavyGLOB to (bIsArmorHeavyGLOB == 0)	EndIfEnd
...then the weapon(s) could be scripted with...
	If bIsArmorHeavyGLOB		; Heavy armor code	Else		; Light armor code	EndIf

User avatar
Tyler F
 
Posts: 3420
Joined: Mon Aug 27, 2007 8:07 pm


Return to Fallout 3