Difference between revisions of "SetItemCharge - ObjectReference"

From the CreationKit Wiki
Jump to navigation Jump to search
imported>Wafflesalot
(Created page with "Category:Scripting Category:Papyrus Category:SKSE '''SKSE Member of:''' ObjectReference Script This Function will set a ObjectReference's charge to the specif...")
 
imported>Wafflesalot
m (Added Links to GetItemCharge and GetItemMaxCharge.)
 
(One intermediate revision by the same user not shown)
Line 33: Line 33:
== See Also ==
== See Also ==
*[[ObjectReference Script]]
*[[ObjectReference Script]]
*[[GetItemCharge - ObjectReference]]
*[[GetItemMaxCharge - ObjectReference]]

Latest revision as of 00:46, 26 February 2013

SKSE Member of: ObjectReference Script

This Function will set a ObjectReference's charge to the specified amount.

Syntax[edit | edit source]

Function SetItemCharge(float charge) native

Parameters[edit | edit source]

  • charge - The amount, as a float you wish to set the Objects charge to.

Examples[edit | edit source]

ObjectReference Property weaponRef Auto
Float charge 

Function setWeaponcharge()
	Charge = weaponRef.GetItemCharge()
	weaponref.SetItemCharge((Charge + 100.0)); Adds 100 to the Current Charge.
EndFunction
  • Do note that this will only work on a weapon that is currently loaded and not in a container.

Notes[edit | edit source]

  • This function can only be run on items outside of containers, as when they are put into containers member functions cannot be called on them.

See Also[edit | edit source]