Problem: I need to utilize several Actor script Events as they occur on the Player (OnInit, OnPlayerLoadGame, OnObjectEquipped, OnObjectUnequipped). However, I have the feeling that attaching the script directly to the Player actor in the Creation Kit is not the correct way to do this. Can someone please tell me what the correct method of accomplishing what I intend would be done in the CreationKit?
Example Script:
Scriptname CarryWeightScript extends ActorGlobalVariable Property EquippedItemWeightTracker AutoEvent OnOnit Game.GetPlayer().UnequipAll() EquippedItemWeightTracker.SetValue( 0.0 ) UpdateCarryWeight()EndEventEvent OnPlayerLoadGame() UpdateCarryWeight()EndEventEvent OnObjectEquipped(Form akBaseObject, ObjectReference akReference) Float ItemWeight = akBaseObject.GetWeight() as Float EquippedItemWeightTracker.Mod( ItemWeight ) UpdateCarryWeight()EndEventEvent OnObjectEquipped(Form akBaseObject, ObjectReference akReference) Float ItemWeight = akBaseObject.GetWeight() as Float ItemWeight *= -1.0 EquippedItemWeightTracker.Mod( ItemWeight ) UpdateCarryWeight()EndEventFuntion UpdateCarryWeight() Float CarryWeight = EquippedItemWeightTracker.GetValue() as Float CarryWeight += 10.0 ; Allow only 10 units of items to be carried beyond what is equipped. Game.GetPlayer().SetActorValue("CarryWeight", CarryWeight )EndFunction