Smirkyguy Posted October 6, 2020 Share Posted October 6, 2020 Okay so... I want a follower to say a specific line whenever the player enters the mining animation. Doesn't matter if its clay, geode, ore, just as long as the mining animation is detected. Any help? Link to comment Share on other sites More sharing options...
dylbill Posted October 6, 2020 Share Posted October 6, 2020 (edited) If you look at the vanilla MineOreFurnitureScript they use: RegisterForAnimationEvent(Game.GetPlayer(), "IdlePickaxeExit") RegisterForAnimationEvent(Game.GetPlayer(), "IdlePickaxeFloorExit") RegisterForAnimationEvent(Game.GetPlayer(), "IdlePickaxeTableExit") RegisterForAnimationEvent(Game.GetPlayer(), "IdleFurnitureExit")I tried changing Exit to Enter in all of those in my own script, and then doing : Event OnAnimationEvent(ObjectReference akSource, String asEventName) Debug.Notification("Player Mining") EndEventBut that didn't work. If you can find the right names for the enter animation events that should get the job done. Edited October 6, 2020 by dylbill Link to comment Share on other sites More sharing options...
Smirkyguy Posted October 6, 2020 Author Share Posted October 6, 2020 I mean, would the exit ones also work? It doesn't have to trigger at exactly the beginning, just some time during. Link to comment Share on other sites More sharing options...
dylbill Posted October 7, 2020 Share Posted October 7, 2020 The exit ones work I think, but it triggers when you've finished mining. Also I would get rid of the RegisterForAnimationEvent(Game.GetPlayer(), "IdleFurnitureExit") line because I think that's for any type of furniture. Link to comment Share on other sites More sharing options...
Smirkyguy Posted October 7, 2020 Author Share Posted October 7, 2020 That's fine! As long as it triggers! Can I get the full script, and how to use it in dialogue conditions? I am a bit rusty at papyrus programming... Link to comment Share on other sites More sharing options...
dylbill Posted October 7, 2020 Share Posted October 7, 2020 This is how I would do it. Make a new Global Variable, and call it something like PlayerMining. Attach this script to your quest: Scriptname DetectPlayerMiningScript extends Quest GlobalVariable Property PlayerMining Auto Event OnInit() RegisterForAnimationEvent(Game.GetPlayer(), "IdlePickaxeExit") RegisterForAnimationEvent(Game.GetPlayer(), "IdlePickaxeFloorExit") RegisterForAnimationEvent(Game.GetPlayer(), "IdlePickaxeTableExit") EndEvent Event OnAnimationEvent(ObjectReference akSource, String asEventName) PlayerMining.SetValue(1) Utility.Wait(30) ;waits 30 seconds PlayerMining.SetValue(0) EndEventThen, in your dialogue condition put GetGlobalValue PlayerMining == 1 I just checked though, and those animation events don't work either. Maybe a work around can be found. I'll think about it some more and get back to ya. Link to comment Share on other sites More sharing options...
Smirkyguy Posted October 7, 2020 Author Share Posted October 7, 2020 I see... well, I'm also hoping to add a similar dialogue to cooking on a pot, so add that to your research. Link to comment Share on other sites More sharing options...
dylbill Posted October 7, 2020 Share Posted October 7, 2020 (edited) Ok I figured out a way. First make 2 new global variables named PlayerMining and PlayerCooking. Leave them set to 0. Make a new reference alias in your Quest that points at the player. Fill type: Specific Reference. Cell: Any. Ref: PlayerRef. Then attach this script to the reference alias: Scriptname DetectPlayerFurnitureScript extends ReferenceAlias GlobalVariable Property PlayerMining Auto GlobalVariable Property PlayerCooking Auto Keyword Property CraftingCookpot Auto Event OnSit(ObjectReference akFurniture) Utility.Wait(0.2) MineOreFurnitureScript ScriptRef = akFurniture as MineOreFurnitureScript ;Debug.Notification("Enter Furniture") If ScriptRef != None ;if furinture we are using has the MineOreFurnitureScript attached. Assume player is mining. ;Debug.Notification("Player Mining") PlayerMining.SetValue(1) Elseif akFurniture.GetBaseObject().HasKeyword(CraftingCookpot) ;if furniture is cooking pot. ;Debug.Notification("Player cooking") PlayerCooking.SetValue(1) Endif EndEvent Event OnGetUp(ObjectReference akFurniture) PlayerMining.SetValue(0) PlayerCooking.SetValue(0) ;Debug.Notification("Exit Furniture") EndEvent After compiling the script, click on it, click properties and Auto Fill All. This should automatically set all of your properties. Then in your dialogue conditions put GetGlobalValue PlayerMining == 1 and GetGlobalValue PlayerCooking == 1. Hope that helps! Edited October 7, 2020 by dylbill Link to comment Share on other sites More sharing options...
Smirkyguy Posted October 7, 2020 Author Share Posted October 7, 2020 Have tested and it's not working... uncommenting the debug lines reveals the script isn't activating. Any steps you left out on the alias creation? Link to comment Share on other sites More sharing options...
dylbill Posted October 7, 2020 Share Posted October 7, 2020 If your quest is already running in the save, try stopping the quest and starting it again. You can do that with console commands StopQuest <QuestID> and then StartQuest <QuestID>. I Tested it and it was working for me. Link to comment Share on other sites More sharing options...
Recommended Posts