CeeTeeDee Posted September 27, 2014 Share Posted September 27, 2014 Hi, Â I'm still a papyrus noob but I have some reasonable OO programming experience... Â Is there a way to create a simple script in the CK which issues a console command (setnpcweight) on a target actor, either through a savegame load or an item? Link to comment
Srende Posted September 27, 2014 Share Posted September 27, 2014 Make a new quest in CK, set it start game enabled. Add a single reference alias to it that you force to point to the player. Add this script to the alias: Scriptname myWeightScript extends ReferenceAlias  Actor property targetActor auto  Event OnPlayerLoadGame()    float currentWeight = targetActor.GetWeight()    float targetWeight = 50.0    float delta = (currentWeight / 100) - (targetWeight / 100)     targetActor.GetLeveledActorBase().SetWeight(targetWeight)    targetActor.UpdateWeight(delta) EndEvent After that, save the script and open its properties (double click it on the list), and fill the targetActor property to point to the character you want. Now it'll update on every game load, except the first one after activating your mod.  This is based purely on the documentation in the CK wiki, I haven't used weight change functions before, so dunno if there are any quirks http://www.creationkit.com/UpdateWeight_-_Actor http://www.creationkit.com/SetWeight_-_ActorBase   You can't call console commands directly, instead you need to find and use an equivalent function somewhere, which may or may not exist. Link to comment
Versh Posted September 27, 2014 Share Posted September 27, 2014 I'm not sure about what you're asking... Â You want to know if is possible emulate a Console command via script? Sure... Â You want to know how to do? there are a dozen of way to do this, you should be more specific... what you want to do, exactly? Â Â Edit: Ok, Srende First Link to comment
CeeTeeDee Posted September 27, 2014 Author Share Posted September 27, 2014 Make a new quest in CK, set it start game enabled. Add a single reference alias to it that you force to point to the player. Add this script to the alias: Scriptname myWeightScript extends ReferenceAlias  Actor property targetActor auto  Event OnPlayerLoadGame()    float currentWeight = targetActor.GetWeight()    float targetWeight = 50.0    float delta = (currentWeight / 100) - (targetWeight / 100)     targetActor.GetLeveledActorBase().SetWeight(targetWeight)    targetActor.UpdateWeight(delta) EndEvent After that, save the script and open its properties (double click it on the list), and fill the targetActor property to point to the character you want. Now it'll update on every game load, except the first one after activating your mod.  This is based purely on the documentation in the CK wiki, I haven't used weight change functions before, so dunno if there are any quirks http://www.creationkit.com/UpdateWeight_-_Actor http://www.creationkit.com/SetWeight_-_ActorBase   You can't call console commands directly, instead you need to find and use an equivalent function somewhere, which may or may not exist.   You know, its people like you that keep this community going.  Thanks alot, i'll give it a try. Link to comment
Recommended Posts
Archived
This topic is now archived and is closed to further replies.