ElbyDreamer Posted September 14, 2020 Share Posted September 14, 2020 I'm working on my first custom voiced follower mod, and want to add certain voice lines that will only activate when the player is encumbered,I've been able to use the conditions for many other things, like checking which items the player has in their inventory, the time of day, etc.Though I can't seem to find a way to set encumbrance as a condition. Anyone have any ideas how I could make that happen? Link to comment Share on other sites More sharing options...
dylbill Posted September 14, 2020 Share Posted September 14, 2020 I don't think this will be possible without some polling and scripting, as I don't see the condition IsOverEncumbered in the CK. This is how I would do it. I would make a spell ability and put it on the player, that tracks the players carry weight with a global variable. For an example, just call the global variable PlayerCarryWeightTrackerPut the condition on the spell's magic effect: GetActorValue CarryWeight != (check the Use global box and choose PlayerCarryWeightTracker) Then, on the spell's magic effect, put this script: Scriptname PlayerCarryWeightTrackerScript extends ActiveMagicEffect GlobalVariable Property PlayerCarryWeightTracker Auto Actor Property PlayerRef Auto ;This magic effect starts whenever the players carry weight changes Event OnEffectStart(Actor akTarget, Actor akCaster) Utility.Wait(1) PlayerCarryWeightTracker.SetValue(PlayerRef.GetAV("CarryWeight")) EndEventThen, in your dialogue, put the condition GetActorValue InventoryWeight >= (check the Use global box and choose PlayerCarryWeightTracker) and have it run on the player. Link to comment Share on other sites More sharing options...
ElbyDreamer Posted September 20, 2020 Author Share Posted September 20, 2020 (edited) I don't think this will be possible without some polling and scripting, as I don't see the condition IsOverEncumbered in the CK. This is how I would do it. I would make a spell ability and put it on the player, that tracks the players carry weight with a global variable. For an example, just call the global variable PlayerCarryWeightTrackerPut the condition on the spell's magic effect: GetActorValue CarryWeight != (check the Use global box and choose PlayerCarryWeightTracker) Then, on the spell's magic effect, put this script: Scriptname PlayerCarryWeightTrackerScript extends ActiveMagicEffect GlobalVariable Property PlayerCarryWeightTracker Auto Actor Property PlayerRef Auto ;This magic effect starts whenever the players carry weight changes Event OnEffectStart(Actor akTarget, Actor akCaster) Utility.Wait(1) PlayerCarryWeightTracker.SetValue(PlayerRef.GetAV("CarryWeight")) EndEventThen, in your dialogue, put the condition GetActorValue InventoryWeight >= (check the Use global box and choose PlayerCarryWeightTracker) and have it run on the player. What a brilliant idea, thank you! I followed your steps a few times, but sadly I couldn't get it to work. My follower just says the lines at random intervals, regardless of the player's inventory state.I'm pretty sure it's because I made a mistake somewhere though, since up until this point I've only made house or cosmetic npc mods, so I don't have any experience with creating spells and the like. I've taken a few screenshots of what I did, so that you might be able to spot my mistake. (Screenshots part 1: Global Variable and Script) Edited September 20, 2020 by ElbyDreamer Link to comment Share on other sites More sharing options...
ElbyDreamer Posted September 20, 2020 Author Share Posted September 20, 2020 (edited) (Screenshots part 2: Spell) Edited September 20, 2020 by ElbyDreamer Link to comment Share on other sites More sharing options...
ElbyDreamer Posted September 20, 2020 Author Share Posted September 20, 2020 (edited) (Screenshots part 3: Spell Effect) Edited September 20, 2020 by ElbyDreamer Link to comment Share on other sites More sharing options...
ElbyDreamer Posted September 20, 2020 Author Share Posted September 20, 2020 (edited) (Screenshots part 4: Voice line) Edited September 20, 2020 by ElbyDreamer Link to comment Share on other sites More sharing options...
dylbill Posted September 20, 2020 Share Posted September 20, 2020 (edited) It looks like your script isn't running, so your global variable is staying at 0. In your script, get rid of the second line and the bracket "}" after EndEvent, then save / compile the script. Then you have to fill the properties. Click on the script in the magic effect, click Properties then click auto fill all. Both properties should be filled as you've already made the global variable. To check if the script is running, you can add a debug.notification, like so. Scriptname PlayerCarryWeightTrackerScript extends ActiveMagicEffect GlobalVariable Property PlayerCarryWeightTracker Auto Actor Property PlayerRef Auto ;This magic effect starts whenever the players carry weight changes Event OnEffectStart(Actor akTarget, Actor akCaster) Utility.Wait(1) PlayerCarryWeightTracker.SetValue(PlayerRef.GetAV("CarryWeight")) Debug.Notification("Player Carry Weight Changed") EndEventIf the script is running, you should get a notification when you first load your game, and whenever your player's carry weight changes. Oh, one more thing, I forgot you have to add the ability to the player. To do this what I typically do is put a script on a new quest that's start game enabled, like this: Scriptname ED_CarryWeightInitScript extends Quest Spell Property ED_PlayerCarryWeight Auto Actor Property PlayerRef Auto Event OnInit() Utility.Wait(1) PlayerRef.AddSpell(ED_PlayerCarryWeight) Utility.Wait(1) Self.Stop() ;Stops this quest. EndEventDon't forget to fill the properties of the quest script too. Edited September 20, 2020 by dylbill Link to comment Share on other sites More sharing options...
ElbyDreamer Posted September 23, 2020 Author Share Posted September 23, 2020 (edited) It works perfectly now! Thank you so very much for your help! Edited September 23, 2020 by ElbyDreamer Link to comment Share on other sites More sharing options...
dylbill Posted September 23, 2020 Share Posted September 23, 2020 No problem, glad it's working! Link to comment Share on other sites More sharing options...
Recommended Posts